how to fix ode45 parameters?
1 view (last 30 days)
Show older comments
Error using derivative
Expected state to be finite.
Error in jointSpaceMotionModel/derivative (line 251)
validateattributes(state, {'double'}, {'nonempty', 'vector', 'numel', 2*obj.NumJoints,
'finite', 'real'}, 'derivative', 'state');
Error in file_verifica_controllori>@(t,y)derivative(computedTorqueMotion,y,qDesComputedTorque) (line
31)
[tComputedTorque,yComputedTorque] =
ode45(@(t,y)derivative(computedTorqueMotion,y,qDesComputedTorque),tSpan,initialState);
Error in ode45 (line 299)
f2 = odeFcn_main(t2, y2);
Error in file_verifica_controllori (line 31)
[tComputedTorque,yComputedTorque] =
ode45(@(t,y)derivative(computedTorqueMotion,y,qDesComputedTorque),tSpan,initialState);
Hi! what's the problem with ode45? I tried to reduce the step size but didn't work.
0 Comments
Answers (1)
Cam Salzberger
on 7 Jul 2021
The value of "y" (the "state" input to "derivative") is going infinite or NaN at some point. I'd suggest creating a helper function that calls derivative, and use the helper function as the ode45 function. Then you can either add some printout statements or insert a breakpoint so you can see when the state is going infinite and possibly why.
-Cam
0 Comments
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!