Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

I got an error in my script using fsolve command

1 vue (au cours des 30 derniers jours)
Jaime Núñez
Jaime Núñez le 9 Sep 2020
Clôturé : MATLAB Answer Bot le 20 Août 2021
My error is:
Objective function is returning undefined values at initial point. FSOLVE cannot continue.
QR=1000;
T1=20;
T2=T1;
TM=50;
Ks=0.5;
L=0.10;
h1=20;
h2=h1;
hm=10;
R1=1/h1;
R2=1/hm;
R3=1/hm;
R5=1/h2;
%Funciones
F= @(x) [(T1-x(1))/R1+(TM-x(1))/R2+QR;
(x(1)-TM)/R2+(x(2)-TM)/R3;
(TM-x(2))/R3+Ks*(x(3)-x(2))/x(4);
Ks*(x(2)-x(3))/x(4)+(T2-x(3))/R5];
x0=[0,0,0,0];
sol=fsolve(F,x0,options);
R=[sol(1) sol(2) sol(3)];
I don´t know where is the error at :(
  1 commentaire
Alex Sha
Alex Sha le 10 Sep 2020
Hi, Jaime, are the results below you want?
x1: 63.3333333333333
x2: 36.6666666666667
x3: 26.6666666666667
x4: 0.0375

Réponses (1)

Matt J
Matt J le 9 Sep 2020
>> F(x0)
ans =
1900
-1000
NaN
NaN

Community Treasure Hunt

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

Start Hunting!

Translated by