Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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 ]
Torsten

Posts: 1,439
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 " <soradak@sut.ac.th> wrote in message <lgug18$5p7$1@newscl01ah.mathworks.com>...
> 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


http://www.mathworks.de/de/help/optim/ug/passing-extra-parameters.html
Using anonymous functions to pass parameters also works with ODE15S instead of fminunc.

Best wishes
Torsten.



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.