Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

I tried various interpretations of what you are saying, but have not encountered any problem. Could you give us the full code necessary for exhibiting this behavior?

@love maths You could try this:

This illustrates that the elements affected by Average are the elements inside a square:
plots:-implicitplot(abs(x-N/2)+abs(y-N/2)-N/4=0,x=0..N,y=0..N,rangeasview,gridrefine=2);
#That square has vertices (N/4,N/2),(N/2,N/4),(N/2,3*N/4),(3*N/4,N/2), which is confirmed by F which returns 0 at those points:
F(N/4,N/2),F(N/2,N/4),F(N/2,3*N/4),F(3*N/4,N/2);
#A little experimentation:
A:=curry(Average,F);
seq((A@@i)(f0),i=0..5);
#Guess: The sequence converges to a matrix of ones.
#This guess is confirmed by (but certainly not proved by)
f:=f0: f1:=Matrix(N,fill=1):
for i from 1 to 500 while LinearAlgebra:-Norm(f-f1)>1e-12 do f:=A(f) end do:
i-1;
evalf[12](f);


@mablecat I repeated the commands and made sure that I used Maple 17. Still no problem:

interface(version);
Standard Worksheet Interface, Maple 17.02, Windows 7, September 5 2013 Build ID 872941


@Carl Love I was surprised that the square brackets you have after D in the intital conditions actually work.
However, I corrected that and used your system:

restart;
sys:={diff(a[1](t),t$2) = -a[1](t), diff(a[2](t),t$2) = -a[2](t),a[1](0)=1, a[2](0)=0, D(a[1])(0)=0, D(a[2])(0)=1};
#Analytical solution
dsolve(sys);
#Info on events:
?dsolve,events
#Example of using events. These two events will trigger when a[i](t) = 0 i=1..2. The discrete variables b1 and b2 will be taking the values for t at those times.
sysE:=sys union {b1(0)=0,b2(0)=0};
SolE:=dsolve(sysE,numeric,discrete_variables=[b1(t)::float,b2(t)::float],events=[[a[1](t),b1(t)=t],[a[2](t),b2(t)=t]]);
SolE(6);
plots:-odeplot(SolE,[[t,b1(t)],[t,b2(t)]],0..6,thickness=2);


I shall try to see if I can upload anything. So here is an extremely short mw-file.

Well, I cannot do it either. MaplePrimes has temporary problems.

@sharena2 Well, you do need one more condition. Not necessarily the one I used.
If you have tried the same problem earlier and it was OK then you ought to show us that "same" problem:
It couldn't be the same, could it?

@mehdi jafari This is clearly a bug in int. The infinite series found is incorrect. However, Maple correctly finds the sum of the incorrect series.

restart;
A:=Int(cosh(t)/(cosh((17/15)*t)+cosh(t)), t = 0 .. infinity);
evalf(A);
infolevel[int]:=5:
#The "successful" method is meijerg. int(...., method=NoMeijerg) returns unevaluated.
S:=value(A);
evalf(S);
value(S);
evalf(%);



@mehdi jafari You are actually doing numerical integration in both cases here. After having used simplify int returns unevaluated. After that evalf is applied to the unevaluated integral and Maple uses numerical integration.
Try removing evalf from evalf(int(f,t=0..infinity)) and you will see.

 

After having corrected for the exp problem you do get a solution using fsolve:

fsolve({x3,x4},{T,t1});

@AndrewG diff acts the usual mathematical way. The independent variable has to be a name, Expressions like phi(t) or (worse) diff(phi(t),t),t) are not names.
The Physics package, however, has an extended diff procedure. So instead of what I did you could do:

with(Physics,diff):
diff(diff(L,diff(phi(t),t)),t)-diff(L,phi(t))=0;


@lemelinm You had infinity as the upper limit of the integral in the beginning. Later you replace it by L.
So I suppose your functions are 0 outside the interval 0..L ?

@dena Why don't you use the thick green arrow in the editor's menu panel. It is the last icon. That way you can upload the worksheet for everybody to see.

 

 

@Carl Love Maybe a very simple example could be helpful:

restart;
p:=proc(x) print(is(a>0)); if is(a>0) then x else 2*x end if end proc;
p(x);
p(x) assuming a>0;
assume(a>0);
p(x);
restart;
q:=proc(a,x) print(is(a>0)); if is(a>0) then x else 2*x end if end proc;
q(a,x) assuming a>0;


@Joe Riel I just repeated the attempt. This time I first fetched your procedure directly from the link I gave above. I copied and pasted that into a worksheet in Maple 18.
Then I got 2014_PDE_project.mw from the link the questioner gave above. It opened in Maple 18 saying "Warning etc". I then saved it in a place I use for Maple worksheets.
In the worksheet with your executed procedure I executed the command
DeleteBadCharacters("G:/MapleDiverse/2014_PDE_project.mw");
and the response was the printout:
no errors in file

Writing this carefully made me realize that maybe that step of saving the (bad) file made the error go away (and throw away what couldn't be seen).

Indeed that seems to be the case. The third time I started by saving the file directly not from Maple.
Used DeleteBadCharacters as above. The report was:
"deleted bad characters: { }   
wrote updated file to G:/MapleDiverse/2014_PDE_project-fixed.mw"

#there was a square inside {} which apparently doesn't copy to MaplePrimes.

And the good news: The file was indeed fixed!

First 147 148 149 150 151 152 153 Last Page 149 of 231