Filter löschen
Filter löschen

Simulink presenting a convergence error

4 Ansichten (letzte 30 Tage)
Lucas duboc
Lucas duboc am 10 Apr. 2024
Kommentiert: Lucas duboc am 11 Apr. 2024
I made a simple simulaltion of a x=Asen(wt) function in simulink using differential equations, but instead of a constant senoidal curve, it is converging to zero, although its very slow (w needs to be high or simulation time needs to be very long), here is the simulink code, and the scope output, the only custom things to simulink is a fixed simulation step of 0.01.
Original function is A*sin(wt), with A=2 and w = 60 modeled as a differential equation of x''(t) = -w² *x(t), x'(0) = Aw and x(0) = 0
I think the problem is a rounding error since it is very slow, but I don't know how to fix it

Akzeptierte Antwort

Paul
Paul am 10 Apr. 2024
Setting the fixed-step solver to ode8 seems to work pretty well for the problem shown in the question with a fixed step of 0.01. Don't know how well ode8 will work for other choices of w and step size, but I suspect it will be better than any of the others for this particular system.
  1 Kommentar
Lucas duboc
Lucas duboc am 11 Apr. 2024
thank you, worked fine now, but got a little choppy with a 0.01 step, but the 0.001 step works just as well

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu General Applications finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by