MaplePrimes Questions

In an old question, @mbras asked for a "partial" `convert/elsymfun`. However, SymPy's sympy.polys.rings.PolyElement.symmetrize seems to provide more examples that cannot be handled by the program that appeared in that question.
For instance, 

>>> from sympy import var
>>> var('x:z,p:r')
(x, y, z, p, q, r)
>>> from sympy.polys.polyfuncs import symmetrize
>>> symmetrize(x**2-(y**2+2**z),[y,x],formal=True,symbols=[p+p,q*q])[0]
-2**z - 4*p**2 + 2*q**2
>>> symmetrize(x*x*y+y*y*z+z*z*x,[y,x,z],formal=True,symbols=[p,q,r])
(0, x**2*y + x*z**2 + y**2*z, [(p, x + y + z), (q, x*y + x*z + y*z), (r, x*y*z)])

Though I can , can't the built-in  be generalized to such expressions (in other words, write the polynomial part of input as a symmetric part and a remainder with (named, if need be) elementary symmetric polynomials)?

Besides, since any symmetric polynomial can also be expressed in terms of the complete symmetric polynomials, is there a similar  command in Maple?

Hi,

I have a small issue when trying to calculate the I have assigned 'g' to the derivative function, but I have to use 'subs' to obtain the images. Thank you for your insights

QFonction.mw

I find that if if declare a variable in a procedure inside a if  statement it Maple things something is wrong with the if statement:

tSound=proc(xMic,yMic,zMic,xGun,yGun,zGun,mode)  

global vSound;  

local locMic:=Vector([xMic,yMix,zMix]);  

local locGun:=Vector([xGun,yGun,zGun]);   l

ocal delGunToMix;   if mode=1 then #`direct  `    

local x=0.0;    <==remove this sand fine

delGunToMix:=locMic-locGun;    

return vSound*Norm(delGunToMix);  

elif  mode=2 then #`reflect off wall at z=0`        

end if;   return 0.0;  end proc:


Error, invalid 'if' statement
==>I can delclare the variable 'local' outside the if. Why? It doesn't make much sense, though not that hard to avoid.

So, every year our family picks names for Christmas, but this year seemed odd.  My wife pointed out that one family always just happens to randomly pick another families name.  That is the majority of the time most of one family is always trading with another, the only rule is that each family member can not trade with a member of their own family. 

I was wondering if someone could come up with a way to calculate just how random the choice actually was from the previous year or years using whatever means necessary .. graph theory came to mind.  The draw was done behind closed doors, so my wife questioned how failrly that was done, and so brought me here with the question ...
Was the name choosing really random or was it actually a fixed draw?

In our group there are total of 9 adults and 9 children, but actually the 2 youngest children swap gifts so it's really 9 adults and 7 children who can swap presents.  But I will breakdown the families less the two trading children.

Family A - 2 adults 1 child
Family B - 2 adults 2 children
Family C - 2 adults 2 children
Family D - 2 adults 2 children
Family E - 1 adult

Oh, a child can trade with another child or a parent and similarily a parent can trade with another parent or a child.  

My code
restart;
reqn:=f(n+1) = f(n)  + sqrt(2*f(n+1)-f(n)):
rsolve({reqn, f(1) = 15},f(n));

I can not get the answer. How can I get the answer?

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.

I wonder if this a bug or Am I overlooking something?

I set infolevel[dsolve]:=5; and first time calling dsolve(ode), it works as expected. It prints on the screen the trace and steps it did.  But when I repeat the command dsolve, now it only prints one line and the rest of info that were printed before no longer show.

Should not the same information be printed each time? This is what happens on another example I tried. It seems infolevel does not work the same depending on the ode being solved?  Here is a worksheet attached to show the above.

Is there a workaround to make it display same information each time?

Maple 2023.2 on windows 10.

 

restart;

21424

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

ode:=[2*diff(x(t),t)+diff(y(t),t)=x(t)+y(t)+t,diff(x(t),t)+diff(y(t),t)=2*x(t)+3*y(t)+exp(t)];
infolevel[dsolve]:=5;
dsolve(ode);

[2*(diff(x(t), t))+diff(y(t), t) = x(t)+y(t)+t, diff(x(t), t)+diff(y(t), t) = 2*x(t)+3*y(t)+exp(t)]

5

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

-> Calling odsolve with the ODE diff(diff(y(x) x) x) = 4*(diff(y(x) x))-y(x)-3*x+1 y(x) singsol = none

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

trying high order exact linear fully integrable

trying differential order: 2; linear nonhomogeneous with symmetry [0,1]

trying a double symmetry of the form [xi=0, eta=F(x)]

-> Try solving first the homogeneous part of the ODE

   checking if the LODE has constant coefficients

   <- constant coefficients successful

   -> Determining now a particular solution to the non-homogeneous ODE

      trying a rational particular solution

      <- rational particular solution successful

<- solving first the homogeneous part of the ODE successful

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

dsolve(ode);

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

infolevel[dsolve]:=5;

5

dsolve(ode);

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

dsolve(ode);

-> Solving each unknown as a function of the next ones using the order: [y(t), x(t)]

{x(t) = exp((2+3^(1/2))*t)*c__2+exp(-(-2+3^(1/2))*t)*c__1-3*t-11, y(t) = -(1/2)*exp((2+3^(1/2))*t)*c__2*3^(1/2)+(1/2)*exp(-(-2+3^(1/2))*t)*c__1*3^(1/2)-(3/2)*exp((2+3^(1/2))*t)*c__2-(3/2)*exp(-(-2+3^(1/2))*t)*c__1-(1/2)*exp(t)+2*t+7}

ode:=diff(y(x),x$2)+y(x)=sin(x);
dsolve(ode);

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

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

trying high order exact linear fully integrable

trying differential order: 2; linear nonhomogeneous with symmetry [0,1]

trying a double symmetry of the form [xi=0, eta=F(x)]

-> Try solving first the homogeneous part of the ODE

   checking if the LODE has constant coefficients

   <- constant coefficients successful

   -> Determining now a particular solution to the non-homogeneous ODE

      building a particular solution using variation of parameters

<- solving first the homogeneous part of the ODE successful

y(x) = sin(x)*c__2+cos(x)*c__1+(1/2)*sin(x)-(1/2)*cos(x)*x

dsolve(ode);

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

trying high order exact linear fully integrable

trying differential order: 2; linear nonhomogeneous with symmetry [0,1]

trying a double symmetry of the form [xi=0, eta=F(x)]

-> Try solving first the homogeneous part of the ODE

   checking if the LODE has constant coefficients

   <- constant coefficients successful

   -> Determining now a particular solution to the non-homogeneous ODE

      building a particular solution using variation of parameters

<- solving first the homogeneous part of the ODE successful

y(x) = sin(x)*c__2+cos(x)*c__1+(1/2)*sin(x)-(1/2)*cos(x)*x

 


On a side note. the first line of the display is hard to read. Any one know what it is supposed to mean by the space between the 1 and y(x) at the end there?

Download infolevel_stops_working.mw

Another example where infolevel changes on second call to dsolve: The first call gives more information which is lost in the second call. There does not seem to be a way to fix this at user level.

restart;

23828

ode:=diff(y(x),x)+(a*x+y(x))*y(x)^2=0:
infolevel[dsolve]:=5:
dsolve(ode)

Methods for first order ODEs:

--- Trying classification methods ---

trying a quadrature

trying 1st order linear

trying Bernoulli

trying separable

trying inverse linear

trying homogeneous types:

trying Chini

differential order: 1; looking for linear symmetries

trying exact

trying Abel

The relative invariant s3 is: -1/27*a*(2*a^2*x^3-9)

The first absolute invariant s5^3/s3^5 is: 729*a^4*x^6*(2*a^2*x^3-15)^3/(2*a^2*x^3-9)^5

The second absolute invariant s3*s7/s5^2 is: 5/3/a^2*(2*a^2*x^3-9)/x^3*(2*a^4*x^6-21*a^2*x^3+18)/(2*a^2*x^3-15)^2

...checking Abel class AIL (45)

...checking Abel class AIL (310)

...checking Abel class AIR (36)

inverse of the transformation solving the problem is: {t = 1/2*(-2*a^2)^(1/3)*x, u(t) = -(-2*a^2)^(1/3)/a*y(x)}

<- Abel successful

y(x) = 2*a/(a^2*x^2+2*RootOf((-2*a^2)^(1/3)*AiryBi(_Z)*c__1*x+(-2*a^2)^(1/3)*x*AiryAi(_Z)+2*AiryBi(1, _Z)*c__1+2*AiryAi(1, _Z))*(-2*a^2)^(1/3))

dsolve(ode)

Methods for first order ODEs:

--- Trying classification methods ---

trying a quadrature

trying 1st order linear

trying Bernoulli

trying separable

trying inverse linear

trying homogeneous types:

trying Chini

differential order: 1; looking for linear symmetries

trying exact

trying Abel

<- Abel successful

y(x) = 2*a/(a^2*x^2+2*RootOf((-2*a^2)^(1/3)*AiryBi(_Z)*c__1*x+(-2*a^2)^(1/3)*x*AiryAi(_Z)+2*AiryBi(1, _Z)*c__1+2*AiryAi(1, _Z))*(-2*a^2)^(1/3))

 

Download another_example_info_level_changes.mw

I'd like to plot vectors with one beginning at the head of the other. The application is a reflection at a surface. VectorPositionPlot doesn't seem to do it.

The same kind of plot would be used to illustrate vector addition.

I have done a complete clean reinstall of windows 10 and all programs on my pc.

In worksheet mode new files do not have the "default" red/brown text coluor ond the font is different. 

Might not be a problem but thought that was the default?

What have I changed or have Maple defaults changed?

restart

``

2+2

4

(1)

NULL

eq := x^3+x-7

x^3+x-7

(2)

NULL

Download 23-11-23_Q_inputs_to_worksheet_not_brown_red_colour.mw

Sorry if this is already known, but I haven't found the proper function call.

I just want to "print" this expression without evaluating the boolean calls

restart;
P(X <= 5) = P(-5 <= -X) = P(E(X) - 5 <= E(X) - X);

As it stands, this will evaluate to "false" which I obviously don't want.

I just want to use it as a displayer.

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

I was trying to fill a Submit Software Change Request form a couple of times (with an interval of a couple of days) to report a small issue in Maple2023, which happens when I try to open an empty mpl-file. However, each time I received an error message. It looks like it is just broken.

Does anyone know if there is any reliable mechanism to provide feedback on MapleSoft products?

This is strange problem. I have matrix M. when doing latex(M), it works. But when doing latex(simplify(evalf[16](M))) it gives internal Maple error 

Error, (in unknown) invalid input: ^ expects 2 arguments, but received 1

any workaround or ideas why it happens?

Maple 2023.2 on windows 10.

restart;

2848

interface(version)

`Standard Worksheet Interface, Maple 2023.2, Windows 10, October 25 2023 Build ID 1753458`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1590. The version installed in this computer is 1585 created 2023, October 29, 6:31 hours Pacific Time, found in the directory C:\Users\Owner\maple\toolbox\2023\Physics Updates\lib\`

expr:=Matrix(3, 3, [[(-a^2-b^2-c^2)^(1/2),b*c/a,-b*c/a],[0,-(a^2+b^2)/(-a^2-b^2-c^2)^(1/2),c*a/b-c^2/(-a^2-b^2-c^2)^(1/2)],[0,0,0]]);
latex(expr);

Matrix(3, 3, {(1, 1) = sqrt(-a^2-b^2-c^2), (1, 2) = b*c/a, (1, 3) = -b*c/a, (2, 1) = 0, (2, 2) = -(a^2+b^2)/sqrt(-a^2-b^2-c^2), (2, 3) = c*a/b-c^2/sqrt(-a^2-b^2-c^2), (3, 1) = 0, (3, 2) = 0, (3, 3) = 0})

\left[\begin{array}{ccc}
\sqrt{-a^{2}-b^{2}-c^{2}} & \frac{b c}{a} & -\frac{b c}{a}
\\
 0 & -\frac{a^{2}+b^{2}}{\sqrt{-a^{2}-b^{2}-c^{2}}} & \frac{c a}{b}-\frac{c^{2}}{\sqrt{-a^{2}-b^{2}-c^{2}}}
\\
 0 & 0 & 0
\end{array}\right]

expr:=simplify(evalf[16](expr));
latex(expr);

Matrix(3, 3, {(1, 1) = 1.*sqrt(-a^2-b^2-c^2), (1, 2) = b*c/a, (1, 3) = -1.*b*c/a, (2, 1) = 0., (2, 2) = (-1.*a^2-1.*b^2)/sqrt(-a^2-b^2-c^2), (2, 3) = c*a/b-1.*c^2/sqrt(-1.000000000*a^2-1.000000000*b^2-1.000000000*c^2), (3, 1) = 0., (3, 2) = 0., (3, 3) = 0.})

Error, (in unknown) invalid input: ^ expects 2 arguments, but received 1

 

(will send to Maplesoft)

Download latex_problem_after_using_evalf_nov_23_2023.mw

I want to write an if statement with a matrix R:
such that maple executes command 1 if R is Matrix(4, 4, [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]])

and command 2 if R is not zero.

What is the easiest way to go about this?

Anteriorly, I had done a question that you answered in the forum and it basically it was about the simplification of a equation. I'm posting the print of the screen and the code because the question of today is similarly, but not completely, because there are something that make more complicate the code that I devolved.

restart;
Hi := -Delta*S1^2 - J*S1*S2;
R1 := S1*exp(-beta*Hi);
R1 := add(R1, S1 = [--1, 0, 1]);
R2 := exp(-beta*Hi);
R2 := add(R2, S1 = [-1, 0, 1]);
S := R1/R2;
S := convert(S, trig, {J*S2});
S := simplify(S);
S := convert(S, exp, {Delta});

In this case I had to put in evidence the therm exp(Delta beta), where I simplified the expression. Now, we have more 2 variables (+2 and -2) to substitute in the equation. The code is:

restart;
Hi := -Delta*S1^2 - J*S1*S2;
R1 := S1*exp(-beta*Hi);
R1 := add(R1, S1 = [-2, -1, 0, 1, 2]);
R2 := exp(-beta*Hi);
R2 := add(R2, S1 = [-2, -1, 0, 1, -2]);
S := R1/R2;
S := convert(S, trig, {J*S2});
S := simplify(S);
S := convert(S, exp, {Delta});

In the last line we had the final equation

What should I change in the code for that my exponential function continue in evidence? This is, for my expression  be

(4*sinh(2*J*S2*beta) + 2*sinh(J*S2*beta)*exp(-3*Delta*beta))/(2*cosh(2*J*S2*beta) + 2*cosh(J*S2*beta)*exp(-3*Delta*beta) + exp(-4*Delta*beta))

First 31 32 33 34 35 36 37 Last Page 33 of 2308