I have the following system of non-linear equations:
f(x)={(x(1)^5 + x(2)^3*x(3)^4 + 1)
(x(1)^2*x(2)*x(3))
(X(3)^4 - 1)}
My problem says: Compute the Jacobian, J(x) (Note that the Jacobian is singular for x(3)=0)
So far, I have used:
syms x y z jacobian([x^5 + y^3*z^4 + 1; x^2*y*z; z^4-1],[x;y;z])
and a have following matrix
ans =
[ 5*x^4, 3*y^2*z^4, 4*y^3*z^3]
[ 2*x*y*z, x^2*z, x^2*y]
[ 0, 0, 4*z^3]
Now, what is my next step to compute Jacobian?

 Accepted Answer

Torsten
Torsten on 3 Feb 2015
The matrix you got is the Jacobian.
You just have to replace x by x(1), y by x(2) and z by x(3).
Best wishes
Torsten.

6 Comments

Thank you for your responce... I thought there was more... i will replace them, but how can i note that Jacobian is singular for x(3)=0.... According to what?
And my next question is how can I solve this:
Consider two initial quesses: 1) x0=(-.01, -.01, -.01)T and 2) x0=(.1, .1, .1)T
AND Compute both |J(x0)^-1|
I will appreciate your help Torsten, i am begginer in Matlab...
1. The third row of the Jacobian becomes zero if you insert x(3)=0. This means that the Jacobian becomes singular if x(3)=0.
2. Insert x(1)=-0.01, x(2)=-0.01, x(3)=-0.01 and let MATLAB calculate inv(J)
(if |J(x0)^(-1)| means "determinant of J", then let MATLAB calculate det(inv(J)) for you).
Best wishes
Torsten.
Ana Garvanlieva
Ana Garvanlieva on 4 Feb 2015
Edited: Ana Garvanlieva on 4 Feb 2015
So i Insert theese comands
>> syms x1 x2 x3
>> J1 = jacobian([x1^5 + x2^3*x3^4 + 1; x1^2*x2*x3; x3^4-1],[x1;x2;x3])
>> x3=0
How to call the matrix now?
When I call it with
>> J1 = jacobian([x1^5 + x2^3*x3^4 + 1; x1^2*x2*x3; x3^4-1],[x1;x2;x3])
i get
J1 =
[ 5*x1^4, 0, diff(x1^5 + 1, 0)]
[ 0, 0, diff(0, 0)]
[ 0, 0, diff(-1, 0)]
And why do I need inv(J) for x0=(-.01, -.01, -.01)^T???
Thank you verry much for your responces...
@Torsten, can you help me?
Use MATLAB's "subs"-command:
syms x1 x2 x3
J1 = jacobian([x1^5 + x2^3*x3^4 + 1; x1^2*x2*x3; x3^4-1],[x1;x2;x3]);
J2 = subs(J1,x3,0);
J3 = subs(J1,[x1,x2,x3],[-.01, -.01, -.01]);
J4 = subs(J1,[x1,x2,x3],[.1, .1, .1]);
val1=1/det(J3); %calculates |J(x0)^-1| for the first initial guess
val2=1/det(J4); %calculates |J(x0)^-1| for the second initial guess
Best wishes
Torsten.
Ana Garvanlieva
Ana Garvanlieva on 12 Mar 2015
Edited: Ana Garvanlieva on 16 Mar 2015
@Torsten Do you know, and can you help me with the code for the Newton method. As help I have instructions to note some difficulties with convergence and "As a remedy implement a damped Newton modification using the Armijo-Goldstein criterion."

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!