Melvin Brown

89 Reputation

6 Badges

14 years, 84 days

Social Networks and Content at Maplesoft.com

Maple Application Center

MaplePrimes Activity


These are questions asked by Melvin Brown


 

Analysis of the semiclassical (SC) momentum rate equations

Plotting the ICs and BCs and examining sensitivity to the Re and Im forces

MRB: 24/2/2020, 27/2/2020, 2/3/2020.

We examine solution of the SC version of the momentum rate equations, in which O`ℏ`^2 terms for u(x, t) are removed. A high level of sensitivity to ICs and BCs makes solution finding difficult.

restart;

with(PDETools): with(CodeTools):with(plots):

We set up the initial conditions:

ICu := {u(x, 0) = .1*sin(2*Pi*x)}; ICv := {v(x, 0) = .2*sin(Pi*x)};

{u(x, 0) = .1*sin(2*Pi*x)}

 

{v(x, 0) = .2*sin(Pi*x)}

(1)

plot([0.1*sin(2*Pi*x),0.2*sin(Pi*x)],x = 0..2, title="ICs:\n u(x,0) (red), v(x,0) (blue)",color=[red,blue],gridlines=true);  

 

The above initial conditions represent a positive velocity field v(x, 0) (blue) and a colliding momentum field u(x, t)(red).

 

Here are the BCs

BCu := {u(0,t) = 0.5*(1-cos(2*Pi*t))};

{u(0, t) = .5-.5*cos(2*Pi*t)}

(2)

BCv := {v(0,t) = 0.5*sin(2*Pi*t),v(2,t)=-0.5*sin(2*Pi*t)};  

{v(0, t) = .5*sin(2*Pi*t), v(2, t) = -.5*sin(2*Pi*t)}

(3)

plot([0.5*(1-cos(2*Pi*t)),0.5*sin(2*Pi*t),-0.5*sin(2*Pi*t)],t=0..1,color=[red,blue,blue],linestyle=[dash,dash,dot],title="BCs:\n u(0,t) (red-dash),\n v(0,t) (blue-dash), v(1,t) (blue-dot)",gridlines=true);

 

 

We can now set up the PDEs for the semiclassical case.

hBar:= 1:m:= 1:Fu:= 0.2:Fv:= 0.1:#1.0,0.2

pdeu := diff(u(x,t),t)+u(x,t)/m*(diff(u(x,t),x)) = Fu;

diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x)) = .2

(4)

pdev := diff(v(x,t),t)+u(x,t)/m*(diff(v(x,t),x))-hBar*(diff(u(x,t),x$2))/(2*m)+v(x,t)*(diff(u(x,t),x))/m = Fv;  

diff(v(x, t), t)+u(x, t)*(diff(v(x, t), x))-(1/2)*(diff(diff(u(x, t), x), x))+v(x, t)*(diff(u(x, t), x)) = .1

(5)

ICu:={u(x,0) = 0.1*sin(2*Pi*x)};  

{u(x, 0) = .1*sin(2*Pi*x)}

(6)

ICv:={v(x,0) = 0.2*sin(Pi*x/2)};  

{v(x, 0) = .2*sin((1/2)*Pi*x)}

(7)

IC := ICu union ICv;  

{u(x, 0) = .1*sin(2*Pi*x), v(x, 0) = .2*sin((1/2)*Pi*x)}

(8)

BCu := {u(0,t) = 0.5*(1-cos(2*Pi*t)), D[1](u)(2,t) = 0.1*cos(2*Pi*t)};

{u(0, t) = .5-.5*cos(2*Pi*t), (D[1](u))(2, t) = .1*cos(2*Pi*t)}

(9)

BCv := {v(0,t) = 0.2*(1-cos(2*Pi*t))};  

{v(0, t) = .2-.2*cos(2*Pi*t)}

(10)

BC := BCu union BCv;  

{u(0, t) = .5-.5*cos(2*Pi*t), v(0, t) = .2-.2*cos(2*Pi*t), (D[1](u))(2, t) = .1*cos(2*Pi*t)}

(11)

We now set up the PDE solver:

pds := pdsolve({pdeu,pdev},{BC[],IC[]},time = t,range = 0..2,numeric);#'numeric' solution

_m2592591229440

(12)

Cp:=pds:-animate({[u, color = red, linestyle = dash],[v,color = blue,linestyle = dash]},t = 30,frames = 400,numpoints = 400,title="Semiclassical momentum equations solution for Re and Im momenta u(x,t) (red) and v(x,t) (blue) \n under respective constant positive forces [0.2, 0.1] \n with sinusoidal boundary conditions at x = 0, 1 and sinusoidal initial conditions: \n time = %f ", gridlines = true,linestyle=solid):Cp;

Error, (in pdsolve/numeric/animate) unable to compute solution for t>HFloat(0.0):
Newton iteration is not converging

 

Cp

(13)

Observations on the quantum case:

The classical equation for u(x, t) is independent of the equation for v(x, t).  u(x, t) (red) is a solution of the classical Burgers equation subject to a force 0.2, but u(x, t) is NOT influenced by v(x, t).  On the otherhand, v(x, t) (blue) is a solution of the quantum dynamics equation subject to force 0.1 and is influenced by u(x, t).   This one way causality (u " implies v")  is a feature of the semiclassical case, and it emphasises the controlling influence of the classical u(x, t), which modulates the quantum solution for v(x, t).  Causally, we have u" implies v".

 

The initial conditions are of low momentum amplitude:"+/-"0.1 for the classical u(x, 0) (red) field and`&+-`(0).2 for v(x, 0) (blue)  but their influence is soon washed out by the boundary conditions "u(0,t) ~1, v(0,t)~0.5" and "v(1,t)~0.5" that drive the momentum dynamics.

 

The temporal frequency of the boundary condition on the v-field is twice that of the classical u-field. This is evident in the above blue transient plot. Moreover, the">=0" boundary condition on the classical u-momentum (red), drives that field in the positive direction, initially overtaking the quantum v(x, t) field, as consistent with the applied forces [0.2, 0.1]. NULLAlthough initially of greater amplitude than the classical u(x, t)field, the v(x, t) momentum field is asymptotically of the same amplitude as the u(x, t) field, but has greater spatial and temporal frequency, owing to the boundary conditions.

 

Referring to the semiclassical momentum rate equations, we note that the classical field u(x, t) (red) modulates the quantum momentum rate equation for v(x, t).

``

 

 

 


 

Download SC-plots.mw

I am having difficulty getting solutions to a pair of PDEs.  Would anyone like to cast an eye over the attached file, incase I am missing something.

Thanks

Melvin

Can anyone help get solution to a coupled pair of PDEs

Error, (in pdsolve/numeric/plot3d) unable to compute solution for t>HFloat(0.0):
Newton iteration is not converging..

I attach file: SemiclassicalTestfile.mw

Melvin

 

 


 

I am solving coupled PDEs under various BCs and ICs on the (x,t) domain, to obtain momentum p((x(t),t) solution plots of the within a MAPLE worksheet. 

However, I am getting JAVA memory overload (> 2GB), which brings MAPLE to a halt when plots are displayed in the worksheet.  Is there a way of writing the graphical plots directly to a file on my computer, so that the plots can later be view separately on my computer screen, thus avoiding JAVA memory overload within MAPLE.

If this is possible, please could someone send me MAPLE code to create external plots...perhaps using simple examples in MAPLE?

Melvin .

see below.  I am getting IC and BC errors.  The code is below/attached.  Can anyone help?

Melvin

 

This is a corrected version of pdeProb2.mw, in which we examine the 1-D classical burgers equation, and find an asymptotic steady state in the solution fields u, v which is not reached by a solution via numerical simulation.

 

NOTE:  When generating and displaying PLOTS AT HIGH RESOLUTION, do not use p1 := plot(bla, etc);  i.e. do not end with a semicolon.   Instead, end with a colon viz  p1 := plot(bla, etc): which sends the result to p1 instead of  generating an excess memory use message.  Then create the plot by executing p1; i.e. end the assigned p1 with a semicolon to display the graphics result.

restart

We load the MAPLE Physics package from the MapleCloud, in order to support solutions using pdsolve().

PackageTools:-Install*`\`("5137472255164416", version = 329, overwrite):`

PackageTools:-Install*`\`("5137472255164416", version = 329, overwrite):`

(1)

restart; Physics:-Version()

"C:\Users\Melvin Brown\maple\toolbox\2018\Physics Updates\lib\Physics Updates.maple", `2019, October 2, 14:20 hours, version in the MapleCloud: 597, version installed in this computer: 329.`

(2)

Start of definition of problem:

with(PDETools); with(CodeTools); with(plots)

[CanonicalCoordinates, ChangeSymmetry, CharacteristicQ, CharacteristicQInvariants, ConservedCurrentTest, ConservedCurrents, ConsistencyTest, D_Dx, DeterminingPDE, Eta_k, Euler, FromJet, FunctionFieldSolutions, InfinitesimalGenerator, Infinitesimals, IntegratingFactorTest, IntegratingFactors, InvariantEquation, InvariantSolutions, InvariantTransformation, Invariants, Laplace, Library, PDEplot, PolynomialSolutions, ReducedForm, SimilaritySolutions, SimilarityTransformation, Solve, SymmetryCommutator, SymmetryGauge, SymmetrySolutions, SymmetryTest, SymmetryTransformation, TWSolutions, ToJet, ToMissingDependentVariable, build, casesplit, charstrip, dchange, dcoeffs, declare, diff_table, difforder, dpolyform, dsubs, mapde, separability, splitstrip, splitsys, undeclare]

(3)

Start of definition of problem:

with(PDETools); with(CodeTools);with(plots);

[CanonicalCoordinates, ChangeSymmetry, CharacteristicQ, CharacteristicQInvariants, ConservedCurrentTest, ConservedCurrents, ConsistencyTest, D_Dx, DeterminingPDE, Eta_k, Euler, FromJet, FunctionFieldSolutions, InfinitesimalGenerator, Infinitesimals, IntegratingFactorTest, IntegratingFactors, InvariantEquation, InvariantSolutions, InvariantTransformation, Invariants, Laplace, Library, PDEplot, PolynomialSolutions, ReducedForm, SimilaritySolutions, SimilarityTransformation, Solve, SymmetryCommutator, SymmetryGauge, SymmetrySolutions, SymmetryTest, SymmetryTransformation, TWSolutions, ToJet, ToMissingDependentVariable, build, casesplit, charstrip, dchange, dcoeffs, declare, diff_table, difforder, dpolyform, dsubs, mapde, separability, splitstrip, splitsys, undeclare]

 

[CPUTime, DecodeName, EncodeName, GCTime, Profiling, ProgramAnalysis, RealTime, Test, ThreadSafetyCheck, Usage]

 

[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]

(4)

``

Two 1-D coupled Burgers equations - semiclassical case O(1), O( `ℏ`) : retain O(1) only for u(x,t) and O(1), O( `ℏ`) for v(x,t):

In the quantum case, there are two coupled quantum Burgers equations, which each include the quantum potential terms.  As in the classical case above, we apply constant external forces Fuand Fv.  Our aim is to display the profiles of u(x, t) and v(x, t) as strings on x, t space.

#hBar := 'hBar': m := 'm':Fu := 'Fu': Fv := 'Fv': # define constants

hBar:= 1:m:= 1:Fu:= 0.2:Fv:= 0.1: # set constant values - same as above ...consider reducing

Notice that we set `ℏ` = 1

At O( `ℏ`^2) the real quantum potential term is zero, leaving the classical expression:

pdeu := diff(u(x,t),t)+u(x,t)/m*(diff(u(x,t),x)) = Fu;

diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x)) = .2

(5)

As in the classical case above, the temporal and spatial derivative are each of order 1; so only one initial condition and one boundary condition are required for this part of the semiclassical equations.

On the otherhand, the imaginary quantum potential equation for v(x,t) has only O( `ℏ`)  terms so together the pair of equations for u, v are semiclassical:

pdev := diff(v(x,t),t)+u(x,t)/m*(diff(v(x,t),x))-hBar*(diff(u(x,t),x$2))/(2*m)+v(x,t)*(diff(u(x,t),x))/m = Fv;

diff(v(x, t), t)+u(x, t)*(diff(v(x, t), x))-(1/2)*(diff(diff(u(x, t), x), x))+v(x, t)*(diff(u(x, t), x)) = .1

(6)

By inspection of the derivatives in above two equations we now set up the ICs and BCs for u(x, t) and "v(x,t). "Note that the above second order spatial derivative requires a 1st order derivative boundary condition as defined below.

The quantum initial and boundary conditions are similar to the classical case, but also comprise additional boundary condition terms for v and for u, notably a 1st derivative reflective BC term for u.

ICu:={u(x,0) = 0.1*sin(2*Pi*x)};# initial conditions for PDE pdeu

{u(x, 0) = .1*sin(2*Pi*x)}

(7)

ICv:={v(x,0) = 0.2*sin(Pi*x)};# initial conditions for PDE pdev

{v(x, 0) = .2*sin(Pi*x)}

(8)

IC := ICu union ICv;

{u(x, 0) = .1*sin(2*Pi*x), v(x, 0) = .2*sin(Pi*x)}

(9)

BCu := {u(0,t) = 0.5*(1-cos(2*Pi*t)),D[1](u)(1,t) = 0}; # boundary conditions for PDE pdeu: note the reflective derivative term D[1](u)

{u(0, t) = .5-.5*cos(2*Pi*t), (D[1](u))(1, t) = 0}

(10)

BCv := {v(0,t) = 0.5*sin(2*Pi*t), v(1,t)=-0.5*sin(2*Pi*t)}; # boundary conditions for PDE pdev

{v(0, t) = .5*sin(2*Pi*t), v(1, t) = -.5*sin(2*Pi*t)}

(11)

BC := BCu union BCv;

{u(0, t) = .5-.5*cos(2*Pi*t), v(0, t) = .5*sin(2*Pi*t), v(1, t) = -.5*sin(2*Pi*t), (D[1](u))(1, t) = 0}

(12)

This set of equations and conditions can now be solved numerically.

The above IC and BC are both 0 at 0, 0 and thus consistent.

pdu := pdsolve({pdeu,pdev},{IC,BC},numeric, time = t,range = 0..1,spacestep = 1/66,timestep = .1);

Error, (in pdsolve/numeric/process_IBCs) invalid initial/boundary condition: {u(x, 0) = .1*sin(2*Pi*x), v(x, 0) = .2*sin(Pi*x)}

 

Here is the 3D plot of u(x,t):

T := 3; p1 := pdu:-plot3d(u,t=0..T,numpoints = 2000,x=0.0..2, shading = zhue,orientation=[-146,54,0],scaling = constrained, title = print("Figure 1",u(x, t), numeric));

3

 

Error, `pdu` does not evaluate to a module

 

``


 

Download Semiclassical_Burgers_Eqns_-_MRB.mw

 

 

I  can't seem to get a solution to the following problem.  Can anyone see where I am going wrong I thought I had correct IBC s but they may be wrong/ill-posed

Melvin
 

Two 1-D coupled Burgers equations - semiclassical case: remove O( `ℏ`^2) terms for u(x,t) but retain O( `ℏ`) terms for v(x,t):

In the quantum case, there are two coupled quantum Burgers equations, which each include the quantum potential terms.  As in the classical case above, we apply constant external forces Fuand Fv.  Our aim is to display the profiles of u(x, t) and v(x, t) as strings on x, t space.

#hBar := 'hBar': m := 'm':Fu := 'Fu': Fv := 'Fv': # define constants

hBar := 1:m := 1:Fu := 0.2:Fv := 0.1: # set constant values - same as above ...consider reducing

At O( `ℏ`^2) the real quantum potential term is zero, leaving the classical expression:

pdeu := diff(u(x,t),t)+u(x,t)/m*(diff(u(x,t),x)) = Fu;

diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x)) = .2

(1)

On the otherhand, the imaginary quantum potential equation for v(x,t) has only O( `ℏ`) terms and so is retained as semiclassical

pdev := diff(v(x,t),t)+u(x,t)/m*(diff(v(x,t),x))-hBar*(diff(u(x,t),x$2))/(2*m)+v(x,t)*(diff(u(x,t),x))/m = Fv;

diff(v(x, t), t)+u(x, t)*(diff(v(x, t), x))-(1/2)*(diff(diff(u(x, t), x), x))+v(x, t)*(diff(u(x, t), x)) = .1

(2)

By inspection of the derivatives in above equations we now set up the ICs and BCs for u(x, t) and "v(x,t)."

The quantum initial and boundary conditions are similar to the classical case, but also comprise additional boundary condition terms for v and for u, notably a 1st derivative BC term for u.

IBCu := {u(x,0) = 0.1*sin(2*Pi*x),u(0,t) = 0.5-0.5*cos(2*Pi*t),D[1](u)(0,t) = 2*Pi*0.1*cos(2*Pi*t)};# IBC for u

{u(0, t) = .5-.5*cos(2*Pi*t), u(x, 0) = .1*sin(2*Pi*x), (D[1](u))(0, t) = .6283185308*cos(2*Pi*t)}

(3)

IBCv := {v(x,0) = 0.2*sin((1/2)*Pi*x),v(0,t)=0.2-0.2*cos(2*Pi*t)};# IBC for v

{v(0, t) = .2-.2*cos(2*Pi*t), v(x, 0) = .2*sin((1/2)*Pi*x)}

(4)

IBC := IBCu union IBCv;

{u(0, t) = .5-.5*cos(2*Pi*t), u(x, 0) = .1*sin(2*Pi*x), v(0, t) = .2-.2*cos(2*Pi*t), v(x, 0) = .2*sin((1/2)*Pi*x), (D[1](u))(0, t) = .6283185308*cos(2*Pi*t)}

(5)

pds:=pdsolve({pdeu,pdev},IBC, time = t, range = 0..0.2,numeric);# 'numeric' solution

_m2606922675232

(6)

The following quantum animation is in contrast with the classical case, and illustrates the delocalisation of the wave form caused by the quantum diffusion and advection terms:

T:=2; p1:=pds:-animate({[u, color = green, linestyle = dash], [v, color = red, linestyle = dash]},t = 0..T, gridlines = true, numpoints = 2000,x = 0..0.2):p1;

2

 

Error, (in pdsolve/numeric/animate) unable to compute solution for t>HFloat(0.0):
matrix is singular

 

p1

(7)

Note that this plot also shows that there are regions in which pIm < 0,  pRe > 0.  Below, the 3D plot of u(x,t),v(x,t) also illustrates the quantum delocalisation of features:

T := 3; p1 := pds:-plot3d({[u, shading = zhue], [v, color = red]}, t = 0 .. T, x = -0.1e-2 .. 2,transparency = 0.0, orientation = [-146, 54, 0], title = print("Coupled quantum solution \n u(x, t) zhue, v(x,t) red", numeric),scaling=unconstrained):p1;

3

 

"Coupled quantum solution 
 u(x, t) zhue, v(x,t) red", numeric

 

Error, (in pdsolve/numeric/plot3d) unable to compute solution for t>HFloat(0.0):
matrix is singular

 

``


 

Download BurgersEqns.mw

Here it is:

#hBar := 'hBar': m := 'm':Fu := 'Fu': Fv := 'Fv': # define constants
hBar := 1:m := 1:Fu := 0.2:Fv := 0.1: # set constant values - same as above ...consider reducing
At O( 
`&hbar;`^2;
) the real quantum potential term is zero, leaving the classical expression:
pdeu := diff(u(x,t),t)+u(x,t)/m*(diff(u(x,t),x)) = Fu;
              / d         \           / d         \      
      pdeu := |--- u(x, t)| + u(x, t) |--- u(x, t)| = 0.2
              \ dt        /           \ dx        /      
On the otherhand, the imaginary quantum potential equation for v(x,t) has only O( 
`&hbar;`;
) terms and so is retained as semiclassical
pdev := diff(v(x,t),t)+u(x,t)/m*(diff(v(x,t),x))-hBar*(diff(u(x,t),x$2))/(2*m)+v(x,t)*(diff(u(x,t),x))/m = Fv;
                                                     2         
         / d         \           / d         \   1  d          
 pdev := |--- v(x, t)| + u(x, t) |--- v(x, t)| - - ---- u(x, t)
         \ dt        /           \ dx        /   2    2        
                                                    dx         

              / d         \      
    + v(x, t) |--- u(x, t)| = 0.1
              \ dx        /      
By inspection of the derivatives in above equations we now set up the ICs and BCs for 
u(x, t);
 and 
v(x,t).;
The quantum initial and boundary conditions are similar to the classical case, but also comprise additional boundary condition terms for 
v;
 and for 
u;
, notably a 1st derivative BC term for 
u;
.
IBCu := {u(x,0) = 0.1*sin(2*Pi*x),u(0,t) = 0.5-0.5*cos(2*Pi*t),D[1](u)(0,t) = 2*Pi*0.1*cos(2*Pi*t)};# IBC for u
          IBCu := {u(0, t) = 0.5 - 0.5 cos(2 Pi t), 

            u(x, 0) = 0.1 sin(2 Pi x), 

            D[1](u)(0, t) = 0.6283185308 cos(2 Pi t)}
IBCv := {v(x,0) = 0.2*sin((1/2)*Pi*x),v(0,t)=0.2-0.2*cos(2*Pi*t)};# IBC for v
                   /                                 
          IBCv := { v(0, t) = 0.2 - 0.2 cos(2 Pi t), 
                   \                                 

                             /1     \\ 
            v(x, 0) = 0.2 sin|- Pi x| }
                             \2     // 
IBC := IBCu union IBCv;
         /                                 
 IBC := { u(0, t) = 0.5 - 0.5 cos(2 Pi t), 
         \                                 

   u(x, 0) = 0.1 sin(2 Pi x), v(0, t) = 0.2 - 0.2 cos(2 Pi t), 

                    /1     \  
   v(x, 0) = 0.2 sin|- Pi x|, 
                    \2     /  

                                           \ 
   D[1](u)(0, t) = 0.6283185308 cos(2 Pi t) }
                                           / 
pds:=pdsolve({pdeu,pdev},IBC, time = t, range = 0..0.2,numeric);# 'numeric' solution
                     pds := _m2606922675232
The following quantum animation is in contrast with the classical case, and illustrates the delocalisation of the wave form caused by the quantum diffusion and advection terms:
T:=2; p1:=pds:-animate({[u, color = green, linestyle = dash], [v, color = red, linestyle = dash]},t = 0..T, gridlines = true, numpoints = 2000,x = 0..0.2):p1;
                             T := 2
Error, (in pdsolve/numeric/animate) unable to compute solution for t>HFloat(0.0):
matrix is singular
                               p1
 

1 2 3 4 5 6 7 Page 1 of 8