wingho

15 Reputation

2 Badges

0 years, 26 days

MaplePrimes Activity


These are questions asked by wingho

I am not sure whether this should be in "create a post" or "ask a question." Let me know if this is more appropriate in "ask a question"

The standing wave equation is given by:

PDE:=diff(u(x,t),t,t)=c^2*diff(u(x,t),x,x)

IBC := {u(x, 0) = A0*cos(Pi*x/L), D[1](u)(0, t) = 0, D[1](u)(L, t) = 0, D[2](u)(x, 0) = 0}

pdsolve(PDE,IBC,numeric)

In my problem, the material is a magneto-elastic material where c, the speed of the acoustic wave, is a function of a magnetic field H.  The material is nonlinear and saturable.  I define it by a 3 segment piecewise nonlinear function of H.  The material response is a result of a sinusoidal H field.  I am interested in solving u(x,t).  

With that, c in the PDE has to be rewritten as c(H(t)), pdsolve gives an error as PDE has to be expressed as a function of u,t, or x.  So I redefine c(H(t)) as c(t).  I ran into another error in pdsolve as the piecewise has to be based on t or x and not H.  

The problem is that depending on H I can go through all 3 segments and back in one cycle and I have to find the corresponding t's for the piecewise.  Now I am driving the material with 100 cycles, I have to find and list all those piecewise transition points which is hardly practical.

Is there any other ways to approach and solve this problem?

These are the original set up to solve for second order partial differetial equations:

E := 1.456*10^11;
rho := 7900;
a := sqrt(E/rho);
L := 0.03639;

f0 := 1/(2*L)*a;
f := f0 - 50;
A0 := 11.75*L/2*10^(-6);

d := 0.8*1000;
T0 := 5/f;
NULL;
PDE := diff(u(x, t), t, t) = a^2*diff(u(x, t), x, x) - d*diff(u(x, t), t);
IBC := {u(x, 0) = A0*cos(Pi*x/L), D[1](u)(0, t) = 0, D[1](u)(L, t) = 0, D[2](u)(x, 0) = 0};
pds := pdsolve(PDE, IBC, numeric, timestep = 2*10^(-7));

 I know it solves properly because I can plot it using pds:-plot without problem.  The question is how to extract the value at specific x and t.  I started to try some of the more intuitive way such as u(0,0) without getting an answer.  I tried a number of eval expression such as eval(pds,[x=0,t=0]), eval(u(x,t),[x=0,t=0]) and so on without success.  

Then I tried using :-value as mentioned in an example from the internet, also resulting in an error.

val:=pds:-value(x=0,t=0)

It seems to be simple.  I guess I am too new with maple so be gentle.  Thank you.

Goal: to make a 3D parametric plot of a complex function u(x,t) obtained by pdsolve.  I tried to follow one example of a plot of a complex expression/function.  I was unable to get any plot.  I got some warning and error.  Please let me know what have I done wrong.

I follow this example so that I can get a 3D parametric plot of a complex function u(x,t) for a fix x:

with(plots);

complexplot(exp(t*I), t = 0 .. 2*Pi, scaling = constrained);

plot([cos(t), sin(t), t = 0 .. 2*Pi], scaling = constrained);

z := t -> exp(t*I);

spacecurve([Re(z(t)), Im(z(t)), t], t = 0 .. 4*Pi, axes = normal, labels = ["Re", "Im", "t"]);

It was successful.  With the following pde, I obtain an analytical solution using pdsolve.

a := 3;
L := 2*Pi;
d := 0.5;
T0 := 2*Pi;
PDE := diff(u(x, t), t, t) = a^2*diff(u(x, t), x, x) - d*diff(u(x, t), t);
IBC := u(x, 0) = cos(Pi*x/L), D[2](u)(x, 0) = 0, D[1](u)(0, t) = 0, D[1](u)(L, t) = 0;
pds := pdsolve({IBC, PDE}, u(x, t));

It fail 2D plotting using the following:

with(plots);
complexplot(u(0, t), t = 0 .. 6);

So I break down the pds with the following:

RP := Re(pds);
IP := Im(pds);
RP0 := eval(RP, x = 0);
RP0t := unapply(RP0, t);
IP0 := eval(IP, x = 0);
IP0t := unapply(IP0, t);

And I was hopeful as the following give me real numbers when I approximate them:

RP0t(1);
                             "(->)"


                     Re(u(0, 1)) = 0.20248

RP0t(2);
                             "(->)"


                     Re(u(0, 2)) = -0.57765

But it fails in both 2D and 3D plot:

plot([RP0t(t), t = 0 .. 6])

spacecurve([RP0t(t), IP0t(t), t], t = 0 .. 6, axes = normal)

Page 1 of 1