Not enough input arguments.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Mohammad Hasn Hashemi
il 25 Gen 2021
Commentato: Walter Roberson
il 25 Gen 2021
Hi everybody
I am trying to solve a couples ODE system, I wrote the code below but it has an error. I changed the code several times but it didnt work. How can I fix it???
thank you.
Risposta accettata
Alan Stevens
il 25 Gen 2021
Modificato: Rik
il 25 Gen 2021
More like this:
t=0:0.1:5;
x0=0;
xdot0=5;
z0=[x0,xdot0];
[T,Z]=ode45(@motor,t,z0); % Note @motor, not just motor.
plot(T,Z)
function Zdot=motor(t,Z)
Zdot=zeros(2,1);
Rs=0.1;
Ls=0.5;
W=314;
%B=0;
Zdot(1)=(-Rs*Z(1)+100*sin(W*t))/Ls;
Zdot(2)=(-Rs*Z(2)+100*sin(W*t-(pi/2)))/Ls;
end
2 Commenti
Alan Stevens
il 25 Gen 2021
I corrected the other errors! Copy and paste the coding. Look carefully at the other lines.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!