Maple 2023 Questions and Posts

These are Posts and Questions associated with the product, Maple 2023

Hello. Can anybody point out to me what I am doing wrong below? I'm trying to solve the online model 4.1 of the book "An introduction to infectious disease modelling" by E. Vynnycky & R.G. White (2010). But all the information is below. 

Where I get errors from the code below is right at the bottom, in dsolve:

# My Maple 2023 code:

restart;

# Initial values:

Sus_0 := total_popn - Infectious_0 - Immune_0:
Preinfectious_0 := 0:
Infectious_0 := 1:
Immune_0 := total_popn*prop_immune_0:

# Transmission- and infection-related parameters:

preinfectious_period := 8:
infectious_period := 7:
R_zero := 13:
f := 1/preinfectious_period:
r := 1/infectious_period:
beta := R_zero/(total_popn*infectious_period):
prop_immune_0 := 0:

# Demography-related parameters:

total_popn := 100000:

# Useful statistics:

new_infns := beta*Susc*Infe:
new_infectious := Prei*f:
prop_sus = Susc/total_popn:
R_n := R_zero*prop_sus:
propn_imm := 1 - prop_sus:
sum_pop := Susc + Prei + Infe + Immu:
ln_infectious := ln(Infe):
ln_cum_infe := ln(Cum_Infe):
ln_new_infectious := ifelse(0 < t, ln(new_infectious), 0):

# Defining the system of ODEs:

sys_ode:={
diff(Susc(t),t)=-beta*Susc(t)*Infe(t), 
diff(Prei(t),t)=beta*Susc(t)*Infe(t)- Prei(t)*f, 
diff(Immu(t),t)=Infe(t)*r, 
diff(Cum_Infe(t),t)= Prei(t)*f, 
diff(Infe(t),t)=Prei(t)*f-Infe(t)*r,
}:

ics:={
Susc(0)=Sus_0,
Infe(0)=Infectious_0,
Immu(0)=Immune_0,
Prei(0)=Preinfectious_0,
Cum_Infe(0)=Infectious_0
}:

Solution1:=dsolve({sys_ode,ics},type=numeric);
# HERE I GET THIS ERROR MESSAGE: "Error, (in dsolve/numeric/process_input) system must be entered as a set/list of

# expressions/equations"

 

Solution2:=dsolve({sys_ode,ics});
# HERE I GET THIS ERROR MESSAGE: "Error, (in dsolve) invalid arguments; expected an equation, or a set or list of them,

# received: {{diff(Immu(t),t) = 1/7*Infe(t), diff(Infe(t),t) = # 1/8*Prei(t)-1/7*Infe(t), diff(Prei(t),t) =

# 13/700000*Susc(t)*Infe(t)-1/8*Prei(t), diff(Susc(t),t) = -13/700000*Susc(t)*Infe(t), diff(Cum_Infe(t),t) = # 1/8*Prei(t)}}"

 

MY QUESTION: Can anybody tell me what I'm doing wrong in Solution1 and Solution2?

Best wishes and many thanks!

 

 

Ubuntu 22.04.

I have Maple-202[1-3] and an old installation of maplev-mode. maplev-mode fails to work.

In the emacs messages buffer, I see (typed from memory):

loading maple
maple loaded
maple not running

I removed all of maplev from my system.
I tried installing from the downloaded master.zip (RELEASE-=NOTES says 3.0.5).
make install fails:

> pwd
/tmp/maplev-master
> make install
Makefile:27: MapleLisp.mk: No such file or directory
make: *** No rule to make target 'MapleLisp.mk'.  Stop.

I tried installing from the cloud, but, failed. The error message (even run as root)

Error, (in PackageTools:-Install) permission denied

Will maplev-mode work?

Tom Dean

the maple document is  p151.mw

Hi everyone, I'm trying to do some simple algebraic simplification operations and run into algsubs replacement failures,

 the symbol σ' is typed in this way:  σ +  prime (left Palettes -> Common Symbols -> prime) + (selecting σ'  and  press  Ctrl+Shift+A  make it  a  atomic variable) 

I'm new to this, any help or suggestion is welcome, thanks! 

Good day to all of you friends, just asking for your kind help.

I have been trying to get solution of the next integral but didn't have succes. The goal of the code is to perfom a variable change.

Best regards

restart

r := simplify(rhs(isolate(r+(2*M*`r__\`+\``+a*m/sigma)*log[10](r/`r__\`+\``-1)/(`r__\`+\``-`r__-`)-(2*M*`r__-`+a*m/sigma)*log[10](r/`r__-`-1)/(`r__\`+\``-`r__-`) = `r__&lowast;`, r)))

Delta := -2*M*r+a^2+r^2

omega := sqrt(r^2+a^2+a*m/sigma)NULL

F := simplify(Delta*lambda*m__p/(2*m__p^2*omega^2*r^2*sigma+2*lambda^2*omega^2*sigma))

`r__&prop;` := int(F, `r__&lowast;`)

NULL

Download maple_primes_question.mw

Hello

I would like to compare the digits of two natural numbers p and q first. Then I would like to omit in p and q the digits which they have in common.

Example: p=2345, q=1536

the common digits are 3 and 5. omitted them in both numbers, it will result p'=24 and q'=16.

Thanks for your help!

Hello
i am using maple 2023 and the physics package and have the following question:
I want to define a gauge-  plus coordinate covariant derivative i.e.
assuming i,j,k are SO(3) indices and greek indices describe 4-dim space-time (not necessary flat)
i need the following derivative:

D_sigma F_i _rho _lambda = nabla_sigma F_i _rho _lambda + epsilon_i ^j ^k  A_j_sigma  F_k~rho~lambda
with _ meaning lower indices and ^ upper indices and nabla the convenient coordinate covariant derivative of general relativity.
F is a tensor objekt with 2 space time indices and 1 so(3) indices (e.g. Yang Mills field strength) and A is the so(3)gauge potential
How can i define this Differentialoperator with the physics package.
I.e. i want to work with SO(3) Yang-Mills Fields in curved space time and need this generalized Differentialoperator
thanks for helping. I hope its clear from this ascii text in the screen
regards Michael

restart;

Here we have a pretty well-behaved trig function:

y := t -> 144*cos(t)^6 - 216*cos(t)^4 + 32*cos(t)^3 + 81*cos(t)^2 - 24*cos(t) + 17;

proc (t) options operator, arrow; 144*cos(t)^6-216*cos(t)^4+32*cos(t)^3+81*cos(t)^2-24*cos(t)+17 end proc

plot(y(t), t=0..2*Pi, view=0..35);

Maple 2023 plots y^(3/2) with a strange artifact at t = Pi:

plot(y(t)^(3/2), t=0..2*Pi, view=0..200);

Any reason for that?  Maple 2021 and earlier used to produce the correct plot:

  

Download bug-in-plot.mw

Using textplot  is there anything that can be done to to increase the offest of alignI would like to raise  P3 at top of graph up a bit and S3 down. they are {centre, above} and {centre,below}. I know I can tie them to a different point  coordinate to begin with but that is messy to control inside a procedure.

Can I link my MapleCloud application to the Application Center?

Several years ago I uploaded an installable workbook application for Clifford Algebra to the public maplecloud following the guidelines and formats set down in maple help. My intention was to make the application available in the application center, but I just noticed that a package uploaded to MapleCloud is not  available for searching in the Application Center. Unfortunately,the Maple Cloud site for public packages is a mess. One cannot readily browse the applications there like in the application center.

The submissions page for the application center is not helpful in this case. It seems to assume submissions will take the form of maple documents/ worksheets rather than applications written in a workbook). I could not navigate to the Maple Cloud to drop a link to my package using the submission form, but it should be possible to link the the package already installed on the MapleCloud to the Cloud? (Because I is easier to update the MapleCloud package and it can be installed by opening from the Cloud).

Hi there,

I would like this code to display all 4 roots of this equation. I have graphed it in Desmos, so I know it intersects the X-axis in 4 places (the two positive ones representing the subsonic and supersonic Mach number, the negative ones are not needed). However, Maple only shows the subsonic positive and negative values and says that there may be missing solutions. Code and results are provided at the bottom.

I would appreciate any guidance on this issue or with solving this particular equation.

Thank you,

Jack

Download Equation_1_Worksheet.mw

g := 1.402

1.402

(1)

a := .660416443

.660416443

(2)

b := .112815378

.112815378

(3)

eq1 := 0 = (2*(1+((g-1)*(1/2))*m^2)/(g+1))^((g+1)/(g-1))/m^2-(a/b)^2

0 = (.8326394672+.1673605329*m^2)^5.975124378/m^2-34.26881996

(4)

``

solution := solve({eq1}, {m})``

{m = -0.9942282680e-1}, {m = 0.9942282680e-1}

(5)

NULL

Applying Maple 2023's dsolve to the ODE shown below yields the solution y(t)=0 which is obviously incorrect.  Maple 2021 and earlier used to give a nonzero (albeit not very useful) answer.

restart;

F := (t-1)*(t-2)/(t^2+1)^3*(Heaviside(t-2)-Heaviside(t-1));

(t-1)*(t-2)*(Heaviside(t-2)-Heaviside(t-1))/(t^2+1)^3

plot(F, t=0..4);

de := diff(y(t),t,t) + diff(y(t),t) = F;

diff(diff(y(t), t), t)+diff(y(t), t) = (t-1)*(t-2)*(Heaviside(t-2)-Heaviside(t-1))/(t^2+1)^3

ic := y(0)=0, D(y)(0)=0;

y(0) = 0, (D(y))(0) = 0

Huh?

dsolve({de,ic}, y(t));

y(t) = 0

Specifying method=laplace will make that work, but how is an

unsuspecting user to know that what's obtained above is incorrect?

Download dsolve-bug.mw

many times I have an expression with constant of integrations in it and need to integrate., So need to make sure to add a new constant of integration which is not already used.

Currently I do this

restart;
sol:=x-_C1*x+_C3*x^2;
myconstants:=indets(sol,And(symbol, suffixed(_C, nonnegint)));
map(X->String(X),myconstants);
map(X->X[3..],%);
map(X->:-parse(X),%);
n:=max(%);
new_constant:=_C||(n+1);

This make _C4 as the new constant. 

This assumes all constants have form _Cn which is what I use. It finds all _Cn's then converts each to string, then remove _C part from the string leaving the number, then find the maximum one and adds 1 to it to generate new constant to use,

Is there a better way to do this? Even though the above works, I have feeling there might be better way.

I would like to get a (necessary and sufficient) condition on real parameters a, b, and c for which there exists (at least) one non-negative solution to 9*x**4 + c < 9*a*(x - 1) + 3*b*(x**2 - 1) + c*x**3
A convenient way to formulate this is using quantifiers. Unfortunately, if I run 

QuantifierElimination:-QuantifierEliminate(:-exists([x],:-And(x>=0,9*x^4+c<9*a*(x-1)+3*b*(x^2-1)+c*x^3)));

Maple will simply output 

Error, (in RootFinding:-RSGateway:-refine_uni_tri) invalid input: RootFinding:-RSGateway:-try_refine_iso_tri expects its 1st argument, box, to be of type nonemptylist([rational, rational]), but received [8019*x^2+(-9*v__2^2-96552*v__2-279834912)*x+49*v__2^3+78318*v__2^2-387436932*v__2+121801800168, v__2^4+2052*v__2^3-5536296*v__2^2+3575222064*v__2-710903793888]

As an alternative method, one can execute 

RealDomain:-solve([x >= 0, 9*x**4 + c < 9*a*(x - 1) + 3*b*(x**2 - 1) + c*x**3], 'parameters' = {a, b, c});
Warning,  computation interrupted

Regretfully, this time the computation is not done in several minutes (so one may have to abort it manually). 

So, what is the proper approach to the above problem in Maple (without any a priori knowledge, if possible)?

For instance, considering the expression  ≔ exp(1+LambertW(0,x))*(exp(1)*x+log[exp(1)](sqrt(2*Pi))-lnGAMMA(1/2+exp(1+LambertW(0,x))))

restart;
expr := exp(1+LambertW(x))*(exp(1)*x+ln(sqrt(2*Pi))-lnGAMMA(1/2+exp(1+LambertW(x)))) assuming x >= -1/exp(1):

The following limit can be calculated directly: 

1/:-limit(expr, x = +infinity, 'left');
                               24

We can also evaluate , 

:-limit(1/expr, x = +infinity, 'left'); # MultiSeries:-limit also returns wrong result. 
                               0

However, according to plot([1/(exp(1+LambertW(x))*(exp(1)*x+ln(sqrt(2*Pi))-lnGAMMA(1/2+exp(1+LambertW(x))))), 24], x = -1/exp(1) .. +exp(Pi), 'legend' = [1/expr, 24]), the limit value 0 cannot be correct. 
So is this a bug? (And has this been fixed in the forthcoming version?)

Do you think this is a bug? I do not understand solve output. Will send to Maplesoft just in case.

It happens also on Maple 2022. Does it give same result on earlier versions?

2312

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1672 and is the same as the version installed in this computer, created 2024, February 7, 18:34 hours Pacific Time.`

eq:=1 = exp(-4-c1)/(-exp(-2*c1-8)/LambertW(-exp(-2*c1-8)))^(1/2);
solve(eq,c1)

1 = exp(-4-c1)/(-exp(-2*c1-8)/LambertW(-exp(-2*c1-8)))^(1/2)

-4-(1/2)*ln(_S000003)

PDEtools:-Solve(eq,c1)

c1 = -7/2

Download strange_output_from_solve_feb_17_2024.mw

1 2 3 4 5 6 7 Last Page 2 of 26