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

18 views (last 30 days)
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.

Answers (1)

Devineni Aslesha
Devineni Aslesha on 24 Feb 2020
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]);

Categories

Find more on MATLAB 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!