I am trying to plot a wavefunction for a 1D Particle in a box. I attached my code below, when I run it, it shows a plot with no lines on it. I am new to mathematica, so I am not sure what I am doing wrong.
a = 30
f[x_] := Sqrt[2/a]*((3/5)*sin ((2*\[Pi]*x)/a) + (4/5)*(sin ((9*\[Pi]*x)/a)))
Plot[f[x], {x, 0, a},AxesLabel->{"x","f(x"},PlotStyle->{Black,Dashed}]
sin
should beSin
. Arguments are enclosed in[ ]
not( )
.Sin[...]
. $\endgroup$*
signs for multiplication:2 π x
is enough (while a space is needed betweenπ
andx
, you do not need to insert a space between2
andπ
; (2) remove superfluous parentheses, e.g., around the secondSin
expression; and (3) put a semicolon aftera= 30
unless you have some special reason to create a separate outpu cell with30
in it. $\endgroup$