john9ab

0 Reputation

2 Badges

14 years, 141 days

MaplePrimes Activity


These are replies submitted by john9ab

Thats perfect, exactly what i wanted to do. Thanks!

Thats perfect, exactly what i wanted to do. Thanks!

restart;

a:=1;

for n from 1 by 2 to 3

do psi[n]:=sqrt(a)*cos((n*Pi*x)/2*a);

with(plots):

P1:=plot(psi[n],x=-2..2,colour=blue, title="Potential as a function of x"):

view=[-2..2,-1..1], title="Wave function", xtickmarks=([-a=-'a', a='a']);

 #plot((psi[n]^2),x=-2..2,title="Probability density"):

P2:=plot([[[-a,-1],[-a,1]],[[a,-1],[a,1]]],colour=red):

display(P1,P2);

od;

 

Thanks for the help so far; the walls of the box are now plotted, the line starting with 'view' seems to have no effect at all, and the xtickmarks are not plotted at all, possibly a compatibility problem? i'm using maple 9...any ideas?

When i run this i get 2 sets of a lot of code - looks like the points maple is using to plot the graphs with as it starts with P1 and P2 - maybe this is something to do with the with(plots) thing? i'm not sure what that does. Do you know how i can blank out the plot, or stop it from plotting after the well walls?

restart;

a:=1;

for n from 1 by 2 to 3

do psi[n]:=sqrt(a)*cos((n*Pi*x)/2*a);

with(plots):

P1:=plot(psi[n],x=-2..2,colour=blue, title="Potential as a function of x"):

view=[-2..2,-1..1], title="Wave function", xtickmarks=([-a=-'a', a='a']);

 #plot((psi[n]^2),x=-2..2,title="Probability density"):

P2:=plot([[[-a,-1],[-a,1]],[[a,-1],[a,1]]],colour=red):

display(P1,P2);

od;

 

Thanks for the help so far; the walls of the box are now plotted, the line starting with 'view' seems to have no effect at all, and the xtickmarks are not plotted at all, possibly a compatibility problem? i'm using maple 9...any ideas?

When i run this i get 2 sets of a lot of code - looks like the points maple is using to plot the graphs with as it starts with P1 and P2 - maybe this is something to do with the with(plots) thing? i'm not sure what that does. Do you know how i can blank out the plot, or stop it from plotting after the well walls?

Page 1 of 1