MaplePrimes Questions

I am learning how to do animations in Maple, and I need to export an animation I made to animated gif file.

nTerms := 20:
lam    := evalf([BesselJZeros(0,1..nTerms)]):
c      := seq(1/lam[n]^2*BesselJ(1,lam[n]/2)/BesselJ(1,lam[n])^2,n=1..nTerms):
mySol  := proc(r,t)
   local n;
   4/Pi*sum(c[n]*BesselJ(0,lam[n]*r)*sin(lam[n]*t),n=1..nTerms);
end proc:

maxTime := 5: (*seconds*)
delay   := 0.03:
nFrames := round(maxTime/delay):
frames  := Array([seq(0,i=1..nFrames)]):

frames  := [seq( plot3d([ r, theta, mySol(r,(i*delay)) ],
                   r      = 0..1,
                   theta  = 0..2*Pi,
                   coords = cylindrical,
                   axes   = none,                    
                   title  = sprintf("%s %3.2f %s","time ",(i*delay),"seconds")
                ),
             i=0..nFrames-1)
           ]:
plots:-display(convert(frames,list),insequence=true);

And the above makes

 

I have few questions which I could not find an answer for.

How to save the above sequence of images frames (in the list frames) to an animated gif file programmatically? Currently, I use plots:-display(frames,insequence=true); and then right-click on the screen out, select export->GIF  and this does save the file as animated file.

The problem with the above method, is that I have no control on telling Maple some options. For example, I want to control the amount of delay between each frame when it is played in the web page. I also want to tell Maple for example to play this once in the gif file.

These options are suppored in Mathematica. But I do not see how to do them in Maple. In Mathematica, given a list of frames (generted from a Plot command), which is the variable "frames" in the above Maple code, then one can do this

Export["anim.gif",frames,"DisplayDurations"->Table[.2,{Length@frames}]]

Now when loading anim.gif in a browser, the delay between each frame is 0.2 seconds. The "DisplayDurations" set the delay between each frame when played in the browser  automatically.

One can also add the option

"AnimationRepetitions" -> 1

and this will make the animation play one time in the browser when first loaded. Now Maple generated animation gif file plays continuously which I do not want to, this is even though inside the notebook, Maple says it will play "single" time. But this option does not seem to be exported to the animation gif file

 

 

Is there a way to configure these options? When I right-click, and export the animation to GIF file, I see no export options to change.

I could not use the export("anim.gif",frames)  command in Maple, the generated GIF file is not animated.

thank you

I was under the impression that if you had some a>b

then evalf[i](a) would be bigger or equal to evalf[i](b) for any i, but today I stumbled upon an example where this is not the case.

a := (sqrt(5)-1)*(1/2)``

evalf(a)

.6180339890

(1)

evalf[1](a)

.5

(2)

b := .6

evalf[1](b)

.6``

(3)

``

I've either overlooked something here or I simply don't understand how the evalf command is supposed to work.
Can anybody help me out?
Also, for some reason it seems like evalf[i](a) always ends with 0, for any i larger than 1, which also seems weird to me.
 

Download Afrunding.mw

Hi,
Can somebody explain me these strange results ?

 

restart:
with(Statistics):
X := RandomVariable(Normal(1.0, 1.0)):
S := Sample(X, 10):

# naively... but it's not what I was expecting for
#                maybe a misuse of the 'normalize=truefalse' option ????
Likelihood(Normal(1.0, 1.0), S);
       # a strange answer

# 2nd way
A := Likelihood(Normal(m, 1.0), S):
evalf(subs(m=1.0, A));
   # this is the good answer
   0.004387

# third way
Likelihood(Normal(1.0, 1.0), S, 'normalize=false');
   4.48e-7    # a wrong answer

 

Thanks for your enlightenment

Please how can i obtain analytical siolution of the system of pde with maple

pde1 := diff(u(x, t), t) = (1/50)*(diff(u(x, t), x, x))+1-4*u(x, t)+u(x, t)^2*v(x, t);
pde2 := diff(v(x, t), t) = (1/50)*(diff(v(x, t), x, x))+3*u(x, t)-u(x, t)^2*v(x, t);
u(x, 0) = 1+sin(2*Pi*x), v(x, 0) = 3, u(0, t) = u(1, t) and u(1, t) = 1, v(0, t) = v(1, t) and v(1, t) = 3;

 

I am looking at the help pages, and I see Maple code using symbols never seen in Maple language before.

I tried to do ?&under to get help on this new Maple language command/symbol, but help does not show it. I read help Neutral Operators but do not understand it.

What does the following mean in plain Maple code?

And what does the following mean using Plain Maple code:

 

Could the above be written without using these `&` things?  I am having hard time understanding what the code is doing because of these. Never used them before.

These are from help on "Definition of a Structured Type in Maple"

I want to compute the following supremum of the function.

I'll write in Latex code.

I have the following term which I want to estimate:

\delta_1(\epsilon):= \sup_{|x|<100}\sup_{ 0<= t<1/\epsilon} \epsilon \cdot |\int_0^t [ f(x,\cos s , \sin s , p_0(t)+q_0(s))-g(x,t)]ds|

where p_0(t) is an unknown function that depends on t alone.

f(x,y_1,y_2,z):=x+(y_1^2)*z

g(x,t):= \lim_{T\to \infty} 1/T \int_0^T f(x,\cos s , \sin s , p_0(t)+q_0(s))ds

q_0(s):= \exp(-s)(q_0(0)+\int_0^s (h(x_0(0),\cos(r), \sin(r))-p_0(0))dr)

where h(x,y_1,y_2):=y_1^2.

Can someone lend me a hand?

Thanks!

 

Please help me to remove error from the plotting. Here I have attached a mapple file

.u_nonlinerafit.mw

I figured out what the interpolation is, but can someone please give me a reference for the publication of the person that discovered that this works thankyou. 

 


 

PolyI1 := proc (N, n) options operator, arrow; (-1)^N*(sum(n*factorial(n-1)*(-1)^k*a[k]/(factorial(n-N-1)*(n-k)*factorial(k)*factorial(N-k)), k = 0 .. N)) end proc

proc (N, n) options operator, arrow; (-1)^N*(sum(n*factorial(n-1)*(-1)^k*a[k]/(factorial(n-N-1)*(n-k)*factorial(k)*factorial(N-k)), k = 0 .. N)) end proc

(1)

PolyI2 := proc (N, n) options operator, arrow; CurveFitting[PolynomialInterpolation]([seq([k, a[k]], k = 0 .. N)], n) end proc

proc (N, n) options operator, arrow; CurveFitting[PolynomialInterpolation]([seq([k, a[k]], k = 0 .. N)], n) end proc

(2)

collect(expand(PolyI1(2, n)), n); PolyI2(2, n)

((1/2)*a[2]-a[1]+(1/2)*a[0])*n^2+(-(1/2)*a[2]+2*a[1]-(3/2)*a[0])*n+a[0]

 

((1/2)*a[2]-a[1]+(1/2)*a[0])*n^2+(-(1/2)*a[2]+2*a[1]-(3/2)*a[0])*n+a[0]

(3)

collect(expand(PolyI1(3, n)), n); PolyI2(3, n)

((1/6)*a[3]-(1/2)*a[2]+(1/2)*a[1]-(1/6)*a[0])*n^3+(-(1/2)*a[3]+a[0]-(5/2)*a[1]+2*a[2])*n^2+(-(3/2)*a[2]+(1/3)*a[3]-(11/6)*a[0]+3*a[1])*n+a[0]

 

((1/6)*a[3]-(1/2)*a[2]+(1/2)*a[1]-(1/6)*a[0])*n^3+(-(1/2)*a[3]+a[0]-(5/2)*a[1]+2*a[2])*n^2+(-(3/2)*a[2]+(1/3)*a[3]-(11/6)*a[0]+3*a[1])*n+a[0]

(4)

collect(expand(PolyI1(4, n)), n); PolyI2(4, n)

(-(1/6)*a[1]+(1/4)*a[2]-(1/6)*a[3]+(1/24)*a[0]+(1/24)*a[4])*n^4+(-(5/12)*a[0]+(3/2)*a[1]-2*a[2]+(7/6)*a[3]-(1/4)*a[4])*n^3+((35/24)*a[0]-(13/3)*a[1]+(19/4)*a[2]-(7/3)*a[3]+(11/24)*a[4])*n^2+(-(25/12)*a[0]-(1/4)*a[4]+4*a[1]-3*a[2]+(4/3)*a[3])*n+a[0]

 

(-(1/6)*a[1]+(1/4)*a[2]-(1/6)*a[3]+(1/24)*a[0]+(1/24)*a[4])*n^4+(-(5/12)*a[0]+(3/2)*a[1]-2*a[2]+(7/6)*a[3]-(1/4)*a[4])*n^3+((35/24)*a[0]-(13/3)*a[1]+(19/4)*a[2]-(7/3)*a[3]+(11/24)*a[4])*n^2+(-(25/12)*a[0]-(1/4)*a[4]+4*a[1]-3*a[2]+(4/3)*a[3])*n+a[0]

(5)

collect(expand(PolyI1(5, n)), n); PolyI2(5, n)

((1/12)*a[3]-(1/120)*a[0]+(1/24)*a[1]-(1/12)*a[2]-(1/24)*a[4]+(1/120)*a[5])*n^5+(-a[3]+(11/24)*a[4]+(1/8)*a[0]-(7/12)*a[1]+(13/12)*a[2]-(1/12)*a[5])*n^4+((49/12)*a[3]-(41/24)*a[4]+(7/24)*a[5]-(17/24)*a[0]+(71/24)*a[1]-(59/12)*a[2])*n^3+((15/8)*a[0]-(13/2)*a[3]+(61/24)*a[4]-(5/12)*a[5]-(77/12)*a[1]+(107/12)*a[2])*n^2+(-(137/60)*a[0]+5*a[1]+(10/3)*a[3]-(5/4)*a[4]+(1/5)*a[5]-5*a[2])*n+a[0]

 

((1/12)*a[3]-(1/120)*a[0]+(1/24)*a[1]-(1/12)*a[2]-(1/24)*a[4]+(1/120)*a[5])*n^5+(-a[3]+(11/24)*a[4]+(1/8)*a[0]-(7/12)*a[1]+(13/12)*a[2]-(1/12)*a[5])*n^4+((49/12)*a[3]-(41/24)*a[4]+(7/24)*a[5]-(17/24)*a[0]+(71/24)*a[1]-(59/12)*a[2])*n^3+((15/8)*a[0]-(13/2)*a[3]+(61/24)*a[4]-(5/12)*a[5]-(77/12)*a[1]+(107/12)*a[2])*n^2+(-(137/60)*a[0]+5*a[1]+(10/3)*a[3]-(5/4)*a[4]+(1/5)*a[5]-5*a[2])*n+a[0]

(6)

NULL


 

Download 21052018002.mw

When I import a csv file, (ie. a:=Import("c:/test.csv") the first column is a time stamp column.  So when I use the command a[1] the timestamp column is displayed as well as the next column which is I guess 1.  Similarily a[2] gives timestamp column plus column 3.  So it looks like timestamp column is column 0?  But a[0] gives invalid index error. 

So when I convert(a,Array) the first timestamp column is missing. 

Am I not understanding DataFrames correctly or is Maple not manipulating it correctly.  Perhaps it's some other issue that I'm not understanding.  Any ideas?  Why doesn't that first column appear in the convert but yet shows up in the original?

Tonight I came across something that OEIS had referenced as the maximum fermi dirac divisor of a number, so i decided it might be a good idea to study this concept by first figuring out how to enumerate the subset of these divisors.

But rather than specifically about this subject, i wanted to ask if my way of "enumeration of numbers meeting specific criteria" is inferior to other methods i have seen. For example this guy named Alois Heinz uses select in the following manner to obtain  the least divisor of a number that is greater than it's square root:

 

Where as I have always been constructing piecewise expressions as seen in the example of what i have been doing tonight:


 

with(numtheory):

`&Fscr;` := proc (n) options operator, arrow; {seq(seq(piecewise(frac(ln(ln(divisors(n)[k])/ln(ithprime(j)))/ln(2)) = 0 and divisors(n)[k] <> 1 and divisors(n)[k] <> 2, divisors(n)[k], NULL), j = 1 .. pi(divisors(n)[k])), k = 1 .. nops(divisors(n)))} end proc

`&Fscr;`(200000)

{4, 5, 16, 25, 625}

(1)

``


 

Download 21052018.mw

 

So basically, because it is very hard for me to break habits once i have formed them, my question is, is it going to be beneficial for me to switch to this persons method of enumeration, or am i ok just to continue my way?

 

 

Sorry I am just having difficulties understanding what this error means exactly, normally maple returns an error message stating the procedure that was being executed when the error was encountered, but in this situation it says (in unknown) which doesnt really make sense, i mean how can a procedure unknown to maple be being executed in the first place, or is this a procedure name itself?

hi,i used ifsolve  comand in my sheat and i have aloop over it  but some times my equations   can't be  solved .My question is how i give an order to maple to stop the loop if the equations can't solve 
 


 

Hi.

I am attempting to obtain a solution to, what appears to be a simple PDE system (3 equations) and have encountered an error with the initial / boundary conditions. Can anyone provide and guidance / help with this?

The worksheet follows. 

PDE_System.mw

Thanks in advance.

I'm  trying to converting an infinite series from several terms to sigma form.

The series in question is:

x-x^2/(t*Log[t])+(2/3)*x^3/(t^2*Log[t]^2)+(-1/(2*t^3*Log[t]^3)-1/(4*t^3*Log[t]^2)-1/(6*t^3*Log[t]))*x^4+(2/(5*t^4*Log[t]^4)+2/(5*t^4*Log[t]^3)+4/(15*t^4*Log[t]^2))*x^5+(-1/(3*t^5*Log[t]^5)-1/(2*t^5*Log[t]^4)-5/(12*t^5*Log[t]^3)-5/(36*t^5*Log[t]^2)-1/(15*t^5*Log[t]))*x^6+(2/(7*t^6*Log[t]^6)+4/(7*t^6*Log[t]^5)+25/(42*t^6*Log[t]^4)+1/(3*t^6*Log[t]^3)+46/(315*t^6*Log[t]^2))*x^7+(-1/(4*t^7*Log[t]^7)-5/(8*t^7*Log[t]^6)-19/(24*t^7*Log[t]^5)-19/(32*t^7*Log[t]^4)-19/(60*t^7*Log[t]^3)-7/(80*t^7*Log[t]^2)-1/(28*t^7*Log[t]))*x^8+(2/(9*t^8*Log[t]^8)+2/(3*t^8*Log[t]^7)+1/(t^8*Log[t]^6)+25/(27*t^8*Log[t]^5)+163/(270*t^8*Log[t]^4)+106/(405*t^8*Log[t]^3)+88/(945*t^8*Log[t]^2))*x^9+(-1/(5*t^9*Log[t]^9)-7/(10*t^9*Log[t]^8)-73/(60*t^9*Log[t]^7)-4/(3*t^9*Log[t]^6)-149/(144*t^9*Log[t]^5)-691/(1200*t^9*Log[t]^4)-18569/(75600*t^9*Log[t]^3)-761/(12600*t^9*Log[t]^2)-1/(45*t^9*Log[t]))*x^10I've attached the worksheet 1.mw.

The example below works but not for the above I just get:

Error, invalid arguments to coeffs

Not sure where I'm going wrong any idea how to do this?

EXAMPLE that works from https://math.stackexchange.com/questions/2786296/strategy-or-software-for-representing-infinite-series-in-sigma-form

I've also attached the worksheet for this 2.mw

=>

S:= 1-x+4/3*(x^2)-2*x^3+16/5*(x^4)-16/3*(x^5)+64/7*(x^6)-16*x^7+256/9*(x^8)-256/5*(x^9)+1024/11*(x^10);

Coeffs:= [seq(coeff(S, x, j), j=0..10)];

g:= gfun:-guessgf(Coeffs,x);

convert(g[1], FPS, x);

results in:

Sum((-1)^k*2^k*x^k/(k+1), k = 0 .. infinity)

or 

rec:= gfun:-listtorec(Coeffs, a(n));

aa:= rsolve(rec[1],a(n));

Sum(aa*x^n, n=0..infinity);

results in the same desired result.

 

Hellow , Any body can help me to write the codes for the differential equation to solve by Galerkin finite element method by four elements by taking step size h=pi/2 and compare with homotropy method by plotting the graph of Galerkin method, homotropy method and exact, here is my codes

ode := diff(y(x), x, x) + y(x)-1=0:
ics := y(0) = 0, y(2*pi) = 0:
dsolve({ics, ode}):
 

First 822 823 824 825 826 827 828 Last Page 824 of 2429