## Nested square brackets in matrix...

Dear all, in the example below I create a matrix(3x2) and each element contains a vector. How can I avoid the double brackets of the matrix elements or eliminate the double brackets?

Thanks for help

## A simplification / reduction question...

I know this question has been asked time and time again. Starting of with the expr . That is the end goal I want to achieve.  How would I reduce the expansion to get it into 1-f(x,y,z)/g(x,y,z) format?. I have tried all sorts of approaches.

 > restart
 > #
 > expr:=1 - (x__1*x__2 + y__1*y__2 - z__1*z__2)^2/((x__1^2 + y__1^2 - z__1^2)*(x__2^2 + y__2^2 - z__2^2))
 (1)
 > normal( (1) );
 (2)
 > simplify( (2) );
 (3)
 (4)
 > Test:=combine(%)
 (5)
 >
 > n:={op(numer(Test))}
 (6)
 > d:={op(expand(denom(Test)))}
 (7)
 > d subset n
 (8)
 > d intersect n
 (9)
 (10)
 > factor( (10) );
 (11)
 > n minus d
 (12)
 >

## Wrong Latex generated when using _C1 for constant...

This is some serious problem in Latex in Maple 2024.1

I went back to using _C1, _C2 for my own constants of integration.

But I want to get the nice latex for c__1,c__2.

So to do that, my understanding is that I just need to call Maple's dsolve after restart on some random ode in order to set c__1,c__2 for display only and also for latex.

This below seems to confirm this.  But now the latex generated is all wrong and messed up on some places.

My question is: I want to use use _C1,_C2 (i.e. the traditional constants) in my own code I write which generates solution to an ode, but for Latex, I'd like these to come out as c__1,c__2 since they look nicer.

What is the correct way to do this? What Am I doing wrong here? I do not see it.

 > interface(version);

 > #EXAMPLE showing using _C1 for input and latex. All works OK restart;
 > sol:=y(x) = x+_C1/x^2;

 > #correct latex. No problem compiling, but not nice looking _C1 latex(sol)

y \! \left(x \right) = x +\frac{\textit{\_C1}}{x^{2}}

 > #Example showing what happens when making call to dsolve initially restart;
 > dsolve(diff(y(x),x$2)=0); #this call is used to just activate display of nicer constants  > sol:=y(x) = x+_C1/x^2;  > #bad latex, gives error when compiling with texlive latex(sol) y \! \left(x \right) = x +\frac{c}{_} Download latex_problem_maple_2024_july_18_2024.mw And to confirm this is new problem in Maple 2024, I run the same exact worksheet now in Maple 2023.2, and there it works correctly. i.e. Latex generated is correct in both cases. Here is the Maple 2023.2 worksheet, you can see below the difference in Latex.  > interface(version);  > #EXAMPLE showing using _C1 for input and latex. All works OK restart;  > sol:=y(x) = x+_C1/x^2;  > #correct latex. No problem compiling, but not nice looking _C1 latex(sol) y \! \left(x \right) = x +\frac{\textit{\_C1}}{x^{2}}  > #Example showing what happens when making call to dsolve initially restart;  > dsolve(diff(y(x),x$2)=0); #this call is used to just activate display of nicer constants

 > sol:=y(x) = x+_C1/x^2;

 > #good Latex now in Maple 2023.2. latex(sol)

y \! \left(x \right) = x +\frac{c_{1}}{x^{2}}

If it makes any difference to Maple, I am using the typesetting EXTENDED now for everything. But I do not think Latex should care about this, but thought to mention it just in case.

## How to retrieve the coefficients of a transcedenta...

Hello

Consider,  as an example,  the following (simple) transcendental equation.

alpha*((epsilon-1)*x+y-3*x*z-epsilon/3*x^3+b*sin(w)+3)

How to retrieve the coefficients and the terms considering that the unknowns are x,y,z and w?   Something like [x,y,x*z,x^3,sin(w),1] and their coefficients.

many thanks

## dsolve does not return solution unless given impli...

I have thought before that Maple's dsolve will try to return implicit solution automatically if unable to find explicit one or for some  other reasons it prefers implicit.

But In this ode, we see Maple returns no solution at all for this first order quadrature ode, even though it can find solution when given implicit option.

Is this a correct behaviour? Should it not have returned this solution automatically?

 > interface(version);

 > Physics:-Version();

 > restart;
 > ode:=diff(y(x),x)=sin(y(x)); IC:=y(a)=b;

 > maple_sol:=dsolve([ode,IC]);

 > maple_sol:=dsolve([ode,IC],explicit);

 > maple_sol:=dsolve([ode,IC],implicit);

## Maple 2024.1 locks up completely when using timeli...

I called dsolve with timelimit on this ode.  All of Maple instantly locks up.

I do not mean the worksheet, but everything. I have each worksheet using its own engine,. Not able to open new worksheet, nothing clicks. The whole front end locks up. Can't click on anything.

Killing every mserver.exe does not even resolve this. I had to terminate all of Maple from the task manager. The strange thing, is that looking at task manager I see mserver.exe doing nothing. zero CPU. Only the front end process is at high CPU (the one with the Java icon).  It looks like the Java frontend is locked up for some reason.

Do others see the same thing? does this happen on the mac also? Please make sure to save all your work before trying to run this on your PC.

Maple 2024.1 on windows 10. This is first order Riccati ode.

 > interface(version);

 > Physics:-Version();

 > ode:=(a2*x^2+b2*x+c2)*diff(y(x),x)=y(x)^2+(a1*x+b1)*y(x)+a0*x^2+b0*x+c0;

 > #WARNING. This will freeze all of Maple. timelimit(30,dsolve(ode));

These are GUI options on my end.

UPDATE 1

in Maple 2023.2 also on windows 10,  there is no lock up at all. same code. The solution to the ode is very large. I tried using both typesetting level  to EXTENDED  and  typesetting level MAPLE STANDARD and no hang.

I wonder if this has something to do with why Maple 2024.1 locks up? But I have not changed anything in my end. I made no change in options or anything else. same PC, same graphics card.

UPDATE 2

Found the BUG!!

In Maple 2024.1, if I change the display option typesetting level  to EXTENDED, the front end do not hang.

If I change the display typesetting level MAPLE STANDARD, the ftont end hangs.

But why??

 > interface(version);

 > Physics:-Version();

 > ode:=(a2*x^2+b2*x+c2)*diff(y(x),x)=y(x)^2+(a1*x+b1)*y(x)+a0*x^2+b0*x+c0;

 > interface(typesetting=extended):
 > timelimit(30,dsolve(ode));

 > interface(typesetting=standard):
 > #WARNING, this will hang MAPLE now. WHY?? timelimit(30,dsolve(ode));

ps. Reported to Maplesoft support. July 17, 2024. Hopefully this will be fixed in Maple 2024.2

## Given that the solution of a PDE is known, how can...

Hello

I am trying to understand how to use Maple to solve a PDE.  Below it is a problem (Henon-Heilles system) where the answer is known.

with(PDEtools);

infolevel[pdsolve]:=3:

declare(Hamil(x,y,u,v));

PDEHamil := u*diff(Hamil(x, y, u, v), x) + v*diff(Hamil(x, y, u, v), y) + (-2*x*y - x)*diff(Hamil(x, y, u, v), u) + (-x^2 + y^2 - y)*diff(Hamil(x, y, u, v), v) = 0;

pdsolve(PDEHamil)


Maple returns no solution, but one solution is:

sH:=1/2*(u^2+v^2)+1/2*(x^2+y^2-2/3*y^3)+x^2*y;

simplify(eval(subs(Hamil(x,y,u,v)=sH,PDEHamil)));
0=0


What am I missing?

Many thanks.

## How to change datatype of multiple columns in data...

I was working with a Dataframe when I wanted to change the datatype of multiple columns at the same time as this is quite a large dataframe. I found in the helpfile that I can change datatype by the following command:

SubsDatatype(Data, plts, float) which then change the datatype of "plts" into float. I had hoped that using multiple columns in the command would work in this way: SubsDatatype(Data, [plts, act], float)  but apparently not. Is there a way to do this or do I have to do it column by column?

Additionally I have another question about dataframes. I would like to replace "0" in the dataframe by a "blank" as you can do in excel. How do you do this in a dataframe?

Thanks in advance for any help given!

## Adding H-type error bars to a plot of 2d points...

Using ScatterPlot (or ErrorPlot), one can add error bars to a 2d point plot of data. However, the bars are single lines. I wish to create a plot with H-type error bars in both the horizontal and vertical directions.  Below is an example showing how the bars should appear. (This image is taken from a previous question about adding error bars.)

I do not need to reproduce this figure exactly. The location of the data points and the size of the error bars are irrelevant. The closest I have seen is using BoxPlot.

Has this question been asked and answered? If so, I cannot find it.

## Command for finding algebraic invariant curve...

I am wondering if Maple DETools package has functions or command to deal with the following problem: algebraic invariant curve. Some first order ODE preserves such type of curve as their solutions. For example, the following ODE has an algebraic curve y(x)=0 as its particular solutions:

> odetest(y(x)=0, y'(x)=y(x)^3-2*x*y(x)^2,y(x));

> 0

The ODE in general does not have algebraic solutions. The solutions are computed in terms of special functions. In some cases the algebraic curve could have multi-variate forms . I am wondering about one question: Does Maple have tools to find solutions of algebraic curve for ODE, without knowing the information of general solutions? I have already tried PDETools:-casesplit, but it seems to classify such curves to the same case to the general solution.

## Help on how to solve (if possible) a PDE. ...

Hello,

I need to check if Maple can solve a specific PDE. Since I don't know much about the PDEtools package, I wonder if a user familiar with it and experienced in solving PDEs could help me.

with(PDEtools);
declare(u(x,y,z,w));
PDE1:=alpha*(y+b*(w))*diff(u(x,y,z,w),x)+(x+z-b*(w))*diff(u(x,y,z,w),y)-c*y*diff(u(x,y,z,w),z)+d*(y-x)*diff(u(x,y,z,w),w)=0;
Sol1:=pdsolve(PDE1);


Maple returns NULL as the solution. Any ideas on how to obtain a solution, if possible? In other similar PDEs, u(x,y,w,z) has a quadratic form.

Many thanks,

## axis labels on the wrong side of the vertical axis...

When you look at negative horiztonal values on a basic plot, the axis labels can be obscured by gridlines or the plot itself. I have been told many times to keep axis labels and gradation labels outside of the plotting area to avoid adding more information than is neccessary in the actual plotting area. Is there a way to move the label to the other side and rotate it by 180 degree? How do people normally deal with this issue?

See my example of how the axis labels can be obscured by gridlines.

axis_label_on_wrong_side_of_axis.mw

## how to improve the typesetting of the gamma's...

I am trying to improve the positioning of the gammas in the diagram (at bottom) as they are too close to the points and lines. gamma1 and gamma2 have been assigned values. This best I could come up with is shown below.

 > restart;
 > with(plots):with(plottools):
 > with(Typesetting):
 > gamma2:=<3|5|2>
 (1)
 > Pgamma2:=[3/2,5/2]
 (2)
 > display(point(Pbeta2,symbol=solidcircle,symbolsize=14),textplot([Pgamma2[],Typeset((gamma2 )),align={above}]))
 >

## How to retrieve the arguments of f_1 , the solutio...

Hello

I am trying to solve some PDEs using Maple.  In one of them, Maple returns

SolL:= HL(x, y, z) = f__1(1/2*(2*sigma*z - x^2)/sigma, rho^2 - 2*rho*z + y^2 + z^2)

How to retrieve only the arguments of f__1?

Many thanks

## c__1 and _C1 do not seem to work the same way....

The change from _C1 to c__1 is causing me so many problems as I still do not fully understand it.

I have nothing in my Maple ini file.

I was solving from a solution to an ode for the constant of integration, which I know is c__1 inside a proc.

But this was failing to solve for it. When I copy same code to global (worksheet), it works. So it is clearly issue of name space related to c__1 vs. _C1.

So even though the solution now has the subscripted version and not the traditional one (since that is the default now), it does not solve for it when inside a proc.

If instead I solve for _C1, then it works. Even though the solution has c__1. This is bizzar to me.

I also tried adding   global c__1; inside the proc, but this did not help. (did not show this version in the worksheet).

Why is solving for c__1 fail inside a proc but works outside? Clearly the c__1 in the solution of the ode is not the same c__1 I typed in to solve for, even though on the screen they look the same.

So c__1 is not really the same as _C1 in all aspects. Right?

Here is worksheet. Example 1 below shows how it fails inside proc

Maple 2024.1. Does this happen for others on Linux or the Mac?

 > restart;
 > interface(version);

 > Physics:-Version();

Example (1) solving for constant of integration fails inside proc but works outside

 > restart;
 > foo:=proc(ode::=) local sol,the_constant;    sol:=dsolve(ode);    print("sol is ",sol);    the_constant:=solve(sol,c__1);    print("the constant is ",the_constant); end proc;

 > #this does not work ode:=diff(y(x),x) = 3/4*y(x)/x; foo(ode)

 > restart;
 > #this works ode:=diff(y(x),x) = 3/4*y(x)/x; sol:=dsolve(ode); print("sol is ",sol); the_constant:=solve(sol,c__1);

 >

Example (2). Solving for _C1 works, even though the ode has c__1  , why??

 > restart;
 > foo:=proc(ode::=) local sol,the_constant;    sol:=dsolve(ode);    print("sol is ",sol);    the_constant:=solve(sol,_C1);  #notice solving for _C1 now    print("the constant is ",the_constant); end proc;

 > ode:=diff(y(x),x) = 3/4*y(x)/x; foo(ode)

 > restart;
 > ode:=diff(y(x),x) = 3/4*y(x)/x; sol:=dsolve(ode); print("sol is ",sol); the_constant:=solve(sol,c__1); #these both work OK in global the_constant:=solve(sol,_C1);  #these both work OK in global

 >
 >

Example (3). Forcing arbitraryconstants = subscripted it still does not work inside proc. Why??

 > restart;
 > foo:=proc(ode::=) local sol,the_constant;    sol:=dsolve(ode,arbitraryconstants = subscripted);       print("sol is ",sol);    the_constant:=solve(sol,c__1);    print("the constant is ",the_constant); end proc;

 > ode:=diff(y(x),x) = 3/4*y(x)/x; foo(ode)

 >