0
$\begingroup$

I am trying to simulate the following block diagram in Matlab Simulink

enter image description here

which simulates the equation: $\ddot{y}(t) = - \omega_0^2\ y(t)$ with the second integrator having the initial condition of 1. where this equation can have the solution : $y(t) = cos(\omega_0 t)$

but upon simulation, I got the following result:

enter image description here

I can notice the mathematical solution doesn't follow the actual simulation where the simulation will always produce a sinusoidal trying to reach a stability state which is the oscillation between (inital_condition / 2) and (-inital_condition / 2). So why doesn't the mathematical solution match the simulation

$\endgroup$

1 Answer 1

0
$\begingroup$

the problem was with Simulink itself. I had to make the step size constant and very small in the model parameters to catch the whole signal.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.