PatrickT

Dr. Patrick T

2083 Reputation

18 Badges

13 years, 301 days

MaplePrimes Activity


These are answers submitted by PatrickT

... and you're more likely to get useful help

your question is probably too general, can you post some maple code of what you have so far?

you can format your code better by (say) selecting "Formatted HTML" and selecting "Normal" for text and "Formatted" for Maple code, from the toolbar menu on top of the input box. Cleaning up your input:

restart:
b := 0.1e-2;
lambda := 100;
beta := (1/2)*sqrt(lambda^2-exp(4*alpha))+(1/4)*Pi;
Omega[1] := -t+(1/2)*arccosh(lambda*exp(-2*alpha));
Omega[2] := t+(1/2)*arccosh(lambda*exp(-2*alpha));
PDE := diff(psi(alpha, phi), [`$`(alpha, 2)])-(diff(psi(alpha, phi), 
[`$`(phi, 2)]))-exp(4*alpha)*psi(alpha, phi) = 0;
IBC := {psi(-100, phi) = 0, psi(100, phi) = 0, 
psi(alpha, .3361035810) = sqrt((1/2)*Pi)*b*Pi^(1/4)*exp(-(1/4)*lambda*Pi)
*(exp(-(1/2)*b^2*Omega[1]^2+I*(lambda*Omega[1]-beta))
+exp(-(1/2)*b^2*Omega[2]^2-I*(lambda*Omega[2]-beta)))/(2*sqrt(b)
*(lambda^2-exp(4*alpha))^(1/4)), (D[2](psi))(alpha, .3361035810) 
= sqrt((1/2)*Pi)*b*Pi^(1/4)*exp(-(1/4)*lambda*Pi)*((b^2*Omega[1]-I*lambda)
*exp(-(1/2)*b^2*Omega[1]^2+I*(lambda*Omega[1]-beta))+(-b^2*Omega[2]-I*lambda)
*exp(-(1/2)*b^2*Omega[2]^2-I*(lambda*Omega[2]-beta)))/(2*sqrt(b)
*(lambda^2-exp(4*alpha))^(1/4))};
module () local INFO; export plot, plot3d, animate, value, settings; 
option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; 
end module;
pds:-plot3d([LinearAlgebra:-HermitianTranspose(psi)*psi], phi = 5);
%;

Error, `pds` does not evaluate to a module

The error message I get is not the same as yours. As jakubi said, the line starting with module () seems to be missing something (I added a semicolon)

 

you may found this useful for your matlab figures:

http://www.mathworks.com/matlabcentral/fileexchange/23841

what system do you have? what have you tried? write it down in maple code, it'll be easier to understand your question.

The help of DEplot has plenty of examples by the way.

you can find analytical expressions:

dsolve({diff(N(t), t) = N(t)*(1-(1/1000)*N(t))-300, N(0)=500});

N(t) = -100*(-5^(1/2)+tan(1/10*t*5^(1/2)))*5^(1/2)

dsolve(diff(N(t), t) = N(t)*(1-(1/1000)*N(t))-(3/2)*N(t));

N(t) = 500/(-1+500*exp(1/2*t)*_C1)

Then you can solve for the critical value of time t* such that your N(t) switches from one expression to the next, N*=N(t*). At that critical value of time, the two N(t*) coincide.

In the second step above, _C1 is a constant of integration. You can also, more conveniently, solve analytically for a given N* at some arbitrary value of t*.


 

 

when I pressed "preview comment", all the equations were aligned vertically, after I pressed "post comment", it was no longer the case, sorry about that as it makes some of the equations hard to read.

You're looking at :

diff(S(t),t) - lambda + d*S(t) + beta*S(t)*int( Y(a,t), a=0..infinity) + v*p*S(t) - omega*int(V(a,t),a=0..infinity)-f*int(R(a,t),a=0..infinity) = 0; diff(E(a,t),t) + diff(E(a,t),a) + d*E(a,t) + alpha*E(a,t)=0; diff(Y(a,t),t) + diff(Y(a,t),a) + d*Y(a,t) + gam*Y(a,t) + mu*Y(a,t)=0; diff(R(a,t),t) + diff(R(a,t),a) + f*R(a,t) + d*R(a,t)=0; diff(V(a,t),t) + diff(V(a,t),a) + omega*V(a,t) + d*V(a,t)=0; E(a,0)=0; Y(a,0)=0.05; R(a,0)=0; V(a,0)=0; S(0)=0.95; E(0,t)=beta*S(t)*Y(a,t); Y(0,t)=alpha*E(a,t); R(0,t)=gam*Y(a,t); V(0,t)=v*p*S(t); The implication of something like Y(0,t)=0.3257*E(a,t) is that no matter what value a takes, E(a,t) takes on the same value -- is that what you meant to write?

I couldn't understand your code. Try to format it into something readable:

f := 0.5;
alpha := 0.3257;
d := 0.00761;
mu := 0.0015;
omega := 1;
lambda := 0.01028;
gam := 0.49089;
R0 := 1.42;
p(t) := 0.1;
beta :=  (R0 * d * (d + mu + gam) * (d + alpha))/(lambda*alpha);
v := 0.8;
int(Y(a, t), a = 0 .. infinity) := Y(a, t);
int(V(a, t), a = 0 .. infinity) := V(a, t);
int(R(a, t), a = 0 .. infinity) := R(a, t);
int(S(t), a = 0 .. infinity) := S(t);

In addition to the "dummy or not dummy" problem, note this:

p(t) := 0.1;

canny do that!

Replacing sum with add does work:

sum('sum('cat(Phi,2*k+1,t)*x^(2*k+1)*mu^t',('k') = 0 .. 10)',t = 0 .. 10);

into:

add(add(cat(Phi,2*k+1,t)*x^(2*k+1)*mu^t,k = 0 .. 10),t = 0 .. 10);

Thank you very much Robert, as always you are a lifesaver!

Patrick.

3^(2^3)*3^(2^2);
                                531441

Robert Israel once made the following suggestion, which I have tested and it works:

Tested on : Windows Vista / Maple 13 / Classic GUI

You must first create a directory c:\tmp (or whatever).

 

restart:
with(plots):

P:= plot3d(x^2+y^2,x=0..1,y=0..1):
A:= op([1,3],P):
a,b:= op(op([1,1],P)):
c,d:= op(op([1,2],P)):
m:= rhs(rtable_dims(A)[1]):
n:= rhs(rtable_dims(A)[2]):
for i from 1 to m do
 for j from 1 to n do
   X:= ((m-i)*a + (i-1)*b)/(m-1);
   Y:= ((n-j)*c + (j-1)*d)/(n-1);
   fprintf("c:/tmp/myfile.txt",
       "%f  %f  %f\n",X,Y,A[i,j]);
 end do
end do:
close("c:/tmp/myfile.txt"):

 

It seems to me that 1-D/worksheet is intuitive and less confusing for beginners, while 2-D/document seems rather advanced -- I have never had a need for it myself.

Shouldn't the default setup for standard be 1-D/worksheet? As a beginner, that would be my preference.

Shouldn't it be easier/better documented for beginners to set the options. Even if you are adventurous enough to go into tools/options/display, who's to know what "maple notation" mean. I'm assuming it means 1-D, but I'm not even sure. Why is it so complicated?

Next to all the toolbars displayed in the standard interface, couldn't there be one that allows beginners to easily toggle between 1-D/worksheet and 2-D/document? Something rather obvious to click on.

Because it seems simpler to me, I stick to classic whenever possible. If I were less lazy I would do numerical simulations and plots with some other software, but I usually find that once I have developed my problem sufficiently far symbolically I'd rather produce the numerical simulations and plots right there and then.

Recently I've had to use the standard interface in order to produce half-decent looking plots, but otherwise I avoid it entirely.

I always work with the latest type of processor with which my matlab and python programs run at the speed of light (nearly) and yet I find maple/standard too slow.

I click on my worksheets just to see what's in them and it is very irritating that it takes so long to load.

Plus standard crashes occasionally. Classic has never crashed on me.

Time and again I read posts by experienced users who seem to prefer the classic interface and 1-D input. Yet the maple development team seems to be pushing for 2-D and standard and paying little attention to complaints in this regard...

mapleprimes is the main reason I stay with maple, despite having access to mathematica and sage (and more or less knowing how to use them for my quite limited purposes).

The plot3d output with maple/standard is unfortunately substandard. There seems to be no workaround. However, you can produce and export a plot3d with maple/classic and get a much better result -- not quite as good as the standard plot, but much better than the standard plot3d.

This problem has been discussed recently, see e.g.

http://www.mapleprimes.com/forum/changethicknessaxesandtickmarkssimpleplot

http://www.mapleprimes.com/forum/whatmapleequivalentmatlabsaxisinfinfinfinf

First 17 18 19 20 21 22 23 Page 19 of 24