필터 지우기
필터 지우기

How to solve 3 non-linear equations with 3 unknowns?

조회 수: 10 (최근 30일)
Nikhil Shriyan
Nikhil Shriyan 2020년 2월 20일
답변: Alex Sha 2020년 2월 26일
This is my code with solve,
G= 1000;
T=298;
Iscr = 9.71; %short citrcuit current
Vocr = 6; %Open circuit voltage
Im = 9.4; %MPP current
Vm = 5.5; %MPP coltage
K_Isc = 0.0005;
Vth = 0.8629*10^(-4)*T;
Iph= (G/1000) * Iscr* (1-(K_Isc)* (T-298 ));
n = 1;
%Io =x
%Rs = y
%Rsh = z
syms x y z
u = -Iscr + Iph - (x * ((exp((Iscr*y)/(n*Vth)))-1)) - ((Iscr*y)/z)==0;
v = Iph - (x * ((exp((Vocr)/(n*Vth)))-1)) - ((Vocr)/z)==0;
w = -Im + Iph - (x * ((exp((Vm + Im*y)/(n*Vth)))-1)) - ((Vm + (Im*y))/z)==0;
x0 = [10^-8,0.2,2500];
d = solve([u,v,w],[x,y,z],x0);
But I got this error:
>> fsolve18_2
Error using sym.getEqnsVars>checkVariables (line 87)
Second argument must be a vector of symbolic variables.
Error in sym.getEqnsVars (line 54)
checkVariables(vars);
Error in solve>getEqns (line 429)
[eqns, vars] = sym.getEqnsVars(argv{:});
Error in solve (line 226)
[eqns,vars,options] = getEqns(varargin{:});
Error in solve18_2 (line 24)
d = solve([u,v,w],[x,y,z],x0);

답변 (2개)

Jyotsna Talluri
Jyotsna Talluri 2020년 2월 24일
편집: Jyotsna Talluri 2020년 2월 24일
We have to specify the equations to solve as the first input argument and variables for which the equation has to be solved as the second input argument to the solve function.There should not be any third argument .Moreover the third argument x0 which you specified is not being used anywhere.
d = solve([u,v,w],[x,y,z]);
d gives the values of x,y,z for which equations u,v,w are satisfied
Refer to the below link for more details

Alex Sha
Alex Sha 2020년 2월 26일
One of numerical solution looks like:
x: 4.49127153145489E-101
y: 0.0437692354838294
z: 867273686630772

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by