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

27 visualizaciones (últimos 30 días)
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.

Respuestas (1)

Devineni Aslesha
Devineni Aslesha el 24 de Feb. de 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]);

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by