fsovle error 241

6 ビュー (過去 30 日間)
HAO-CHUN
HAO-CHUN 2012 年 6 月 27 日
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.

採用された回答

Sean de Wolski
Sean de Wolski 2012 年 6 月 27 日
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 件のコメント
Walter Roberson
Walter Roberson 2012 年 6 月 27 日
Sean, did you mean
x = fsolve(fun, x0);
Sean de Wolski
Sean de Wolski 2012 年 6 月 27 日
you betcha

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSignal 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