I am trying to optimize the attached problem, but I always receive these errors
Error using objfuntest>@(X)ODEtest(X,g0,Isp,thrust)Too many input arguments.Error in odearguments (line 90)f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);Error in objfuntest (line 12)[t,x]=ode45(@(X)ODEtest(X,g0,Isp,thrust),tSpan,initial,options);%solve equations for
OptimizationError in maintest>@(X)objfuntestError in fmincon (line 546) initVals.f = feval(funfcn{3},X,varargin{:});Error in maintest (line 15)mfopti=fmincon(myObjective,X0,A,b,Aeq,beq,lb,ub,nonlcon)Caused by: Failure in initial objective function evaluation. FMINCON cannot continue.
And I don't get it, because if I don't pass the parameters to my function I get the same error. But that would mean that I have to clear also the input X, so that I don't have any input, which makes no sense to me. Can anyone see my error of reasoning?
Thanks in advance
Best Answer