Maple 2020 Questions and Posts

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

Maple seems to give me very inaccurate results for this computation, I'm wondering if this is a known issue and if there's a way to fix it? Worksheet:

Exact commands I ran:
with(combinat):
B := (n, i, p) -> binomial(n, i)*(p^i)*(1-p)^(n-i)/i;

F:=(n,p)->sum(B(n,i,p),i=1..n);
F(2,1);

This outputs 0, when it should output 1/2. See image attached:

 

Is there a fix for this?

this is my model. Please give me how to find the DFE and basic reproduction number from maple.

please help me to fixed and find the analytic solution...

restart

with(linalg)

f1 := mu[1]*N-delta*r-beta*N*s(e+i)

mu[1]*N-delta*r-beta*N*s(e+i)

(1)

f2 := beta*N*s(e+i)+omega*v-(mu[1]+pi+gamma)*e

beta*N*s(e+i)+omega*v-(mu[1]+pi+gamma)*e

(2)

``

f3 := pi*e-(mu[1]+mu[2]+sigma)*i

pi*e-(mu[1]+mu[2]+sigma)*i

(3)

f4 := gamma*e+sigma*i-(theta+mu[1]+mu[2])*q

gamma*e+sigma*i-(theta+mu[1]+mu[2])*q

(4)

f5 := theta*q+xi*v-(mu[1]+delta)*r

theta*q+xi*v-(mu[1]+delta)*r

(5)

f6 := eta*N*s-(mu[1]+omega+xi)*v

eta*N*s-(mu[1]+omega+xi)*v

(6)

T := solve({f1, f2, f3, f4, f5, f6}, [s, e, i, q, r, v])

Error, (in solve) cannot solve for an unknown function with other operations in its arguments

 

``

Download cobacoba.mw

How I can solve this, because I can't find the solutions. The display show "Length of output exceeds limit of 1000000"

Please help me.. 

This is my model on picture

The command

plot(x^(1/3), x = -10 .. 10)

plots only the points where x>=0, as for negative values of x the cubic root retuns only the complex root.

Ca can I modify it so that it returns only the real root, so that the whole plot can be viewed?

For a project I need to construct a large symbolic adjoint matrix, hoping it can be factored afterward into nice expressions.
In the worksheet, I present an adjoint matrix using permuted Hadamard products. What puzzles me is that only for even dimensions, I need to multiply it (elementwise) with a parity matrix. Okay, not a specific Maple question, but maybe someone can help me out.

Download Adjoint.mw

How to fix the error?

How are they (tanh(a+b) , tanh(a-b)) defined in Maple?

Ger.mw

How I can solve a PDE on two regions with matching conditions at the common boundary?  

T1.mw

The uploaded worksheet begins to uniformly tile the Poincare disk with pentagons using hyperbolic reflection .

Although relatively easy to create the central pentagon and the first adjacent pentagon, it becomes increasingly difficult to determine which lines to reflect to create the remaining pentagons in the first tier adjacent to the central pentagon and more so to create the pentagons of the second tier adjacent to those in the first tier and so on.

Is there a better technique for accomplishing this?

In particular can Mobius tranformations be employed to do this? If so, please replay with or point to a working example of this for me to follow.

 Tile_Poincare_disk.mw

Sorry, I forgot that respondents to this question must establich their own link to the DirectSearch package.

Hello
I have a problem in writing the Maple code of the image below, I don't know why the 3.5 answers are not available?

which one is better?

123.mw

0123.mw

Why aren't all the variables in fin 1 equation?

And the answers are different from the solutions?

 

restart

with(student)

eq1 := 12*gamma^3*rho[3]^2*(diff(w(psi), `$`(psi, 2)))+(-3*gamma*rho[2]^2+4*omega*rho[3]^2)*w(psi)+gamma*rho[3]^2*(rho[1]+2*rho[3])*w(psi)^3

12*gamma^3*rho[3]^2*(diff(diff(w(psi), psi), psi))+(-3*gamma*rho[2]^2+4*omega*rho[3]^2)*w(psi)+gamma*rho[3]^2*(rho[1]+2*rho[3])*w(psi)^3

(1)

NULL

"w(psi):=kappa[0]+sum(kappa[i]*((diff(E,psi))^(i))/((E(psi))^(i)),i=1..1)+sum(h[i]*(((diff(E,psi))^())/((E(psi))^()))^(-i),i=1..1);"

proc (psi) options operator, arrow, function_assign; kappa[0]+sum(kappa[i]*(diff(E, psi))^i/E(psi)^i, i = 1 .. 1)+sum(h[i]*((diff(E, psi))/E(psi))^(-i), i = 1 .. 1) end proc

(2)

"E(psi):=((epsilon[1]*jacobiCN(Zeta[1]*psi))+(epsilon[2]*jacobiSN(Zeta[2]*psi)))/((epsilon[3]*jacobiCN(Zeta[3]*psi))+(epsilon[4]*jacobiSN(Zeta[4]*psi))) ;"

proc (psi) options operator, arrow, function_assign; (varepsilon[1]*jacobiCN(Zeta[1]*psi)+varepsilon[2]*jacobiSN(Zeta[2]*psi))/(varepsilon[3]*jacobiCN(Zeta[3]*psi)+varepsilon[4]*jacobiSN(Zeta[4]*psi)) end proc

(3)

 

NULL

fin1 := simplify(eq1)

kappa[0]*(gamma*rho[3]^2*(rho[1]+2*rho[3])*kappa[0]^2-3*gamma*rho[2]^2+4*omega*rho[3]^2)

(4)

Sol := solve(fin1, {omega, Zeta[1], Zeta[2], Zeta[3], Zeta[4], epsilon[1], epsilon[2], epsilon[3], epsilon[4], h[1], kappa[0], kappa[1]})

{omega = omega, Zeta[1] = Zeta[1], Zeta[2] = Zeta[2], Zeta[3] = Zeta[3], Zeta[4] = Zeta[4], h[1] = h[1], kappa[0] = 0, kappa[1] = kappa[1], varepsilon[1] = varepsilon[1], varepsilon[2] = varepsilon[2], varepsilon[3] = varepsilon[3], varepsilon[4] = varepsilon[4]}, {omega = -(1/4)*gamma*(kappa[0]^2*rho[1]*rho[3]^2+2*kappa[0]^2*rho[3]^3-3*rho[2]^2)/rho[3]^2, Zeta[1] = Zeta[1], Zeta[2] = Zeta[2], Zeta[3] = Zeta[3], Zeta[4] = Zeta[4], h[1] = h[1], kappa[0] = kappa[0], kappa[1] = kappa[1], varepsilon[1] = varepsilon[1], varepsilon[2] = varepsilon[2], varepsilon[3] = varepsilon[3], varepsilon[4] = varepsilon[4]}

(5)

for i to 2 do Case[i] := allvalues(Sol[i]) end do

{omega = omega, Zeta[1] = Zeta[1], Zeta[2] = Zeta[2], Zeta[3] = Zeta[3], Zeta[4] = Zeta[4], h[1] = h[1], kappa[0] = 0, kappa[1] = kappa[1], varepsilon[1] = varepsilon[1], varepsilon[2] = varepsilon[2], varepsilon[3] = varepsilon[3], varepsilon[4] = varepsilon[4]}

 

{omega = -(1/4)*gamma*(kappa[0]^2*rho[1]*rho[3]^2+2*kappa[0]^2*rho[3]^3-3*rho[2]^2)/rho[3]^2, Zeta[1] = Zeta[1], Zeta[2] = Zeta[2], Zeta[3] = Zeta[3], Zeta[4] = Zeta[4], h[1] = h[1], kappa[0] = kappa[0], kappa[1] = kappa[1], varepsilon[1] = varepsilon[1], varepsilon[2] = varepsilon[2], varepsilon[3] = varepsilon[3], varepsilon[4] = varepsilon[4]}

(6)

NULL

NULL

Download 0123.mw

So I have a complex-valued function f that depends on two real variables x and y. I want to plot its range, i.e. the set of all values f(x,y), where x and y vary over their entire domain (which is a compact subset of R^2). Since I did not find of a direct way to do this, I decided to just compute the output f(x,y) at a finite set of points and plot these values in the complex plane. This gives me a rough idea of what the range should look like. However, this process is very slow (even though it should not be that slow, in my opinion). Here is the code I have used:

f := x -> exp(2*I*Pi*x);
S1 := (x, y) -> Matrix(3, 3, [[f(x - y), 0, 0], [0, 1, 0], [0, 0, f(-y)]]);
S2 := (x, y) -> Matrix(3, 3, [[f(y), 0, 0], [0, f(y - x), 0], [0, 0, 1]]);
C := Typesetting[delayDotProduct](1/sqrt(3), Matrix(3, 3, [[1, 1, 1], [1, f(1/3), f(2/3)], [1, f(2/3), f(1/3)]]), true);
with(LinearAlgebra);
d := LinearAlgebra[Determinant](C . C);
V := (x, y) -> (((S1(x, y)/d^(1/3)) . C) . (S2(x, y))) . C;
tracevals := [];

for i from 0 to 100 do
    for j from 0 to 100 do tracevals := [op(tracevals), Trace(V(0.01*i, 0.01*j))]; end do;
end do;
with(plots);
P2 := complexplot(tracevals, x = -2 .. 3, y = -3 .. 3);

Note that the specific example (i.e. plotting the trace of a unitary matrix V(x,y)) is not really important to this question. We could instead think of any complex-valued function f(x,y), it should not have any impact on the problem. Maple generates the following output:

Even though this output shows quite well the range that the function will take, it takes almost two minutes to generate. Is there a quicker or more elegant way to compute the range of a function?

I am working with a family of unitary matrices, that depend on two parameters x and y in a smooth way. Their eigenvalues are thus complex numbers of absolute value 1. My goal is to plot the bands (i.e. the argument of the eigenvalues). I know that there exists a parametrization of the eigenvalues such that the corresponding bands are continuous. In particular, I use the following code:

f := x -> exp(2*I*Pi*x);
S1 := (x, y) -> Matrix(3, 3, [[f(x - y), 0, 0], [0, 1, 0], [0, 0, f(-y)]]);
S2 := (x, y) -> Matrix(3, 3, [[f(y), 0, 0], [0, f(y - x), 0], [0, 0, 1]]);
C := Typesetting[delayDotProduct](1/sqrt(3), Matrix(3, 3, [[1, 1, 1], [1, f(1/3), f(2/3)], [1, f(2/3), f(1/3)]]), true);
d := LinearAlgebra[Determinant](C . C);
V := (x, y) -> (((S1(x, y)/d^(1/3)) . C) . (S2(x, y))) . C;
with(LinearAlgebra);
bands := (x, y) -> -I*ln~(Eigenvalues(V(x, y)));

with(plots);
plot3d({bands(x, y)[1], bands(x, y)[2], bands(x, y)[3]}, x = 0 .. 1, y = 0 .. 1);

However, the output is the following plot:

One can see that the bands can technically be chosen in a way such that they are continuous and we dont have those weird vertical jumps. Is there a way to make Maple choose them like this? Or is there a way to at least surpress these vertical jumps in the plot, so that the plot is a bit more ordered? Ideally I would like a way that works for more examples than the one I gave above (I'd like to do these plots for different matrices C), but any help is appreciated!

 

Edit: Maybe an easier starting point is the following: If I choose the matrix C to be the identity matrix, the bands are of a nicer form:

We can see that Maple parametrizes the bands in a continuous way. The only problem is the vertical jumps that happen when the argument switches from pi to -pi. Is there a way to avoid plotting these jumps, so the plot does not include these vertical lines?

The worksheet below includes a sample use of the Mobius transformation which produces a hyperbolic reflection of a point in the Poincare disk, followed by my attempt to produce the same result from first principles in a procedure.

Do I misunderstand the Mobius transformation and its use and/or is my procedure incorrect? 

InversePoint.mw

Hello

I want to write a program to get unknown coefficients of multiple polynomials. I have a problem with this program. The code sometimes doesn't work. Can anyone help me? It's very important to me.

restart

with(student)

``

EQ[0] := tanh(d)*b[1]*(b[1]+1)

tanh(d)*b[1]*(b[1]+1)

(1)

EQ[1] := -(-1+(a[1]-b[1]-1)*tanh(d)^2+(a[0]+1)*tanh(d))*b[1]

-(-1+(a[1]-b[1]-1)*tanh(d)^2+(a[0]+1)*tanh(d))*b[1]

(2)

EQ[2] := tanh(d)*((a[1]-b[1])*(a[0]+1)*tanh(d)-b[1]^2-a[1])

tanh(d)*((a[1]-b[1])*(a[0]+1)*tanh(d)-b[1]^2-a[1])

(3)

EQ[3] := (-a[1]^2+(2*b[1]-1)*a[1]-b[1]^2-b[1])*tanh(d)^2+(a[1]+b[1])*(a[0]+1)*tanh(d)-a[1]-b[1]

(-a[1]^2+(2*b[1]-1)*a[1]-b[1]^2-b[1])*tanh(d)^2+(a[1]+b[1])*(a[0]+1)*tanh(d)-a[1]-b[1]

(4)

EQ[4] := -tanh(d)*((a[1]-b[1])*(a[0]+1)*tanh(d)+a[1]^2+b[1])

-tanh(d)*((a[1]-b[1])*(a[0]+1)*tanh(d)+a[1]^2+b[1])

(5)

EQ[5] := -a[1]*(-1+(-a[1]+b[1]-1)*tanh(d)^2+(a[0]+1)*tanh(d))

-a[1]*(-1+(-a[1]+b[1]-1)*tanh(d)^2+(a[0]+1)*tanh(d))

(6)

EQ[6] := (a[1]+1)*a[1]*tanh(d)

(a[1]+1)*a[1]*tanh(d)

(7)

Eqs := {seq(EQ[i], i = 0 .. 6)}

Sol := solve(Eqs, {a[0], a[1], b[1]})NULL

{a[0] = a[0], a[1] = 0, b[1] = 0}, {a[0] = (tanh(d)^2-tanh(d)+1)/tanh(d), a[1] = -1, b[1] = -1}, {a[0] = -(tanh(d)-1)/tanh(d), a[1] = -1, b[1] = 0}, {a[0] = -(tanh(d)-1)/tanh(d), a[1] = 0, b[1] = -1}

(8)

for i from 2 to 4 do Case[i] := allvalues(Sol[i]) end do

{a[0] = -(tanh(d)-1)/tanh(d), a[1] = 0, b[1] = -1}

(9)

``

T1.mw

T2.mw

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