Question: Adding a legend to DEplot

Hi there,

I have an ode that I want to plot, I am trying to plot 2 different graphs on one graph and have tried using display but cannot seem to add a legend to it. Someone suggested adding a legend to each individual graph before combining them but I cannot find out how to add a legend to a DEplot. My code is as follows:

 

ode:=diff(u(t),t$2)-0.1*(1-64*u(t)^2)*diff(u(t),t$1)+16*u(t)=0

Q1:=v/4*sin(4*t)+epsilon*(1/8*(v-v^3)*t*sin(4*t)+v^3/128*(cos(4*t)-cos(12*t)))

A:=DEplot(ode,u(t),t=0..10, [[u(0)=0, D(u)(0)=v]], u=-0.5..0.5, linecolor=black, linestyle=dash, title="Numerical Solution"):

B:=plot(Q1, t=0..10, u=-0.5..0.5,color=blue, legend="Regular Perturbation Expansion"):

display([A,B],title="Comparing the regular perturbation expansion to the numerical solution")

 

Many thanks

Please Wait...