How do I simulate a differential equation that has a squared derivative term in Simulink?

1 view (last 30 days)
I have system on hand x'' + 5(x')^2 + 5x = u
I used the below diagram to simulate, is this correct?
I do get a sigularity if I simulate it with the sine wave.

Accepted Answer

Ameer Hamza
Ameer Hamza on 24 Oct 2020
The block diagram seems correct. You can also use this block: https://www.mathworks.com/help/simulink/slref/mathfunction.html to directly square the signal. The result is expected. You can run the following code and see the output is diverging,
dydt = @(t, y) [y(2); -5*y(2)^2 - 5*y(1) + sin(t)];
tsapn = [0 10];
IC = [0; 0];
ode45(dydt, tsapn, IC)

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!