fsovle error 241

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.

 采纳的回答

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 个评论

Sean, did you mean
x = fsolve(fun, x0);
you betcha

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Signal Integrity Kits for Industry Standards 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by