[Date Index]
[Thread Index]
[Author Index]
Re: Problems with functions of a Complex Variable
*To*: mathgroup at smc.vnet.net
*Subject*: [mg102820] Re: Problems with functions of a Complex Variable
*From*: pfalloon <pfalloon at gmail.com>
*Date*: Fri, 28 Aug 2009 00:45:43 -0400 (EDT)
*References*: <h75nn9$pgc$1@smc.vnet.net>
On Aug 27, 8:38 pm, Sergio Miguel Terrazas Porras <sterr... at uacj.mx>
wrote:
> Dear Group:
>
> I am trying to illustrate with Mathematica 7.0.1 some of the concepts of Quantum Mechanics.
>
> In particular, for the particle in an Infinite Square Well, I define the time dependent Wave Function (Sum of Sines times Complex Exponentials ) Ok.
>
> Using only the first 3 terms of the series, I run into the following:
>
> If I use ComplexExpand[ ] I get things of the form a + I b, which, I would assume means to Mathematica that a and b are Real.
>
> I then ask for the Conjugate of the preceding expresi=F3n, and I get things like Conjugate[a] - I*Conjugate[b]. (??)
>
> If I plot the Probability Density Function, things are Ok. (Its Real)
>
> If I try to calculate the (time dependent) expected value of x, Assuming[Element[{x,t},Reals],Integrate[x*psi*Congugate[psi],{x,0,a}]
>
> Matem=E1tica hangs forever even though its only nine integrals.
>
> Any help will be very much appreciated.
>
> Sergio Terrazas
Hi there,
When you use ComplexExpand, Mathematica does indeed expand the
expression assuming that all variables (in this case a and b) are
real. However, this assumption only applies within that function call,
so in the subsequent call to Conjugate a and b are once again assumed
to be completely arbitrary complex quantities.
There are a few ways to do the conjugation in the way you are looking
for. One which I have occasionally found useful is to change the sign
of explicit complex numbers using something like
expr /. Complex[x_,y_] :> Complex[x,y]
Alternatively, using Simplify with appropriate Assumptions will also
work:
Conjugate[a+I*b] // Simplify[#, Element[{a,b}, Reals]]&
It can be something of a minefield trying to evaluate integrals etc
with symbolic quantities that are possibly complex. It's generally
simplest if you can express things in terms of real-valued symbols,
apply Simplify etc to get the integrand in explicit form (i.e. free of
Conjugate), and then carry out integrals.
Here is a simple example related to your case (i've suppressed
output):
ClearAll["Global`"]
(* basis function *)
psi[n_,x_,t_] = Sqrt[2]*Exp[-I*n^2*t]*Sin[n*Pi*x];
(* some linear combination which will have non-trivial time-dependence
*)
f[x_,t_] = psi[1,x,t] + I*psi[2,x,t];
(* visualize the functions over the box 0<x<1 *)
Plot[Evaluate[Table[psi[n,x,0],{n,3}]],{x,0,1}]
(* carry out integrals of individual basis functions to show
orthonormality *)
Table[Integrate[psi[m,x,0]*Conjugate@psi[n,x,0], {x,0,1}], {m,3}, {n,
3}] // MatrixForm
(* some linear combination which will have non-trivial time-
dependence, with REAL coefficients a[n] *)
f[x_,t_] = Sum[a[n]*psi[n,x,t], {n,3}]
(* get the probability density using Conjugate and ComplexExpand
(assumes a[n], x, t are all real) *)
absSq[x_,t_] = f[x,t]*Conjugate@f[x,t] // ComplexExpand
(* now do the integral *)
Integrate[absSq[x,t], {x,0,1}]
Hope this helps and good luck!
Cheers,
Peter.
Prev by Date:
**Re: Viewing packages in mathematica**
Next by Date:
**Re: ColorFunction on a linux system (xorg) loses graphics**
Previous by thread:
**Re: Problems with functions of a Complex Variable**
Next by thread:
**interpolating function as initial condition**
| |