## How to solve ODE reptitive...

Dear power users, I am still struggling with relative simple tasks and do hope that some of you can help me in the right direction. Solving an ODE is straightforward in Maple. But how do you solve an ODE with multiple inputs, as shown in the attached worksheet. I would appreciate any help with respect to my question. I would also like to wish all of you a good ending of 2023 and a brilliant start in 2024.

MapleprimesODE_Question.mw

## How do I get an absolute value of an exponential? ...

Hi, will happy to find out how can I get the proper answer for the expression following:

abs(exp(I*k*x))?

I expected to get 1

Bu actually I've got

e^R(Ikx)

Futhermore, Maple also doesn't calculate any absolute values of complex expressions, only adds the brackets.

## How do I control the stacking order of plot struct...

For example, I would like to draw the following figure in Maple.

(The above figure is taken from MatLab's documentation.)
Here are these four graphics objects:

```use plottools, ColorTools in
l0, l1 := line~([<1 | 0>, <1 | 1>], [<6 | 5>, <6 | 6>], 'color' =~ Color~(["#0072BD", "#D95319"]))[];
r0, r1 := rectangle~([[2, 0], [4, 0]], [[3, 6], [5, 6]], 'color' =~ Color~([[.6, .7, .9], [.95, .7, .6]]))[]
end:```

However, either

``plots/display`([r1, l1, l0, r0], 'axes' = "boxed", 'size' = ["default", "golden"], 'style' = "patchnogrid")`

or

``plots/display`([r0, l0, l1, r1], 'axes' = "boxed", 'size' = ["default", "golden"], 'style' = "patchnogrid")`

outputs the same graphical image where the lines are always rendered on top of each rectangles instead of the other way around.

So how to superimpose the right rectangle over the two lines? To put it differently, how to handle the graphics hierarchy? I have read some similar questions like Order in plots:-display - MaplePrimes, yet I cannot find any workarounds.

Note that in my opinion, the result should comprise two unbroken line segments rather than four subordinate line segments!

## why can't Maple solve these two linear equations?...

is it possible to find why Maple fails to solve these two equations in two unknowns? Has this always been the case? I do not have older versions of Maple to check. The trace shows that it found solution but then itg says no solution was found. This is very strange.

 > interface(version)

 > Physics:-Version()

 > restart;

 > sol:=1/4*exp(-t) * (c2*(-1+exp(4*t)) + c1*(3+exp(4*t))): expand(simplify(sol));

 > eq1:=-3=eval(sol,t=4): expand(simplify(eq1));

 > eq1:=-17=eval(diff(sol,t),t=4); expand(simplify(eq1));

 > infolevel[solve]:=5; solve([eq1,eq2],[c1,c2])

Main: Entering solver with 2 equations in 2 variables

Main: attempting to solve as a linear system

Linear: solving 2 linear equations

Algebraic: # equations is: 2

Main: Linear solver successful. Exiting solver returning 1 solution

solve: Warning: no solutions found

For reference this is the solution given by Mathematica

## tricky ode with IC. Why this verification fail?...

Maple does not give solution to this first order ode with IC, if asked to do it implicit. It only solves it explicit.

```ode := diff(y(x), x) - 2*(2*y(x) - x)/(x + y(x)) = 0;
ic:=y(0)=2;
dsolve([ode,ic],'implicit'); #maple gives no solution when implicit!```

Then I asked Maple for an implicit solution but with no IC. Then solved for the constant of integration myself, and plugged this back in the solution. But odetest now says the initial conditions do not verify.

Here are the steps I did to solve for the constant of integration. I do not see any error I made. Does any one see where my error is and why odetest does not verify the solution for IC?

This first order ode has unique solution. Here is my worksheet.

 > restart;

 > ode := diff(y(x), x) - 2*(2*y(x) - x)/(x + y(x)) = 0; ic:=y(0)=2; dsolve([ode,ic],'implicit'); #maple gives no solution when implicit!

 > #lets now try finding the constant of integration ourself sol:=dsolve(ode,'implicit')

 > #setup equation and plugin the IC. Raise both sides to exp. RHS becomes 1 eq:=exp(lhs(sol))=1;

 > simplify(eq,exp);

 > #plugin in y=2 at x=0 eval(%,[y(x)=2,x=0]);

 > #solve for constant of integration solve(%,c__1)

 > #subtitute back in the solution sol:=eval(sol,c__1=%);

 > #verify. Why it failed check on IC?? Notice it is not [0,0]. odetest(sol,[ode,ic])

 >

## how many activation one is allowed for Maple?...

I bought Maple 2023 student version. (I am student) and installed it on windows 10.

I wanted to try it on Linux to see if runs better. So Installed the Linux version. When I tried to activate using the same purchase code I got, I get error that I have no more activations or I exceeded the number of activations.

But I installed Maple 2023 only one time, on windows which is my main OS. Never installed it anywhere else before.

Is one really only allowed one installation?

How would then I can try Maple on Linux but keep my Maple on windows until I decide if Maple works better on Linux or not?

## Fourier transform...

Hello everyone,

Please, I need your help. I want to plot the spectrum of a dataset in #Problem 1.

In #Problem 2 If it is possible, how can I convert that function from the time domain to the frequency domain?

Thank you

Fourier_transform.mw

## GF input() accepts out-of-range input...

I think the GF function, input, accepts out-of-range inputs.

From ?GF: The G:-input and G:-output commands convert from an integer in the range
"0 .. p^k - 1" to the corresponding polynomial and back

GF_strange.mw

The first GF was from a typo. I think it should have produced an error message, according to help.
If I understand correctly, GF(7,1) should only have 7 members.
The second GF is to allow the input 28856.

Tom Dean

## why is Maple not able to find solution to this fir...

This first order ode is quadrature with initial conditions. By existence theorem it has solution and is unique on some interval that includes the initial conditions (because f and f_y  are continuous on the initial condition).

But for some reason Maple can't find the solution, unless one adds 'implicit' option. Why is that? I thought that Maple will automatically return implicit solution if can't find explicit solution.

So does one then needs to try with implicit solution again if no solution is returned? I am basically asking if this is expected behavior of dsolve.

Below is worksheet also with the solution that Maple verifies is valid and satisfies the ode and also initial conditions.

```ode:=diff(y(x), x) = sin(y(x)) + 1;
ic:=y(0)=Pi;
sol:=dsolve([ode,ic]);

```

 > interface(version);

 > Physics:-Version();

 > restart;

 > ode:=diff(y(x), x) = sin(y(x)) + 1; ic:=y(0)=Pi; sol:=dsolve([ode,ic]);

 > maple_sol:=dsolve([ode,ic],'implicit'); odetest(maple_sol,[ode,ic])

 > maple_sol:=dsolve([ode,ic],y(x),'explicit');

 > mysol:=y(x)=2*arccos(-x/(sqrt(4+4*x+2*x^2))); odetest(mysol,[ode,ic]) assuming x>=0

 >

## strange result from solve. ...

Why does

```restart;
eq:=Z^2=y/x;
solve(eq,Z)
```

give

I never told maple that y>=0 and x>=0 ?   I was expecting what we will do by hand. which is

Note that sqrt(x*y) is same as sqrt(x)*sqrt(y) only when y and x are not negative.

Is there an option to make Maple not do this and give same result as above? I tried PDEtools:-Solve and it gives same solution as solve.

Maple 2023.2.1 on windows 10

## Worksheet Loses Contact with Kernel...

This worksheet loses contact with the kernel. I asked Tech Support. How do I report a bug?

Hung.mw

The last line was a typo, but, it should not lose contact with the kernel...

After executing the print statement,

> 1

produces the error message.

Tom Dean

## Better (real) solutions to an equation involving t...

For example, here are two equations containing trigonometric functions (Note that they do not form one system!):

```restart; # There are more examples, yet for the sake of briefness, they are omitted here.
eqn__0 := cos(x)*cos(y)*cos(x + y) = 2*(sin(x)*sin(y) - 1)*2*(sin(x)*sin(x + y) - 1)*2*(sin(y)*sin(x + y) - 1):
eqn__1 := (cos(x + y) - (cos(x) + cos(y)) + 1)**2 + 2*cos(x)*cos(y)*cos(x + y) = 0:```

Unfortunately, none of

```(* Tag０ *) RealDomain:-solve(eqn__0, {y, x}):
(* Tag１ *) solve(eqn__0, {y, x}) assuming y + x >= 0, (y, x) <=~ Pi:
(* Tag２ *) RealDomain:-solve(eqn__1, {y, x}):
(* Tag３ *) solve(eqn__1, {y, x}) assuming y + x >= 0, (y, x) <=~ Pi:```

outputs concise solutions.
Using `plot3d`, it is easy to check that when "And(y + x >= 0, (y, x) <=~ Pi)", “{y = Pi/2, x = 0}, {y = Pi/3, x = Pi/3}, {y = 0, x = Pi/2}, {y = Pi/2, x = Pi/2}” is both the only solution to "eqn__0" and the only solution to "eqn__1". But how to get Maple to do so without manual intervention?

Edit. The main purpose is to automatically find the generic solutions to each of the two equations (Tag０ and Tag２) (separately). Now that the cosine and sine functions are both periodic with period 2π and both (lhs - rhs)(eqn__0) and (lhs - rhs)(eqn__1) are even symmetric, it is enough to focus only on the region y + x ≥ 0 ∧ (y, x) ≤~ Pi. So, in theory, a second-best workaround should be Tag１ and Tag３. However, why is Maple still unable to find the four exact solutions above?

## Error, (in trig/reduce) too many levels of recursi...

This could be new bug in 2023.2.1, could someone else confirm if it is in earlier versions 2023.2 ?

```restart;
ode:=diff(y(x),x)-y(x)^2-m*y(x)*cot(x)-b^2*sin(x)^(2*m) = 0;
DEtools:-symgen(ode)
```

Error, (in trig/reduce) too many levels of recursion

I tried it in Maple 2022.2  I waited for more than 10 minutes and it was still running.  If you think it is new bug, will send email to Maple support.

The big problem with these Maple internal errors, is that it is not possible to trap them with try/catch. So the program simply crashes and there is no workaround.

 > restart;

 > interface(version)

 > Physics:-Version()

 > ode:=diff(y(x),x)-y(x)^2-m*y(x)*cot(x)-b^2*sin(x)^(2*m) = 0;

 > DEtools:-symgen(ode);

Error, (in tools/map) too many levels of recursion

 >

reported to Maple support

## How do I correct 'in plots / implicitplot / factor...

I have been trying to run a code to plot a region of stability for a numerical method for solving IVPs. Apart from the fact that it is taking time to run, it is giving me errors: 'Error; (inplots/ implicitplot/factor) and  Error; (inplot/ iplot2d:-Levels ) could not evaluate expression'

Attached here is the code:

 K=4 with(LinearAlgebra): P1 := simplify(A1-ScalarMultiply(A3, z)-ScalarMultiply(A5, z^3)):

## Is "q-hypergeometric function" implemented in Mapl...

The help page mentions:

The package supports five q-hypergeometric terms. They are q-Pochhammer symbol, q-binomial coefficient, q-brackets, q-factorial, and q-Gamma, which correspond to the five functions , , , , and .

But what about the so-called q-hypergeometric function? Though there exist `QDifferenceEquations:-IsQHypergeometricTerm` and `QDifferenceEquations:-QHypergeometricSolution` in Maple, they do not seem to represent the function itself
For example, how to type the q-Gauss sum (cf. DLMF's §17.6(i)) or verify the last “simple series expression” given in Basic hypergeometric series - Wikipedia? In Mma, one may achieve these with something like

while

```convert("QHypergeometricPFQ[{a, b}, {c}, q, c/(a b)]", 'FromMma', 'evaluate');
=
/                 c \
QHypergeometricPFQ|[a, b], [c], q, ---|
\                a b/

```

So has the q-hypergeometric function been implemented in Maple?

 4 5 6 7 8 9 10 Last Page 6 of 27
﻿