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: How to retrieve a parameter inside ode solver?
Replies: 2   Last Post: Dec 23, 2012 11:29 AM

Advanced Search

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

Posts: 10
Registered: 12/21/12
How to retrieve a parameter inside ode solver?
Posted: Dec 21, 2012 5:52 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


My question is how to retrieve a parameter value inside ode solver? Let's take the control system as an example. I write my own ODE function. Within the ODE function, I compute the control inputs as u=-K*x, where x is the system states and K is a constant matrix. x can be solved by calling ode solver, like ode45. But my question is, how can I get "u"?

I know one solution is that after running the ode solver, then I can write a for loop, like:
for i = 1 : length(x)
u(i) = -K*x(i);

Is there any way that I can retrieve u without using the for loop after running ode solver?


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

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.