Message Boards Message Boards

0
|
2040 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Perturb parameters during NDSolve run?

Posted 10 years ago

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!

POSTED BY: Leila Lindsey
3 Replies
Posted 10 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 BY: Bill Simpson

If simple approaches fail you might want to look here.

tutorial/NDSolveWhenEvents#1688891301

It 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 BY: Daniel Lichtblau
Posted 10 years ago

Thank you! Yes; although I was hoping to specifically change C1, for example, at t >= 50 for example.

POSTED BY: Leila Lindsey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract