0
|
11474 Views
|
5 Replies
|
4 Total Likes
View groups...
Share
GROUPS:

# Plot solution of differential equation with conditional constant term

Posted 11 years ago
 Hi.I intend to plot a function with a term 'F' which is dependant on the value of 'y': m := 1200 k := 300000 b := 25 g := 9.81 F := If[y[t] < -0.4, -m g +     Abs[b (-y'[t]) Sqrt[y[t] + 0.4] + k y[t]], -m g] y''[t_] := F/m system = DSolve[{y''[t_] := F/m, y == 0, y' == 0}, y, t] Plot[y[t] /. system, {t, 0, 5}]The scenario is a falling object which can be modelled as a damper and spring; once it hits the floor then a bouncing force will arise, defined when y=-0.4. I am not sure how to go about this. Thanks for any help!
5 Replies
Sort By:
Posted 11 years ago
 Thanks guys Posted 11 years ago
 While "EventLocator" still exists for backward compatibility, starting with Mathematica 9 the recommended tutorial would be Events and Discontinuities in Differential Equations.
Posted 11 years ago
 julian, you may also take a quick look of this documentation about event locator method in Mathematica 9.
Posted 11 years ago
 Allright! Thanks mate!
Posted 11 years ago
 May be so:m := 1200k := 300000b := 25g := 9.81F[t_] := If[y[t] < -0.4, -m g + Abs[b (-y'[t]) *Sqrt[y[t] + 0.4] + k y[t]], -m g]system = NDSolve[{y''[t] == F[t]/m, y == 1, y' == 0},y, {t, 0, 5}]Plot[y[t] /. system, {t, 0, 5}] 