student_md

190 Reputation

6 Badges

2 years, 328 days

MaplePrimes Activity


These are questions asked by student_md

restart:
k:=1:
M:=3:
U:=Matrix( (2^(k))*M,(2^(k))*M,symbol=u);

I defined a matrix U.

How to define all elements of the Matrix U is greater than 1? ( U consists of symbolic elements like u[1,1],u[1,2], etc. and all of them is greater than 1 )

restart:
with(PDEtools);
PDE :=  diff(y(x,t), t)-diff(y(x,t), x,x,t)-diff(y(x,t), x$2)+ diff(y(x,t), x)+y(x,t)*diff(y(x,t),x)=exp(-t)*(cos(x)-sin(x)+1/2*exp(-t)*sin(2*x));

# Initial/boundary conditions 
  BCs:=y(0,t) = 0, y(Pi,t)=0;
  ICs:=y(x,0) =sin(x) ;

pdsolve(PDE, {BCs,ICs});
exact_solution:=exp(-t)*sin(x);
Test1:=pdetest(exact_solution,[PDE, BCs,ICs]); 

The solution of the PDE is exp(-t)*sin(x).

I want to check whether it is right or not by Maple. 

I wrote the code. You can download the code.mw  

But, the code doesn' t work. What is the problem?

Thanks.

 

What is the problem in the following code to solve given PDE?

pde_question.mw

Thanks.

 

I have the following PDE

                         ...(1)

 

My Question: I have done manually following calculations. I want to verify the following operations are right, or not by MAPLE. Could you help me, please?

 

The METHOD:

Suppose that

                         ...(2)

In here,  is an Nx1 matrix, P, C are NxN matrices. (N is an integer and superscript T   denotes the transpose of the matrix.)  and P are given matrices. But the matrix C is ungiven I will find it in the final step. But my question doesn' t include all steps. I just wonder how to calculate the first two steps by Maple.

 

( If Maple doesn' t do matrix algebra, we can treat them as if , P, C were not matrix. I think the result won' t be changed. We will get again equation 9 by Maple.)

First Step

We will find the followings 

 

 in terms of the matrices  ,  P and C.

So, if we integrate Equation (2) with respect to x (from 0 to x), and  by using the following two assumptions

 

we have 

   ...(3)
 

substituting x=1  in Equation (3)

 ...(4)

if rewrite Eqn. (4), we have

...(5)

substituting Eqn. (5) to Eqn. (3), we have 

...(6)

integrating Equation (3) with respect to t,

we have 

...(7)

If we integrate Equation (2) from 0 to x with respect to t, we have

...(8)

Second Step We will substitute the terms to the pde ( Equation 1)

Substituting Eqn. (6), (7), (8) to Eqn. (1), we have finally

...(9)

I want to do the above calculations by Maple.  

Because I have more complex questions than above, I want to write a Maple code in order to avoid calculation errors.  

Final Step for curious: it's hard to explain the whole method here. Briefly, we will discretize equation 9 for some collocation points t and x. And after doing it, we will have a system of an algebraic equation. (N equation and N unknown ( C is Nx1 unknown vector to be find) )

And then we will substitute vector C to Eqn. 7

Code for Matrices , P^1, P^2,etc.

code.mw 

Best Regards...

I want to write a code for 3D animation of solutions of PDEs.  Specially, I wonder 3D animation of wave equations etc.

Example: I can write a code for 2d animation but not write 3d animation.

a:=-2:
b:=2:
alpha:=0.1:
beta:=1:
pde:=diff(uu(x,t),t)=alpha*diff(uu(x,t),x,x)+beta*uu(x,t)*(1-uu(x,t));
IC:=uu(x,0)=(sech(10*x))^2;
BC:=uu(a,t)=0,uu(b,t)=0;  

s:=pdsolve(pde,{IC,BC},numeric ,timestep=1/100, spacestep=1/100);
s :- animate( uu(x,t) ,t=0..tbas, frames=40, labels=["x", "u(x,t)"], labelfont=[TIMES,ROMAN,14]); 
g3:=s :- plot3d(uu(x,t), x=-xbas..xbas,t=0..tbas, shading=zhue, axes=boxed, labels=["x","t","u(x,t)"], labelfont=[TIMES,ROMAN,16]);

 But how to write a code for 3d animation?

Thanks.

 

1 2 3 4 5 6 7 Last Page 1 of 12