MaplePrimes Questions

If I create  and save a worksheet in Maple 2019, then try to up load it here, it uploads but contents won't display

No issue if I have an "identical" worksheet in Maple 2018.

See the attachment attempts below

#### Result of trying to upload Maple 2019 file here


Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/fibon2019.mw .
 

Download fibon2019.mw

But "same" file from Maple 2018 "works"

#
# Recursive Fibonacci generator
#
  myFib:= proc(n::integer)
               option remember;
               if   n=1
               then return 1
               elif n=0
               then return 0
               else return myFib(n-1)+myFib(n-2):
               fi:
          end proc:

  seq(myFib(j), j=0..20);

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765

(1)

 


 

Download fibon2018.mw

Hello,

I have a matrix of size m*n and I want to apply a procedure "f" to each entry of the matrix. But I want to do this in parallel to reduce the computation time.

I used: Matrix(n, m, (i,j) -> Grid:-Seq( f (M (i,j) ) ,i=1..n, j=1..m) ); 

but I'm not satisfied with the result, I want the calculation to be faster. Are there any other methods?

Dear All,

Gretting from me. I have faced a problem in Maple program due to some errors. Could you please help me about the solution of that problem?
Thanks

@Preben Alsholm
@tomleslie
Sourse File: solution.mw

I've always had problems installing Physics package from inside Maple.

I thought by buying Maple 2019 this problem will go away, but I am still not able to install this package.

I get this error

Fetching package "Physics Updates" from MapleCloud...
ID: 5137472255164416
Version: 326
URL: https://maple.cloud

File size is 10764288 bytes(10 MB). 

Installing package...
PackageTools:-Install("C:/Users/me/AppData/Local/Temp/cloudDownload3648614516733692025/Physics+Updates.maple",overwrite=true,pkgname="Physics Updates");

ERROR: The package could not be installed.
error PackageTools:-Install, "this package is intended to work 
with Maple %1; it can not be installed in the version you 
are using -- %2", "2018", "2019"

Here is screen shot

 

I am on windows 10 professional. Maple 2019 installed with no problems.

 

any suggestion to try (other what was suggeted in link at top, which is to manually download the physics package each time and update maple.ini to point to the new version)?

Is Physics package updated to work/install in Maple 2019 or does one need to wait few more days untill this happens?

I cant get the error. Any one can help me?

restart;
with(plots);
r := 0.5e-2; k := 10000; a := .4; alpha := .25; epsilon := 0.2e-1; mu := 0.4e-1; delta := 0.3e-2; Lambda := 0.2e-1;
beta[2] := .45; beta[1] := .2; c[1] := 2; c[2] := 5; w[1] := 10; w[2] := 30; T := 3;
u[1] := min(max(0, z), 1); z := beta[2]*s(t)*i(t)*(lambda[2](t)-lambda[1](t))/(w[1]*(s(t)+i(t)+e(t))); u[2] := min(max(0, c), 1); c := (beta[1]*s(t)*p(t).(lambda[2](t)-lambda[1](t)))/(w[2]*(a+p(t)))+(lambda[2](t).e(t)+(i(t)+alpha.e(t)).lambda[3](t)-(gamma.i(t)+p(t)).lambda[4](t))/w[2]; 

sys := diff(s(t), t) = r*s(t)*(1-(s(t)+i(t)+e(t))/k)-beta[1]*s(t)*p(t)*(1-u[2])/(a+p(t))-beta[2]*s(t)*i(t)*(1-u[1])/(s(t)+i(t)+e(t)), diff(e(t), t) = beta[1]*s(t)*p(t)*(1-u[2])/(a+p(t))+beta[2]*s(t)*i(t)*(1-u[1])/(s(t)+i(t)+e(t))-(mu+alpha+u[2])*e(t), diff(i(t), t) = (alpha+u[2]).e(t)-(mu+epsilon+u[2])*i(t), diff(p(t), t) = Lambda+(epsilon+u[2]).i(t)-delta*p(t), diff(lambda[1](t), t) = -lambda[1](t)*(r*(1-(2*s(t)+i(t)+e(t))/k)-beta[1]*p(t)*(1-u[2])/(a+p(t))-beta[2]*i(t)*(1-u[1])/(s(t)+i(t)+e(t)))-lambda[2](t).(beta[1]*p(t)*(1-u[2])/(a+p(t))-beta[2]*i(t)*(1-u[1])/(s(t)+i(t)+e(t))), diff(lambda[2](t), t) = -c[1]+lambda[1](t)*r*s(t)/k+lambda[2](t)*(mu+alpha+u[2])-(1-u[2]).alpha.lambda[3](t), diff(lambda[3](t), t) = -c[2]+lambda[1](t).(r*s(t)/k+beta[2]*s(t)*(1-u[1])/(s(t)+i(t)+e(t)))-lambda[2](t)*beta[2]*s(t)*(1-u[1])/(s(t)+i(t)+e(t))+lambda[3](t)*(u[2]+mu+gamma)-lambda[4](t).gamma.(1-u[2]), diff(lambda[4](t), t) = ((lambda[1](t).beta[1])*s(t).a.(1-u[2]))/(a+p(t))^2-((lambda[2](t).beta[1])*s(t).a.(1-u[2]))/(a+p(t))^2-lambda[4](t)*(delta+u[2]), s(0) = 1000, e(0) = 10, i(0) = 0, p(0) = 100, lambda[1](T) = 0, lambda[2](T) = 0, lambda[3](T) = 0, lambda[4](T);
p1 := dsolve({sys}, type = numeric, abserr = 0.1e-3, maxmesh = 2400);
Error, (in fproc) unable to store '-1.*HFloat(0.0)[1]' when datatype=float[8]
p2o := odeplot(p1, [t, i(t)], 0 .. 2, numpoints = 100, labels = ["Time (months)", " infectious "*`Maize"`], labeldirections = [horizontal, vertical], style = line, color = red, axes = boxed);
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution
 

Example of Duffing equation with boundary conditions.
y'' + 0.2y' + y^3 - 0.3cos(s) = 0;
y(0) = y (2Pi);
y'(0) = y'(2Pi);
For convenience, we replace the original equation with a system of two first order equations:
--------------------------------------------------------------------------
x1'(t) = 2*Pi*x2(t);
x2'(t) = - 0.4*Pi*x2(t) - 2*Pi*x1(t)^3 +0.6*Pi*cos(2*Pi*t);
x1(0) = x1(1);
x2(0) = x2(1);
--------------------------------------------------------------------------
I have long wanted to apply an optimization package to solve a boundary value problem for ODE. The decision helped procedure for solving ODE, written by forum member vv.
It seems to me that two solutions have been found and that the solutions are weakly sensitive to the initial approximations. These are two closed trajectories. For example, these are points that belong to these solutions:
(0.5966963,  1.0482816) , ( - 0.3132584, 0.0664941).
I am wondering: are the solutions right, and how justified is the use of optimization methods for such tasks?
At the end of the program, the solution is checked on the original Duffing equation using standard Maple functions.   Duffing_equation_BC.mw

(In the figures, the trajectory bypass occurs three times.)

For some reason when I do n mod 2, it spits out n. Im trying to figure out what is wrong. I have to evaluate at two points in order for this to work. modulo.mw

 

Thanks

 

Hello,

I have a problem in the solution of this system of ODEs:

de[1] := M*(diff(x(t), t, t))+sum(FxjR, j = 1 .. m)+sum(FxjL, j = 1 .. m) = M*g+Us*omIn^2*cos(omIn*t); ini[1] := x(10^(-6)) = 1.00013081730872*10^(-6); ini[2] := (D(x))(10^(-6)) = 0.261632327671976e-3;


de[2] := M*(diff(y(t), t, t))+sum(FyjR, j = 1 .. m)+sum(FyjL, j = 1 .. m) = Us*omIn^2*sin(omIn*t); ini[3] := y(10^(-6)) = 9.99989124246935*10^(-8); ini[4] := (D(y))(10^(-6)) = -2.50318090194868*10^(-6);


de[3] := M*(diff(z(t), t, t))+sum(FzjR, j = 1 .. m)+sum(FzjL, j = 1 .. m) = 0; ini[5] := z(10^(-6)) = 9.99065455347471*10^(-9); ini[6] := (D(z))(10^(-6)) = -0.186933812655399e-4;


de[4] := Ix*(diff(thx(t), t, t))+Iz*(diff(thy(t), t))*omIn+sum(MxjL, j = 1 .. m)-sum(MxjR, j = 1 .. m) = 0; ini[7] := thx(10^(-6)) = 8.60546055625759*10^(-7); ini[8] := (D(thx))(10^(-6)) = 1.72109307183424;


de[5] := Iy*(diff(thy(t), t, t))-Iz*(diff(thx(t), t))*omIn+sum(MyjL, j = 1 .. m)-sum(MyjR, j = 1 .. m) = 0; ini[9] := thy(10^(-6)) = 1.02142988540396*10^(-10); ini[10] := (D(thy))(10^(-6)) = 0.285764338010142e-3;
 

sys_ode := seq(de[n], n = 1 .. 5);
ICs := seq(ini[n], n = 1 .. 10);
F := dsolve([sys_ode, ICs], type = numeric, range = 10^(-6) .. 0.1);
 

Then I found this response:

Warning, cannot evaluate the solution further right of .10473416e-4, probably a singularity
F:=proc(x_rkf45) ... end proc

 

The details of the parameters inside the SUMMATION sign are very complicated and it is useless to mention them (in my point of view). Each one of (FxjR) and its similars is more than 20 Word pages, so it is useless to mention, but I can confirm that all of them include the (time and the 5 variables of ODE and their first derivatives only).

How can I solve that?
Any ideas to get rid of this singularity problem?

I am thinking of using a fixed step method, but I do not know if this will solve the problem? Also, I do not know how can I use a fixed step and what are the methods that use fixed step in maple?

Your participations are greatly appreciated! 

 

 

 

 

I am trying to write a code to calculate, for a given prime p the string length k of the repunit

R_k=1111111....1111 (with k 1s) such that the number R_kpR_k is prime.  

Example: If p=59, then k=42 is the smallest k such that R_k59R_k is prime. Note that for some primes it can be shown that no such k exists (2,11,37,101..)

I can usually figure out from the factor cycle of a “repunit wrapped” prime whether such a k exists or not. But if the indications are that a k does exist then finding it is very time consuming. Eg for p =71, 167. 

 

What i want to do, for given p is set an upper limit N for k then check to see if R_kpR_k is prime for values of k from 1 to N

The bit I can’t handle is expressing the “wrapped” number for a given p and k, and also indexing from k to k+1, until N is reached or a prime found.

Any assistance gratefully received.

Best regards

David.

 

 

 

 

 

If worksheet execution was started and computer is locked before execution ends, Maple will stop responding and all work is lost. Execution of whole worksheet takes very long time, sometimes over 3 hours, so "do not lock computer during execution" is not solving the problem.

Dear All,
Perhaps my question is basic question, but I want to know more about LPSolve
Is it possible to join 2 solutions from different LPSolve?

For example, I have 2 solutions,
Sol[1] := [72.011122301, [t[4] = -.500000000000000, t[13] = .500000000000000, x[1, 4] = 1, x[1, 13] = 0, x[4, 1] = 0, x[4, 13] = 1, x[13, 1] = 1, x[13, 4] = 0]];
Sol[2] := [53.128387340, [t[6] = -2.00000000000000, t[7] = 0., t[8] = -.999999999999999, x[1, 6] = 1, x[1, 7] = 0, x[1, 8] = 0, x[6, 1] = 0, x[6, 7] = 0, x[6, 8] = 1, x[7, 1] = 1, x[7, 6] = 0, x[7, 8] = 0, x[8, 1] = 0, x[8, 6] = 0, x[8, 7] = 1]].

What I want to achieve is following:

(1) eliminating t variable and join those solution (all values of x). Thus, I got [ x[1, 4] = 1, x[1, 13] = 0, x[4, 1] = 0, x[4, 13] = 1, x[13, 1] = 1, x[13, 4] = 0,x[1, 6] = 1, x[1, 7] = 0, x[1, 8] = 0, x[6, 1] = 0, x[6, 7] = 0, x[6, 8] = 1, x[7, 1] = 1, x[7, 6] = 0, x[7, 8] = 0, x[8, 1] = 0, x[8, 6] = 0, x[8, 7] = 1]].
(2) Extracting the value of X. I know that sol[1][2] indicates the values of right hand side. But I want to get the value of each of x in sequence.
for example: I can get x[1,2]=1, x[1,8]=0, x[7,1]=0 and so on.
In this case, Maybe I can use
eval(x[1,8],sol[1]) for specific x.
But is there any nice way to get all values of x with some procedures?
 

Thanks for reading

 

What are the most efficient way to write and evaluate a procedure in maple? Thank you.

Dear sir,

I am using the Maple to solve pde equations but I am not getting analytical solutions for some of the equations. Can you please help me on how to solve one of the pde, like as I have 

(sin(theta)^2*(diff(a(r, theta), r, r))+cos(theta)^2*(diff(a(r, theta), r))/r-sin(2*theta)*(diff(a(r, theta), theta))/r^2+sin(2*theta)*(diff(a(r, theta), theta, r))/r+cos(theta)^2*(diff(a(r, theta), theta, theta))/r^2)*`α__d`^2+cos(theta)^2*(diff(a(r, theta), r, r))+sin(theta)^2*(diff(a(r, theta), r))/r+sin(2*theta)*(diff(a(r, theta), theta))/r^2-sin(2*theta)*(diff(a(r, theta), theta, r))/r+sin(theta)^2*(diff(a(r, theta), theta, theta))/r^2 = 0

this equation is in polar corrdinates, this is analogous to diff(a(x, y), x, x)+`α__d`^2*(diff(a(x, y), y, y)) = 0

 

in cartesian coordinates

Duo:=proc(a)  #a nombre congruent connu
local u,v,n,m,k,t:
t:=8000:
for m to t do
  for n to m do
    if (igcd(m,n)=1 and m>n) then
      u:=(m^2-n^2-2*m*n)^2:v:=(m^2+n^2)^2:
      k:=op(2,sqrt(v-u))^2: # k nombre congruent réduit
        if k=a then return (m,n): break 
        elif n=t then break fi:
    fi:
  od:
od:
end:

Duo(30);
                              3, 2
Duo(1794);
                             26, 23
Duo(6);
                              2, 1
u, v, w sont des carrés en progression arithmétique dont la raison est un nombre congruent
Procédure permettant de trouver un triplet pythagoricien primitif correspondant au nombre congruent a connu
TriPy:=proc(m,n)# triangles pythagoriciens
local a,a1,b1,c1,d,k,q,u,v,w:
 if (igcd(m,n)=1 and m>n) then
 u:=(m^2-n^2-2*m*n)^2:v:=(m^2+n^2)^2:w:=(m^2-n^2+2*m*n)^2:
 a:=(op(2,sqrt(v-u)))^2:#nombre congruent réduit
 a1:=2*m*n:b1:=(m^2-n^2):c1:=m^2+n^2:
 q:=sqrt((v-u)/a)/2:#rapport de réduction
 print(a1/q,b1/q,c1/q):fi
end:
TriPy(Duo(34));
                              17  145
                          24, --, ---
                              6    6 

TriPy(Duo(39));
                          156  5  313
                          ---, -, ---
                           5   2  10 

TriPy(Duo(111));
                         444  35  1513
                         ---, --, ----
                         35   2    70 
TriPy(Duo(1794));
                         1196      1205
                         ----, 21, ----
                          7         7  
TriPy(Duo(23));don't work, "part dans les choux"

Hi, how can you in maple take the derivitve of a function that consists of sum terms in it? (preferable in document mode)

For example I have this expression (from a math book):

f = N+k*(sum(ln(x__i-B), i = 1 .. N))-N*k*(sum((x__i-B)^k*ln(x__i-B), i = 1 .. N))/(sum((x__i-B)^k, i = 1 .. N))

What I then want to do is to derive this function with respect to k.
However just writing the expression like above it seems like mable doesn't keep the summation terms but evaluates them in a sense. So not sure how to set it up correctly in order to make the derivitive.

Taking the derivitive of f with respect to k, the solution should give something like this:

 

 

3 4 5 6 7 8 9 Last Page 5 of 1723