Irving

94 Reputation

2 Badges

12 years, 93 days

MaplePrimes Activity


These are answers submitted by Irving

Thanks you everybody all of  yours  comments are right .  I am a primer in Maple and I have one more question.

I suppose Global Optimization Toolbox is inside Maple. I follows the way of Robert but it does not work  to me .

In my worksheet does not show me the final number that Robert obtain. (M, k and q)

I  would like to know what happens?. I just did in  this way

>restart;

>DATA:=

[[13.2621 , 0.0012],

[14.0740 , 0.0017],

[15.4272 , 0.0031],

[16.7803 , 0.0063],

[18.1335 , 0.0174],

[19.2161 , 0.0317],

[20.5692 , 0.0598],

[21.6518 , 0.0821],

[23.0049 , 0.1501],

[24.0875 , 0.2061],

[25.1700 , 0.2742],

[26.5232 , 0.3534],

[27.3351, 0.4852],

[28.6883 , 0.5337],

[29.2295 , 0.6059],

[30.5827, 0.7565],

[32.4772 , 1.0723],

[34.1010 , 1.1068],

[34.6422 , 1.2173]]:

 

f:= x -> M*( (1 - ( 1 - q*(0.0012/M)^(1-q))*exp(-k*q*x)) /q)^(1/(1-q)) :

residuals := map(p -> (f(p[1])-p[2]), DATA):

S:= GlobalSolve(add(r^2,r=residuals),{1-(1-q*(.0012/M)^(1-q))*exp(-k*q*DATA[1,1]) >= 0},

k=0..1, q=0.001 ..1, M=40..1000);

 

Do I also define  after restart  with(GlobalOptimization) but did not give me any number.

Do I have to install something to work Tool Box Optimization ?

What do I have to do ?

 

Please let me know any comments and  Thanks again

 

In Linux you  can use  xmaple -cw  in order to work in a classic form

Thanks Robert ,

the program runs .  so now I need to plot this numerical  solutions , I did this but I think is not correct.

restart;
with(PDEtools):
PDE:= [diff(u(x,t),t)= u(x,t)*(1-u(x,t))*(u(x,t) -v(x,t))+ diff(u(x,t),x,x), diff(v(x,t),t)=u(x,t)-v(x,t)];
IBC := {u(x, 0) = tanh(x), v(x, 0) = 0, u(-10,t) = 0, u(10,t) = 0};

pds := pdsolve(PDE,IBC,[u,v],numeric);
p1:=pds:-plot(t=10,numpoints=50);
plots[display]({p1});
 

I would like to plot e.g:  u(x,t) vs v(x,t) and so on. Any coment will be so usefull, in maple's help there is not any examples for PDE system.

 

Thanks Robert ,

the program runs .  so now I need to plot this numerical  solutions , I did this but I think is not correct.

restart;
with(PDEtools):
PDE:= [diff(u(x,t),t)= u(x,t)*(1-u(x,t))*(u(x,t) -v(x,t))+ diff(u(x,t),x,x), diff(v(x,t),t)=u(x,t)-v(x,t)];
IBC := {u(x, 0) = tanh(x), v(x, 0) = 0, u(-10,t) = 0, u(10,t) = 0};

pds := pdsolve(PDE,IBC,[u,v],numeric);
p1:=pds:-plot(t=10,numpoints=50);
plots[display]({p1});
 

I would like to plot e.g:  u(x,t) vs v(x,t) and so on. Any coment will be so usefull, in maple's help there is not any examples for PDE system.

 

 

Irving Rondon

In this problem , we can solve numerically a PDE (in this case nonlinear),  then we can save it in a data file.
Thanks for the comment and improvement.

restart;
g:=0.2:
PDE := diff(u(x,t),t,t) -diff(u(x,t),x,x) + g*diff(u(x,t),t) - 1/2*(u(x,t)-u(x,t)^3)=0 ;
IBC := {u(x,0)= tanh(x),u(-15,t)= -1,u(15,t)= 1 ,D[2](u)(x,0)= -1/(cosh(x))^2}:
sol := pdsolve(PDE,IBC,'numeric',u(x,t)):
ut:=sol:-value(u(x,t),output=listprocedure):
file := "/home/irving/mydatos.dat":
 for tt from 0.2 to 10 by 0.2 do  
    for xx from -15 to 15 by 0.5 do
      fprintf(file,"%f %f %lf\n",tt,xx,rhs(ut[3])(xx,tt)):
   end do:
end do:
fclose(file):
 

Hi  David

Thanks for your answer. Your approach is very good. but still have a litle limitation, is about time.

There is  a posibility to change time also  into  the procedure you posted it.  Can we implement  this into the problem?

So If we have the data in a file from PDE, this can provide a whole picture of the problem . Because we are able to analize the solution in deep.  The solution of this problem is important and general for any PDE to obtain a data file from the numerical  way that provide pdsolve.

 

Thanks


Page 1 of 1