fsovle error 241
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Please check for me
Function m-file
function F = spice_fsolve_singleinput_v1(x, Vmax, v, DTmax, Imax, Tau, Tamb,Kt,UA, Tw)
%x(1) = Tc, x(2) = Th, x(3) = vt
F = [(Vmax/x(2))*x(1)*(v/(Vmax*(x(2)-DTmax)/Imax*x(2))) + 1/2*Tau*(v/(Vmax*(x(2)-DTmax)/Imax*x(2)))*(x(2)-x(1)) - 1/2*(v/(Vmax*(x(2)-DTmax)/Imax*x(2)))^2*(Vmax*(x(2)-DTmax)/Imax*x(2)) - ((DTmax*2*x(2))/(Imax*Vmax*(x(2)-DTmax)))*(x(2)-x(1)) - Kt*(Tamb-x(1))
(Vmax/x(2))*x(2)*(v/(Vmax*(x(2)-DTmax)/Imax*x(2))) - 1/2*Tau*(v/(Vmax*(x(2)-DTmax)/Imax*x(2)))*(x(2)-x(1)) + 1/2*(v/(Vmax*(x(2)-DTmax)/Imax*x(2)))^2*(Vmax*(x(2)-DTmax)/Imax*x(2)) - ((DTmax*2*x(2))/(Imax*Vmax*(x(2)-DTmax)))*(x(2)-x(1)) - UA*(x(2)-Tw)
(Vmax/x(2))*(x(2)-x(1)) + (v/(Vmax*(x(2)-DTmax)/Imax*x(2)))*(Vmax*(x(2)-DTmax)/Imax*x(2))-x(3)];
the run-file
DTmax = 69;
Imax = 3.6;
Vmax = 3.8;
Tau=0.1;
Tw=295.75;
Kg=1.05;
Kw=0.58;
v = 0.1878;
Kt =0.081;
UA =10;
Kc = (Kt*(Kg*0.1)*(Kw*1.6))/((Kw*1.6)*(Kg*0.1)-Kt*(Kw*1.6)-Kt*(Kg*0.1));
Tamb = 295.75;
x0 = [295.75; 295.75; 0.1];
x = fsolve(@spice_fsolve_singleinput_v1, x0)
Error came out
Error using spice_fsolve_singleinput_v1 (line 5)
Not enough input arguments.
Error in fsolve (line 241)
fuser = feval(funfcn{3},x,varargin{:});
Error in run_spice_fsolve_singleinput_v1 (line 35)
x = fsolve(@spice_fsolve_singleinput_v1, x0)
Caused by:
Failure in initial user-supplied objective
function evaluation. FSOLVE cannot continue.
0 commentaires
Réponse acceptée
Sean de Wolski
le 27 Juin 2012
You need to pass the various extra arguments to spice_fsolve_singleinput_v1. doc passing extra parameters
For your above case:
fun = @(x)spice_fsolve_singleinput_v1(x, Vmax, v, DTmax, Imax, Tau, Tamb,Kt,UA, Tw)
x = fsolve(fun, x0)
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Signal Integrity Kits for Industry Standards dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!