non-linear equations Jacobian

4 views (last 30 days)
Ana Garvanlieva
Ana Garvanlieva on 3 Feb 2015
Edited: Ana Garvanlieva on 16 Mar 2015
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
Torsten
Torsten on 5 Mar 2015
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)

Community Treasure Hunt

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

Start Hunting!