how to use pulstran with ode45 function

1 vue (au cours des 30 derniers jours)
Hamza Khalil
Hamza Khalil le 27 Août 2019
Commenté : Hamza Khalil le 27 Août 2019
I have tried to use pulstran with ode45 function but i got this problem ''DE_MDOF returns a vector of length 3005, but the length of initial conditions vector is 6. The vector returned by ODE_MDOF and the initial conditions vector must have the same number of elements.''
  2 commentaires
Jon
Jon le 27 Août 2019
Modifié(e) : Jon le 27 Août 2019
The error is telling you that the function which you evaluate to get your derivatives (I assume this is ODE_MDOF) returns a different number of elements than the vector of initial conditions that you are supplying. They should of course be the same as you need to have a derivative for each state and an initial condition for each state. If you still can not figure out where things are going wrong that are resulting in the lengths of the two vectors being inconsistent, then please provide the relevant portions of your code.
Hamza Khalil
Hamza Khalil le 27 Août 2019
thank you very much for your help im trying to put this function as force
f0=1;
Fs=10000;
Tf=5;
t=0:1/Fs:Tf-1/Fs;
td=0.012; % duty cycle
A0=1; % 10 Volts
F=0;
N=1000; % Number of points
for n=1:N
F=F+(1/n)*cos(n*2*pi*f0*t).*sin(n*pi*td);
end
F=F';
into the ODE45 function but i get ''returns a vector of length 3005'' error. however if i used f=50;
w= 2*pi*f;
A=1;
F= sin(w*t)
it will work just fine

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by