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.
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!