How to get the output result from a jacobian as this.
2 次查看(过去 30 天)
显示 更早的评论
I was trying to get the number result from the jacobian by define X1 to X7 after I found the jacobian in X1 to X7 term as the code show. How can i do this?
clc
clear
accept_error = 0.001;
maxiter = 50;
P = 20;
dx = 0;
X0 = [0.5;1;0.5;0;0;1;1]; %Initial Guess
syms X1 X2 X3 X4 X5 X6 X7
F = [0.5*X1 + X2 + 0.5*X3 - X6/X7;
X3 + X4 + 2*X5 - 2/X7;
X1 + X2 + X5 - 1/X7;
-28837*X1 - 139009*X2 - 78213*X3 + 18927*X4 + 8427*X5...
+ (13492/X7) - 10690*(X6/X7);
X1 + X2 + X3 + X4 + X5 - 1;
(P^2)*X1*(X4^3) - 1.7837*(10^5)*X3*X5;
X1*X3-2.6058*X2*X4];
jac = jacobian(F,[X1,X2,X3,X4,X5,X6,X7]);
X1 = X0(1); X2 = X0(2); X3 = X0(3); X4 = X0(4); X5 = X0(5);
X6 = X0(6); X7 = X0(7);
Result = jac; %%%???
0 个评论
采纳的回答
Torsten
2022-3-24
jac = subs(jac,[X1,X2,X3,X4,X5,X6,X7],[X0(1),X0(2),X0(3),X0(4),X0(5),X0(6),X0(7)])
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!