student_md

180 Reputation

6 Badges

2 years, 267 days

MaplePrimes Activity


These are questions asked by student_md

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.

 

How to write a code to get following Matrix D?

MY TRY: (But it' s not completely what I seek)

restart:

k:=1:
M:=2:
N:=2^k*(M+1):

U:=Matrix(M+1,M+1):
for r from 2 to M+1 do
for s from 1 to r-1 do
if type(r+s,odd) then
U(r,s):=2^(k+1)*sqrt((2*r-1)*(2*s-1)):
 else 0 end if:
end do:
end do:

#Let's find Matrix D, In here it' s shown matrix DD 
DD:=Matrix(N,N,shape=diagonal,fill=U);

Dear there, 

Is there a possibility for tracking changes like Microsoft Office in the saved a Maple worksheet after some editings?


I think that we all encounter the same case. I mean we don't remember generally all changes after editing our codes. 

If there is no possibility for tracking changes,  what are your solutions or suggestions in order to prevent to forget? 

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