How to update during ODE45
Mostrar comentarios más antiguos
I want get a function, which is related with motor.
[t,w]=ode45(@(t,w) -Trq/J*t, t_span, w_0)
But motor maximum torque(Trq) is related with motor speed.
Is there any method to change Trq durring ODE45??
Trq is changed by w.
Respuesta aceptada
Más respuestas (1)
Sulaymon Eshkabilov
el 6 de Nov. de 2021
This can be computed with a [for .. end] loop, e.g.:
clc;
clearvars
w = ...;
Trq = 10*w; % E.g.
w_0 = -1.5; % E.g.
J = 150; % E.g.
t_span=[0, 13]; %
for ii=1:numel(Trq)
[t,ww]=ode45(@(t,w)(-Trq(ii)/J*t), t_span, w_0);
plot(t,ww), hold all
Time{ii}=t;
W{ii} =ww;
end
1 comentario
JUNTAE PARK
el 7 de Nov. de 2021
Categorías
Más información sobre State-Space Control Design en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!