non-linear equations Jacobian
4 views (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
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
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.
More Answers (0)
See Also
Categories
Find more on Math Operations 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!