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

5 次查看(过去 30 天)
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.

采纳的回答

Ameer Hamza
Ameer Hamza 2020-10-24
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)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by