MaplePrimes Questions

Hi,

How to insert a condition in the final graph to display the parabola, its vertex, the axis of symmetry, and the roots (if they exist), and only display the parabola, the vertex, and its axis of symmetry otherwise. Thank you for your insights

S5AléatoireParaboleSommetGraphe.mw

Greetings! I need a maple code of logarithm of residuals for graphical comparison of iterative methods. Can anyone help me out by sharing a code comparing log of residuals of 2 or 3 iterative methods? 

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

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]);

20212

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 1618 and is the same as the version installed in this computer, created 2023, November 29, 17:28 hours Pacific Time.`

restart;

28544

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

diff(y(x), x) = sin(y(x))+1

y(0) = Pi

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

(2+x*tan((1/2)*y(x))+x)/(tan((1/2)*y(x))+1) = 0

[0, 0]

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

y(x) = 2*Pi-2*arccos(x/(2*x^2+4*x+4)^(1/2))

[0, 0]

 


 

Download unable_to_dsolve_quadature_dec_22_2023.mw

 

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

Notional example:
I use mtaylor compute the Taylor expansion of a function f (U) of several variables U1, .., UN.
In the resul the terms are ordered this way:

  • the leftmost term is f (P) where P denotes the point where the expansion is done
  • followed by a succession of terms :
    • firstly ranked according to the total order of derivation of  f.
    • and among terms of same derivation order, ranked in some kind of lexicographic order

For instance

Vars    := [seq(U[i], i=1..2)]:
AtPoint := [seq(P[i], i=1..2)]:
mt      := mtaylor(f(Vars[]), Vars =~ AtPoint, 3)

 

f(P[1], P[2])+(D[1](f))(P[1], P[2])*(U[1]-P[1])+(D[2](f))(P[1], P[2])*(U[2]-P[2])+(1/2)*(D[1, 1](f))(P[1], P[2])*(U[1]-P[1])^2+(D[1, 2](f))(P[1], P[2])*(U[1]-P[1])*(U[2]-P[2])+(1/2)*(D[2, 2](f))(P[1], P[2])*(U[2]-P[2])^2

(1)

map(t -> op([0, 0], select(has, [op(t)], D)[]), [op(mt)][2..-1])

[D[1], D[2], D[1, 1], D[1, 2], D[2, 2]]

(2)
 

 

Download mtaylor.mw

How could I define another ordering of the terms in this mtaylor expansion?
For instance 1 being identified to some letter and 2 to another one such that 1 <  2 a lexicographic order would be 

D[1], D[1, 1], D[1, 2], D[2], D[2, 2]

Thanks in advance

Hello everyone,

I'm trying to symbolically diagonalize a 5x5 matrix in Maple. I can determine the eigenvalues for my matrix, but when it comes to evaluating the eigenvectors, Maple gives me the following results:

eigenvalues(A): -a + u, a + u, u, u, u

eigenvectors(A): [a + u, 1, {r}], [-a + u, 1, {r}], [u, 5, {r, r, r, r, r}]

I don't understand why I'm getting {r} in the eigenvectors. How can I display the eigenvectors for my matrix A?

Thank you in advance for your answers !

5x5

 

restartNULL

with(linalg)

[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp, QRdecomp, Wronskian, addcol, addrow, adj, adjoint, angle, augment, backsub, band, basis, bezout, blockmatrix, charmat, charpoly, cholesky, col, coldim, colspace, colspan, companion, concat, cond, copyinto, crossprod, curl, definite, delcols, delrows, det, diag, diverge, dotprod, eigenvals, eigenvalues, eigenvectors, eigenvects, entermatrix, equal, exponential, extend, ffgausselim, fibonacci, forwardsub, frobenius, gausselim, gaussjord, geneqns, genmatrix, grad, hadamard, hermite, hessian, hilbert, htranspose, ihermite, indexfunc, innerprod, intbasis, inverse, ismith, issimilar, iszero, jacobian, jordan, kernel, laplacian, leastsqrs, linsolve, matadd, matrix, minor, minpoly, mulcol, mulrow, multiply, norm, normalize, nullspace, orthog, permanent, pivot, potential, randmatrix, randvector, rank, ratform, row, rowdim, rowspace, rowspan, rref, scalarmul, singularvals, smith, stackmatrix, submatrix, subvector, sumbasis, swapcol, swaprow, sylvester, toeplitz, trace, transpose, vandermonde, vecpotent, vectdim, vector, wronskian]

(1.1)

A := Matrix([[0, 1, 0, 0, 0], [(gamma-1)*H-u^2-a^2, (3-gamma)*u, -(gamma-1)*v, -(gamma-1)*w, gamma-1], [-u*v, v, u, 0, 0], [-u*w, w, 0, u, 0], [u*((gamma-2)*H-a^2), H-(gamma-1)*u^2, -(gamma-1)*u*v, -(gamma-1)*u*w, gamma*u]])

Matrix(%id = 18446746202416421574)

(1.2)

eigenvalues(A)

u+(-gamma*u^2-gamma*v^2-gamma*w^2+2*H*gamma-a^2+u^2+v^2+w^2-2*H)^(1/2), u-(-gamma*u^2-gamma*v^2-gamma*w^2+2*H*gamma-a^2+u^2+v^2+w^2-2*H)^(1/2), u, u, u

(1.3)

V := sqrt(u^2+v^2+w^2)

(u^2+v^2+w^2)^(1/2)

(1.4)

H := (1/2)*V^2+a^2/(gamma-1)

(1/2)*u^2+(1/2)*v^2+(1/2)*w^2+a^2/(gamma-1)

(1.5)

eigenvalues(A)

-a+u, a+u, u, u, u

(1.6)

eigenvectors(A)

[-a+u, 1, {r}], [a+u, 1, {r}], [u, 3, {r, r, r}]

(1.7)

``

Download maps.mw

NULL

restart

with(LinearAlgebra)

prel := {p1 = (1/2)*exp(I*a*x*(1/2)+I*b*t*(1/2))*(I*a*g[1](t, x)+2*(diff(g[1](t, x), x))), p2 = -(1/2)*exp(-I*a*x*(1/2)-I*b*t*(1/2))*(I*a*g[2](t, x)-2*(diff(g[2](t, x), x))), p3 = -(1/2)*exp(-I*a*x*(1/2)-I*b*t*(1/2))*(I*a*g[3](t, x)-2*(diff(g[3](t, x), x)))}

{p1 = (1/2)*exp(((1/2)*I)*a*x+((1/2)*I)*b*t)*(I*a*g[1](t, x)+2*(diff(g[1](t, x), x))), p2 = -(1/2)*exp(-((1/2)*I)*a*x-((1/2)*I)*b*t)*(I*a*g[2](t, x)-2*(diff(g[2](t, x), x))), p3 = -(1/2)*exp(-((1/2)*I)*a*x-((1/2)*I)*b*t)*(I*a*g[3](t, x)-2*(diff(g[3](t, x), x)))}

(1)

A := Matrix([[rhs(prel[1]), rhs(prel[2]), rhs(prel[3])]])

A1 := Transpose(A)

Matrix(%id = 36893490201564614396)

(2)

prel1 := {p4 = exp((1/2*I)*a*x+(1/2*I)*b*t)*(-I*lambda*g[1](t, x)+c[1]*g[2](t, x)+c[2]*g[3](t, x)), p5 = exp(-(1/2*I)*a*x-(1/2*I)*b*t)*(I*lambda*g[2](t, x)-c[1]*g[1](t, x)), p6 = exp(-(1/2*I)*a*x-(1/2*I)*b*t)*(I*lambda*g[3](t, x)-c[2]*g[1](t, x))}

{p4 = exp(((1/2)*I)*a*x+((1/2)*I)*b*t)*(-I*lambda*g[1](t, x)+c[1]*g[2](t, x)+c[2]*g[3](t, x)), p5 = exp(-((1/2)*I)*a*x-((1/2)*I)*b*t)*(I*lambda*g[2](t, x)-c[1]*g[1](t, x)), p6 = exp(-((1/2)*I)*a*x-((1/2)*I)*b*t)*(I*lambda*g[3](t, x)-c[2]*g[1](t, x))}

(3)

A2 := Matrix([[rhs(prel1[1]), rhs(prel1[2]), rhs(prel1[3])]]); A3 := Transpose(A2)

Matrix(%id = 36893490201519962460)

(4)

NULL

Download simplify2getgXisBg.mw

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

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 

(* Tag0 *) RealDomain:-solve(eqn__0, {y, x}):
(* Tag1 *) solve(eqn__0, {y, x}) assuming y + x >= 0, (y, x) <=~ Pi:
(* Tag2 *) RealDomain:-solve(eqn__1, {y, x}):
(* Tag3 *) 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 (Tag0 and Tag2) (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 Tag1 and Tag3. However, why is Maple still unable to find the four exact solutions above?

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

After about 30 seconds.

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;

35880

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 1615 and is the same as the version installed in this computer, created 2023, November 29, 17:28 hours Pacific Time.`

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

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

Download trig_reduce_recursion_dec_20_2023.mw

sachi_stream_error_3d.mw  3d_sachin_p1.mw

Dear sir, there is something missing why it is not able to evaluate?

By reference of some posts I have implemented to my ODE but not getting the graph.

what is the mistake in both files?

Hello,

At the moment I am focused on learning the Math (Calculus, then Differential Equations) and have been using Maple primarily to check the answers I got on a textbook problem.

I learn best by example but I realize that not knowing how to read the help pages really is a disadvantage.  I would like to learn how to use this amazing application more effectively in the future.  Can anyone give me tips on learning Maple with the help pages?  I got a primer on Maple but that hasn't been enough because I haven't used Maple enough.  How did you learn Maple and how do you think one can do this more quickly?

Thank You in advance.

 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

NULL

with(LinearAlgebra):

NULL

P1 := simplify(A1-ScalarMultiply(A3, z)-ScalarMultiply(A5, z^3)):

Error, (in plots/implicitplot/factor) invalid input: the following extra unknowns were found in the input expression: {P5[4]}

Error, (in plot/iplot2d:-Levels) could not evaluate expression

NULL

Download RAS(TDFFAM).mw

First 130 131 132 133 134 135 136 Last Page 132 of 2414