# M145L.W99, Week 4, Lab #3 # by ralph abraham, 24 january 1999 # file: ueda01, this is a MapleVr5 worksheet # # we follow Ueda p. 208 # plotting in 2D # This is the forced Duffing in Ueda form # Experiment with changes in the parameters (k > 0, B >= 0) # Define the vectorfield > k := 0.1: > B := 12.0: > xdotexpr := y: > ydotexpr := -k*y-x*x*x+B*cos(t): # 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 a trajectory in 2D > sol := dsolve( {eq1, eq2, ini}, {X(t),Y(t)}, type=numeric ); sol := proc(rkf45_x) ... end > with(plots): > odeplot(sol, [X(t), Y(t)], 0..10); # This is the end of file: ueda01