# M145L.W99, Week 4, Lab #3 # by ralph abraham, 24 january 1999 # file: duffing, this is a MapleVr5 worksheet # # we follow Ueda # # This is the unforced Duffing in Ueda form # Experiment with changes in the parameter (k > 0) # Define the vectorfield > k := 5.0: > xdotexpr := y: > ydotexpr := -k*y-x*x*x: # Setup initial conditions > myvector1 := subs({x=X(t), y=Y(t)}, xdotexpr): > myvector2 := subs({x=X(t), y=Y(t)}, ydotexpr): > eq1 := diff(X(t),t)=myvector1: > eq2 := diff(Y(t),t)=myvector2: > ini := X(0) = 0.5, Y(0) = 0.0: # Plot the direction field and trajectories > sol1 := dsolve( {eq1, eq2, ini}, {X(t),Y(t)}, type=numeric ); sol1 := proc(rkf45_x) ... end > with(plots): > odeplot( sol1, [X(t), Y(t)], -2.0..2.0, labels=["x","y"] ); # This is the end of file: duffing