Preben Alsholm

13471 Reputation

22 Badges

20 years, 257 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@mehrdadparsapour 

You also need to use D instead of diff in the IBC, e.g.

D[1,1](u[2])(L,t)=0 for the condition that the second derivative w.r.t. the first variable (i.e. x) of u[2] at x=L be zero for all times t.

@mehrdadparsapour 

You also need to use D instead of diff in the IBC, e.g.

D[1,1](u[2])(L,t)=0 for the condition that the second derivative w.r.t. the first variable (i.e. x) of u[2] at x=L be zero for all times t.

This reminds me that

int(exp(-x)/(1-exp(-x)),x=0..infinity);

still in Maple 15 results in Eulers's constant gamma.

The integral is obviously divergent. This is an old error.

For my own purpose I once made a procedure called ResizePlot.

It works like this.

1. Save your worksheet with default plot sizes (2D or 3D plots including arrays of plots).

2. Read the procedure ResizePlot from wherever it has been saved (e.g. 

read "G:/MapleDiverse/resizeplot.m";

assuming that it has been saved to the file "G:/MapleDiverse/resizeplot.m" (see below) )

3. The following command will resize the plots in the worksheet in the first location to height = 100 and width = 200 (pixels). The output file is the last argument. Remember the extensions in both places.

ResizePlot("G:/MapleDiverse/MaplePrimes/resizeTEST.mw",[100,200],"G:/MapleDiverse/MaplePrimes/resizeTESTsmall.mw");

The description and comments in the procedure are in Danish (sorry), but I bring it anyway:

#####################################

ResizePlot:=proc(inputfil::string,dim::list(posint),outputfil::string,{[arraybredde,Arraybredde]::posint:=0})
local fil,r1,r2,H,W,n,aw;
description "Input en streng, der angiver en sti til et eksisterende Maple-worksheet, en liste [H,W] bestående af ny højde og bredde for plots. Tredie argument er en streng, der angiver en sti til output-filen, der skal ende med '.mw' .
Output til 'outputfil' er et nyt Maple-worksheet med de nye plotstørrelser (i pixels).
2D- og 3D-plots får samme størrelser.
Hvis 'outputfil' allerede eksisterer, bliver den overskrevet.
Valgfrit argument er arraybredde=positivt helt tal, der angiver hvor mange procent af skærmens bredde plots i en array skal fylde. Default er den i listen 'dim' angivne bredde delt med 4 (da default-bredden i pixels er 400).
'Arraybredde' kan bruges i stedet.";
uses StringTools,FileTools;
##Vi kontrollerer, at filnavnene svarer til Maple worksheets
###
r1:=searchtext(".mw",inputfil,-3..-1);
r2:=searchtext(".mw",outputfil,-3..-1);
if r1 = 0 then error "Inputfilnavnet %1 skal ende med .mw",inputfil end if;
if r2 = 0 then error "Outputfilnavnet %1 skal ende med .mw",outputfil end if;
###
###Vi henter ny højde og ny bredde:
if nops(dim)<>2 then error "Listen skal bestå af 2 positive tal (højde og bredde)" end if;
H,W:=op(dim);
###Vi indlæser inputfilen som en tekststreng:
fil:=Text:-ReadFile(inputfil);
###Antal plots findes:
n:=nops([SearchAll("<Plot",fil)]);
print(cat("Antal plots = ",n));
###Vi erstatter gammel højde og bredde med ny:
fil:=RegSubs("(<Plot height=\")([-0-9]+)(\" type=\"[twohre]+-dimensional\" width=\")([-0-9]+)(\")"
= cat("\\1",H,"\\3",W,"\\5"),fil);
###Vi ændrer størrelsen på evt. arrays af plots.
if arraybredde>0 then aw:=arraybredde else aw:=round(W/4.) end if;
fil:=RegSubs("(layout=\"Maple Plot\"><Table[^>]+width=\")([0-9]+)(%\"[^>]+>)"=
cat("\\1",aw,"\\3"),fil);
##Vi gemmer strengen fil i outputfil og lukker derefter denne:
Text:-WriteString( outputfil, fil);
Text:-Close( outputfil );
end proc:

##Saving the procedure in the place I already referred to above:

save ResizePlot,"G:/MapleDiverse/resizeplot.m";

x[6](t) = 0 should be x[6](0) = 0 or rather x[6](0) = a, where a is not zero, since introdu[3] has a singularity at x[i](t) = 0 for all i = 1..6.

x[6](t) = 0 should be x[6](0) = 0 or rather x[6](0) = a, where a is not zero, since introdu[3] has a singularity at x[i](t) = 0 for all i = 1..6.

@hirnyk Assuming you want the default range, yes that is simpler. However, in Maple 15 the default range for the basic trigonometric functions is not -10..10, but -2*Pi..2*Pi. Thus plot(sin) produces the same plot as plot(sin,-2*Pi..2*Pi).

@hirnyk Assuming you want the default range, yes that is simpler. However, in Maple 15 the default range for the basic trigonometric functions is not -10..10, but -2*Pi..2*Pi. Thus plot(sin) produces the same plot as plot(sin,-2*Pi..2*Pi).

Remember that you took the imaginary part in the original question.

Remember that you took the imaginary part in the original question.

@goli In my example x(t) = tan(t) is the solution satisfying the initial condition x(0)=0 and having as its maximal interval of definition (-Pi/2, Pi/2) using the usual requirement that the solution has to be (at least) defined and continuous on the interval. If you give up only continuity then

x(t) = piecewise(t<Pi/2,tan(t),tan(t-Pi/4))

is a solution satisfying x(0) = 0 and defined on the open interval (-Pi/2, 3*Pi/4), but it is not continuous at t = Pi/2.

Instead of tan(t-Pi/4) you could have used tan(t-c) for infinitely many other values of c and still have a solution defined on an interval containing (-Pi/2,Pi/2) as a proper subset.

That is why I say that it doesn't make sense to continue the solution on the other side of the singularity. If you  give up the requirement that the solution be defined at all points of the interval then the situation is of course no better.

@goli In my example x(t) = tan(t) is the solution satisfying the initial condition x(0)=0 and having as its maximal interval of definition (-Pi/2, Pi/2) using the usual requirement that the solution has to be (at least) defined and continuous on the interval. If you give up only continuity then

x(t) = piecewise(t<Pi/2,tan(t),tan(t-Pi/4))

is a solution satisfying x(0) = 0 and defined on the open interval (-Pi/2, 3*Pi/4), but it is not continuous at t = Pi/2.

Instead of tan(t-Pi/4) you could have used tan(t-c) for infinitely many other values of c and still have a solution defined on an interval containing (-Pi/2,Pi/2) as a proper subset.

That is why I say that it doesn't make sense to continue the solution on the other side of the singularity. If you  give up the requirement that the solution be defined at all points of the interval then the situation is of course no better.

I just installed Maple 15 and checked that indeed the subs-problem in animate is corrected in Maple 15, meaning that the two occurrences of subs have been replaced with eval's. 

I just installed Maple 15 and checked that indeed the subs-problem in animate is corrected in Maple 15, meaning that the two occurrences of subs have been replaced with eval's. 

@Robert Israel I have often enough suggested that the couple of occurences of subs in the animate procedure be replaced by eval's. I never got any response. Is it harmful in any way?

What I do to remedy the situation is the following and illustrated with Erik's example:

restart;

`plots/animate`:=subs(subs=((x,y)->eval(y,x)),eval(`plots/animate`)):

with(plots);
f := proc(t) if 5 < t then sin(t) else 0 end if end proc;
ball := proc (x, y) plots[pointplot]([[x, y]], color = blue, symbol = solidcircle, symbolsize = 40) end proc;
animate(ball, [4, 'f'(t)], t = 0 .. 10, frames = 200);

First 201 202 203 204 205 206 207 Last Page 203 of 225