Perturb parameters during NDSolve run?

Posted 9 years ago
1847 Views
|
3 Replies
|
3 Total Likes
|
 With this very simple system, is there a way to change the parameters in a successive time interval in order to effectively perturb the system? Manipulate[ soln = NDSolve[{Q''[t] == (-R *Q'[t] - ( Q[t]/C1) + Vo)/L, Q[0] == 1, Q'[0] == 0.5}, {Q[t], Q'[t]}, {t, 0, 100}]; Plot[Evaluate[Q'[t] /. soln], {t, 0, 100}, PlotRange -> All], {R, .1, 1.50}, {C1, 1, 50}, {L, 1, 50}, {Vo, 1, 40}] Thanks!
3 Replies
Sort By:
Posted 9 years ago
 If simple approaches fail you might want to look here.tutorial/NDSolveWhenEvents#1688891301It takes one to Events and Discontinuities in Differential Equations in the documentation. This tutorial covers event detection, changing state variables, and more.Further detailed information about NDSolve may be found at the link below.tutorial/NDSolveOverview
Posted 9 years ago
 Maybe you can adapt something like this? Manipulate[ bump[t_] := Piecewise[{{0, t < 50}, {1, t >= 50}}]; soln = NDSolve[{Q''[t] == (-R*Q'[t] - (Q[t]/C1) + Vo)/L + bump[t], Q[0] == 1, Q'[0] == 0.5}, {Q[t], Q'[t]}, {t, 0, 100}]; Plot[Evaluate[Q'[t] /. soln], {t, 0, 100}, PlotRange -> All], {R, .1, 1.50}, {C1, 1, 50}, {L, 1, 50}, {Vo, 1, 40}] 
Posted 9 years ago
 Thank you! Yes; although I was hoping to specifically change C1, for example, at t >= 50 for example.