Constraints other than nonnegativity on ode solver?
4 views (last 30 days)
Show older comments
I'm using ode45 to solve the equations of motion of some robot arm. I know I can use the odeset option 'NonNegative' to tell the solver that certain states must be nonnegative, but what if I want certain states to be bounded by different numbers? So say, I have a state q: q = [q1 q2 q3] and I want q1 to be in between -pi/2 and pi/2 and I want q3 to be in between 0 and 1... Is there any way to do this?
Thanks in advance
0 Comments
Answers (1)
Matt J
on 13 Dec 2014
Edited: Matt J
on 15 Dec 2014
You could try transforming the state variable like
q3=sin(y)/2+1/2
where y is the transformed state variable. The derivatives in the state equation also have to rewritten in terms of y
dq3/dt= (cos(y)/2)*dy/dt
but it looks like the cos(y)/2 part can be accounted for using a mass matrix.
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!