how to substitute sym variables in jacobian matrix with numeric values?

32 ビュー (過去 30 日間)
Nikhil Shriyan
Nikhil Shriyan 2020 年 2 月 20 日
回答済み: Devineni Aslesha 2020 年 2 月 24 日
syms x y z
u = -Iscr + Iph - (x * ((exp((Iscr*y)/(n*Vth)))-1)) ...
- ((Iscr*y)/z);
v = Iph - (x * ((exp((Vocr)/(n*Vth)))-1)) - ((Vocr)/z);
w = -Im + Iph - (x * ((exp((Vm + Im*y)/(n*Vth)))-1))...
- ((Vm + (Im*y))/z);
a= jacobian([u;v;w],[x,y,z])
j=subs(a,[x,y,z],[xo,yo,zo]) %% This doesn't work, please explain why and also the alternative to this.

回答 (1 件)

Devineni Aslesha
Devineni Aslesha 2020 年 2 月 24 日
The ‘subs’ function works as expected. Please find the code shown below.
Iscr = 1;
Iph = 2;
Vth = 5;
n = 4;
Vocr = 3;
Im = 2;
Vm = 5;
syms x y z
u = -Iscr + Iph - (x * ((exp((Iscr*y)/(n*Vth)))-1)) ...
- ((Iscr*y)/z);
v = Iph - (x * ((exp((Vocr)/(n*Vth)))-1)) - ((Vocr)/z);
w = -Im + Iph - (x * ((exp((Vm + Im*y)/(n*Vth)))-1))...
- ((Vm + (Im*y))/z);
a = jacobian([u;v;w],[x,y,z]);
j = subs(a,[x,y,z],[1,2,3]);

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by