## 60 Reputation

4 years, 108 days

## Plot of the difference between solutions...

I have the following code:

restart;
PDE := diff(u(x, t), t) = diff(u(x, t), x, x)-sin(x+t)+cos(x+t);
IBC:= D[1](u)(0,t)=-sin(t),
D[1](u)(1,t)=-(u(1, t))^4+(cos(1+t))^4-sin(1+t),
u(x,0)=cos(x);

pds := pdsolve( PDE, [IBC], numeric, time = t, range = 0 .. 1,

spacestep = 0.1e-1, timestep = 0.1e-1,
errorest=true
)

And I want to plot the difference |pds(t,x) - cos(x+t)| in maple for x=1 and t=0..5

I thought to use the following piece of commands but I get an error:

P:=unapply(pds, t,x);
Q:=abs(P(t,x)-cos(x+t));
Q:-plot(x=1, t=0..1);

I get an error that Q isn't a module.

I thought that unapply is used for this case, can you help me with this simple task?

## Searching for a procedure in PDE...

Maple 2015

I have the following two PDEs:

PDE := diff(u(x, t), t) = diff(u(x, t), x, x)+sin(x+t)-cos(x+t);

IBC:= D[1](u)(0,t)=-sin(t),
D[1](u)(1,t)=-sin(1+t),
u(x,0)=cos(x);

pds := pdsolve( PDE, [IBC], numeric, time = t, range = 0 .. 1,
spacestep = 1/32, timestep = 1/32,
errorest=true
)

PDE2 := diff(v(x, t), t) = diff(v(x, t), x, x);
IBC2:= D[1](v)(0,t)=0,
D[1](v)(1,t)=-0.000065*v(1, t)^4,
v(x,0)=1;

pds1 := pdsolve( PDE2, [IBC2], numeric, time = t, range = 0 .. 1,
spacestep = 1/32, timestep = 1/32,
errorest=true
);

Now, what I want to do with these two PDEs is the following:

For each h=timestep=spacestep  = 1/16 , 1/32 , 1/64 , 1/128 , 1/256

Calculate the error norm ||E||_h = sqrt(sum_{j=0}^{1/h} h* |u(j*h,tval)-v(j*h,tval)|^2)

where tval is some chosen point between 0 and 1 (this value is fixed for each spacestep chosen).

And then plot the graph of log ||E||_h vs. log h above.

What I don't know is how to extract each time the spacestep and its PDE's two solutions, does someone have a suggested script to use here?

## Constructing a sequence ...

Maple 2015

How do I construct the seuqence 1/16 , 1/32 , 1/64 , 1/128 , 1/256 in maple?

What's the syntax?

I looked at the examples in here:

http://www.maplesoft.com/support/help/maple/view.aspx?path=seq

But didn't find something similar.

## Finding an approximate function for a PD...

Maple 2015

Are there any commands in maple that will help me find a suitable function that approximates the numerical solution of:

 > restart;   PDE := diff(v(x, t), t) = diff(v(x, t), x, x);   JACOBIINTEGRAL := int(JacobiTheta3(0, exp(-Pi^2*s))*v(1, t-s)^4, s = 0 .. t);   IBC:= D[1](v)(0,t)=0,         D[1](v)(1,t)=-0.000065*v(1, t)^4,         v(x,0)=1; # # For x=0..1, t=0..1, the solution varies only very slowly # so I have increased the timestep/spacestep, just to speed # up results generation for diagnostic purposes #   pds := pdsolve( PDE, [IBC], numeric, time = t, range = 0 .. 1,                   spacestep = 0.1e-1, timestep = 0.1e-1,                   errorest=true                 )
 (1)
 > # # Plot the solution over the ranges x=0..1, # time=0..1. Not a lot happens! #   pds:-plot(x=1, t=0..1);
 > # # Plot the estimated error over the ranges x=0..1, # time=0..1 #   pds:-plot( err(v(x,t)), x=1,t=0..1);
 > # # Get some numerical solution values #   pVal:=pds:-value(v(x,t), output=procedurelist):   for k from 0 by 0.1 to 1 do       pVal(1, k)[2], pVal(1, k)[3];   od;
 >
 (2)
 >
 >

I am refering to the first graph, is there a way in maple to find an explicit suitable approximating function?

I.e, I want the function to have the same first graph obviously, it seems like addition of exponent and a line function, I tried plotting exp(-t)-0.3*t, it doesn't look like it approximates it very well. Any suggestion on how to implement this task in maple?

Thanks.

## Problem in plotting ...

Maple

I have the solution to a heat PDE, v and the error esitmate u + cos(x+t) = v

I want to plot log v(1,t) as function of log u(1,t) in maple, but I seem to get an error:

Error, (in plot) unexpected option: ln(u(1, t))

I am attaching my code below.

How to fix this problem?