The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: passing the parameters to the ode15s
Replies: 4   Last Post: Apr 2, 2014 8:30 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 1,717
Registered: 11/8/10
Re: passing the parameters to the ode15s
Posted: Mar 26, 2014 8:48 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"sorada " <> wrote in message <lgug18$5p7$>...
> Hi all
> I have a problem in passing the parameter in function handling of ODE15s.
> my differential equation in the function handle are
> function dTdy = ff(y,T)
> dTg = (A1*(T(1)-T(2))/(B1)) ...
> +(A2*(T(1)-Tamb)/(B1));
> dTp=A1*(T(1)-T(2))/(B2)+((hfg+Cv*(T(1)-T(2)))/(B3))*A3;
> end
> A1, A2, A3, B1,B2 and B3 = f(T(1),T(2),M,W)
> where M,W are not constant.
> I have equation to calculate all parameter. But I don't know how to passing the M and W in to the function handling.
> MM = eye(4,4);
> y0 = [Tamb;Tpfold(1)];
> yspan = [0:DelY:2.125];
> options = odeset('Mass',MM,'RelTol',1e-1,'AbsTol',[1e-1 1e-1 1e-3 1e-3],...
> 'Vectorized','off');
> [y,T] = ode15s(@ff,yspan,y0,options)
> Do anyone has any suggestion for me?
> What I should do?
> Thank you in advance
> Ann
Using anonymous functions to pass parameters also works with ODE15S instead of fminunc.

Best wishes

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.