how to fix ode45 parameters?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Cam Salzberger
el 7 de Jul. de 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 comentarios
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!