sarra

270 Reputation

6 Badges

11 years, 129 days

MaplePrimes Activity


These are replies submitted by sarra

@mehdi jafari 

Hi Mehdi,

Thank you for your remark.

If we forget the procedure and we work only without procedure, it's better, and we can find the code errors.

After writting in details all the condition of my problem, I get four system of equation. and my unknow w is defined.

Now My global system is sys:=[sys1,sys2,sys3,sys4], and I think "w" is well written.

Then we can use LinearSolve(GenerateMatrix(sys,w)); to find the unknow u[i,j].

If it is possible, I need a help how can I write my system : sys contains all the linear equation obtained from sys1, sys2, sys3, sys4.

Here, the code without procedure it's better. I think if the sys is well written, the problem will be solved(I hope).

Question8modif.mw

Many thanks.

 

@mehdi jafari 

Thanks for your remark.

I want of the LinearSolve(GenerateMatrix(sys,w));

Solve the linear system with unknown w ( the value of the function u in interior nodes).

I try to check my code lines by lines, maybe I can improve it.

many thinks.

 

@Carl Love 

Hi Cart Love,

I wait for the other erros. I must finish this worksheet until this night. I need your help.

Many thinks.

 

@Carl Love 

Hi Carl Love.
Thank you for your remarks. Sentiel is defined just before the procedure. It's corrected.  It's a mistake.  But let me say that generalstenciel is used to approximate derivative with taylor series;

I wait for your remarks.

Question8X.mw

Really, I need you to solve many problem in my sheetwork. I wait for your answer, and maybe other remarks

Many thanks

 

@mehdi jafari 

Your idea is goog, but we want the solution without inverse matrix.

@mehdi jafari 

 

Hi Mehdi, Thank you very much for your help. You remarks are very nice.

@Carl Love 

 

Thank you for your help.

I tried to add a steptime and a stepspace but, always the same problem,

restart:
pde:=diff(u(t,x),t$2)=diff(u(t,x),x$2)-sin(u(t,x)):
f:=unapply(x,x):
IBC := {u(0,x)=f(x),u(t,-50)=0,D[2](u)(t, 50)=0,D[1](u)(0, x)=-diff(f(x),x)}:

pds := pdsolve(pde, IBC,time=t,range=0..1, numeric,timestep=0.01, spacestep= 1);

Error, (in pdsolve/numeric/par_hyp) values in range argument must match input boundary conditions
p1 := pds:-plot(t = -10);
plots[display]({p1}, title = `Sine Gordaon at `);
Error, `pds` does not evaluate to a module
Error, (in plots:-display) expecting plot structures but received: {p1}

@mehdi jafari 

 

Thank you for your help.

I tried to add a steptime and a stepspace but, always the same problem,

restart:
pde:=diff(u(t,x),t$2)=diff(u(t,x),x$2)-sin(u(t,x)):
f:=unapply(x,x):
IBC := {u(0,x)=f(x),u(t,-50)=0,D[2](u)(t, 50)=0,D[1](u)(0, x)=-diff(f(x),x)}:

pds := pdsolve(pde, IBC,time=t,range=0..1, numeric,timestep=0.01, spacestep= 1);

Error, (in pdsolve/numeric/par_hyp) values in range argument must match input boundary conditions
p1 := pds:-plot(t = -10);
plots[display]({p1}, title = `Sine Gordaon at `);
Error, `pds` does not evaluate to a module
Error, (in plots:-display) expecting plot structures but received: {p1}

@mehdi jafari 

Thank you for your answer. 

Hi.

I have this idea to solve the problem, but it's need small modification,  your idea are welcome. Thanks

 restart;
solution_band_matrix:=proc(n,a,b,c,d)
local X,i,alpha,y,G,z,x,m;
m:=n;
alpha[1]:=a[1];
# Intialisation
y[1]:=c[1]/alpha[1];
z[1]:=d[1]/alpha[1];
 for i from 2 to m-1 do
alpha[i]:=a[i]-b[i]*y[i-1];
y[i]:=c[i]/alpha[i];
z[i]:=(1/alpha[i])*(d[i]-b[i]*z[i-1]);
end do:
alpha[m]:=a[m]-b[m]*y[m-1]:
z[m]:=(1/alpha[m])*(d[m]-b[m]*z[m-1]):
x[m]:=z[m]:
for i from 1 to m-1 do
   x[i]:=z[i]-y[i]*x[i+1];
end do;
end proc:



a:=[3,3,3]; b:=[0,1,1]; c:=[1,1,0]; d:=b; n:=4;
                                  [3, 3, 3]
                                  [0, 1, 1]
                                  [1, 1, 0]
                                  [0, 1, 1]
                                      4
solution_band_matrix(n,a,b,c,d);
Error, (in solution_band_matrix) invalid subscript selector





 

@Markiyan Hirnyk 

 

Thank you very much It's okay, you used a seq of plots. Thanks.

 

@raziabdul 

 

See this code, there is nice method.

4503.worksheet.9.elliptic.pde.mw

@Carl Love 

 

Thanks for this idea. I simple but nice idea.

@Carl Love 

 

Thanks to  Markiyan and carl Love for your remarks. 

I solved it without Maple and I get the same results.

Once again, many thinks for helping me.

@Markiyan Hirnyk 

 

Thank you for your answer.

First, I agree with you abour Fourier series of f.

Second, I don't agrre with you about Fourier series of f*f. because, you put x in the interval -Pi..Pi.. why???

I think, x is in [0,2Pi[ and not -Pi..Pi... via convolution product.

 

3 4 5 6 7 8 9 Page 5 of 10