student_1

305 Reputation

6 Badges

8 years, 249 days

MaplePrimes Activity


These are questions asked by student_1

I wrote a code.mw for a numerical method for a PDE. (You can find the numerical method, exact solution and error between them in the code.)

The method depends on parameters k, M, which are any positive integers, and also depends on teta, beta>-1 which are real numbers.

According to the used method,

when k and M increase, we expect that the error (exact-numeric) generally decreases. 

In the code, I selected k=2, M=2, teta=1 and beta=1. And so k=2, M=2, CPU time is low. Error is not bad.

But for k=4, M=3 and also for bigger values of them, CPU time is high. I can' t get the solution.

Question 1: 

I don't know, but it may be possible to simplify the code in order to calculate for k=4, M=4?

Question 2:

I want to find optimal values of teta and beta for minimizing the error between numerical and exact solution, when k=2, M=2, or k=3, M=1 etc.

How can we write a Maple code for finding optimal values of teta and beta?

You can download the code.mw

 

 

 
 
 
 
 
restart:
N:=3:
for i from 1 to N do
x[i]:=evalf((2*i-1)/(N)) :
end do:
for i from 1 to N do
t[i]:=evalf((2*i-1)/(N)) :
end do:
f:=unapply(x*t,x,t);
g:=unapply(x^2*t,x,t);

Question 1: We have two functions f and g as above. How can we create a table which contains merged cells as follows by Maple? 

Question 2:  How to convert or export the table to LATEX?

I wrote a code for the following sequence. But I have a problem. What are the good methods for defining recursive sequence?

THE CODE

restart;
#FIRST STEP: Lets find the recursive formula for 
d:=proc(m)
option remember;
d(1):=1;
if m>1 then return -sum(xi(i)*d(i-k+1),i=2..m) else 1 fi;
end proc:
#lets check
for i from 1 to 4 do
d(i);
end do; 

 

 

Secondly, I want to create a matrix as follows. I wrote the code. I think it is right.

restart:
m:=4:
DD:=Matrix(m,m):
#SECOND STEP: Lets find the matrix 
for i from 1 to m do 
p:=0:
for j from 1 to m do 
 
if i<=j then p:=p+1:
DD[i,j]:=d(p);
 fi: 
end do;
p:=1: 
end do:
DD;

 

 

 

 

We can see the context of  Matlab code in the Windows preview pane as follows, but we can' t see the context of Maple codes.

I wonder whether it is possible for Maple, too or not. Is there any method to achieve this? Because it really offers a great advantage for the fast browsing context of code in a folder that includes a lot of maple files.

 

(I use Maple 2019 and Windows 10)

 

 
 
 
 
 

 

I try to write a Maple Code. But I can' t finish it. 

This is very important for me. Could you help me? download_Maple Code.mw

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