Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Suppose I am plotting a 2D plot and want to highlight the point where two lines intersect. I would like to display this intersection point inside the plot in black font, mark it with an arrow or some visual highlight, and clearly label it. How can I do this?

Additionally, instead of using different colours (blue, green, red) for the lines, I want to distinguish them using different line styles such as solid, dotted, and long-dashed lines. How can I make these changes?

restart

with(Optimization); with(plots); with(Student[VectorCalculus]); with(LinearAlgebra)

NULL

_local(Pi)

Pi

(1)

NULL

NULL

``

M_w := b*(((Cr*alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+((g*i2-a)*Cr-2*Crm-2*c+2*Pr)*alpha-(-g*i2+a)*Cr)*d+alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+2*g*i2-2*a)*rho0+(2*((Cr*b-1)*d+b))*(delta+Cn-Pr-1))^2*d/(8*(Cr*b*d+b-d)^2*(((Cr*alpha*b-alpha+1)*d+alpha*b)*rho0^2-2*b*d*(delta-1)))

(1/8)*b*(((Cr*alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+((g*i2-a)*Cr-2*Crm-2*c+2*Pr)*alpha-(-g*i2+a)*Cr)*d+alpha*((-g*i2+a)*Cr+2*Crm+2*c-2*Pr)*b+2*g*i2-2*a)*rho0+(2*(Cr*b-1)*d+2*b)*(delta+Cn-Pr-1))^2*d/((Cr*b*d+b-d)^2*(((Cr*alpha*b-alpha+1)*d+alpha*b)*rho0^2-2*b*d*(delta-1)))

(2)

``

``

``

M_D := (Cr*rho0*t*(Cr*alpha*b-alpha-1)*d^2+((alpha*((-g*i2+a)*Cr+2*Crm+2*c+3*t-2*Pr)*Cr*b+((g*i2-a)*Cr-2*Crm-2*c-2*t+2*Pr)*alpha+(g*i2-a)*Cr-2*t)*rho0+(2*(Cr*b-1))*(sigma*t+Cn-Pr+delta-1))*d+(alpha*((-g*i2+a)*Cr+2*Crm+2*c+2*t-2*Pr)*b+2*g*i2-2*a)*rho0+2*b*(sigma*t+Cn-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alpha*b)*rho0^2-16*b*d*(delta-1))*(Cr*b*d+b-d)^2)

(4)

``

``

NULL

NULL

DATA1 := [delta = .9, a = 0.1e-1, g = .25, c = 0.5e-1, rho0 = .4, Cn = .4, Crm = .1, i2 = 0.6e-1, t = 0.1e-1, alpha = .95, s = 0.1e-1, Pr = .35, upsilon = .95, b = .5, d = .3, Cr = 0.1e-1]

[delta = .9, a = 0.1e-1, g = .25, c = 0.5e-1, rho0 = .4, Cn = .4, Crm = .1, i2 = 0.6e-1, t = 0.1e-1, alpha = .95, s = 0.1e-1, Pr = .35, upsilon = .95, b = .5, d = .3, Cr = 0.1e-1]

(5)

P11 := subs(DATA1, M_w); P21 := subs(DATA1, M_D); P31 := subs(DATA1, M_S)

0.9301486586e-2

 

4.251178959*(-0.4764573140e-1+0.4030e-2*sigma)^2

 

4.251178959*(-0.4917713136e-1+0.4030e-2*sigma)^2

(6)

``

A1 := plot([P11, P21, P31], sigma = 0 .. .7, color = ["Red", "Blue", "Green"], labels = [sigma, `π__m`], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("π"),mi("n"),mn("W"));`, `#msubsup(mi("π"),mi("n"),mn("D"));`, `#msubsup(mi("π"),mi("n"),mn("DS"));`], axis[2] = [color = "#600000"])

 

NULL

display(A1, pointplot([[X, Y]], symbol = circle, symbolsize = 25, color = blue))

Error, (in plots:-pointplot) points cannot be converted to floating-point values

 
 

NULL

Download Manf_profit__t_graph_changes_needed.mw

Hi !

When I use the "expand" command on a summation, I've noticed that sometimes the command works and

sometimes it doesn't. I looked through the previous commands to see which one might be causing this problem.

I found that if I use the "changevar" command  from the "student" package,  (deprecated package,I know )

the "expand" command works correctly.     Strange behavior, isn't it ?       I have Maple 2018 on Windows 10.

Regards  !

There is a small  example in the file.

expand-problem.mw

When there is a large Matrix in a worksheet, asking Maple to export the worksheet to PDF, the matrix is truncated in the PDF. Only one page of it shows.

Is there a way to tell Maple not to truncate large matrix, even if goes over many pages?

I need to export eveything in the worksheet to PDF.

Here is an example

restart;
interface(rtablesize = infinity);

A:=Array(1 .. 0);
for n from 1 to 50 do
    A,= [n];
od:

convert(convert(A,listlist),Matrix);

When I do , from menu, File->Export As and select PDF, then open the PDF, I only see half the matrix in the PDF.

Attached the PDF also.

Worksheet mode, Maple 2025.2

Is this a bug? export should export everything in worksheet.

truncate_output.pdf

truncate_output.mw

Update

Found a workaround.

First, I tried to print to pdf, istead of export to pdf. That also did not work.

Then I tried DocumentTools:-Tabulate instead, and now this worked. The PDF has the full content, not truncated.

i.e. instead of  

convert(convert(A,listlist),Matrix);

Did this:

the_table:=convert(A,listlist):
DocumentTools:-Tabulate(A,'width'=400,widthmode='pixels', etc...); #change as needed

For some reason, Matrix is truncated when exporting to PDF, but not Tabulate.

I think it is a bug for Maple to truncate the Matrix in PDF,  but workaround exist, so not critical.

I am facing three issues while plotting my plot.I need help modifying the syntax:

  1. I am unable to correctly display superscripts and subscripts for Pi[m]^WD < Pi[m]^D inside the graph region

  2. I cannot format the subscript for i__2 on the x-axis.

  3. A horizontal dotted line appears parallel to the x-axis at y=0.5; how can I remove this line?

    Question_1_regional.mw

Hello all,

This will be my LAST (I swear) question about translating a little function from Mathematica to Maple.

rand := RandomReal[{-5, 5}, 20]

ListPlot[rand]

 

ListListLinePlot[rand]

In[16]:= line = Fit[rand, {1, x}, x]

Out[16]= 0.247498 - 0.0131912 x

In[17]:= parabol = Fit[rand, {1, x, x^2}, x]

Out[17]= -1.82858 + 0.31249 x - 0.0082569 x^2

In[18]:= cos = Fit[rand, {1, x, Cos[x]}, x]

Out[18]= 0.483172 - 0.0302095 x - 0.271457 Cos[x]

Plot[{ListLinePlot[rand], line, parabol, cos}, {x, 0, 20}]

#graph omitted by request of users here.

So, then, my LAST question will be :

How to translate this to Maple ?

Thank you very much.

JM

Hello again,

I think I have not been clear enough in my question.

I reformulate :

Is it possible in Maple to create matrices whose elements are also matrices

and this to any level ?

For the Dimensions of a matrix it's ok for me.

thank you 

JM

Hello all,

I just need a hint how to enter "matrices" in Maple which are lists of lists and so on.

Since I gave up on "math"ematica I would like to be able to enter what is just

below (with the dimension).

Is it doable in Maple...I guess yes :)

M = {{a, {1, a, -0.5}}
, {{b, {1}}}, c + d}
Out[5]= {a, {1, a, -0.5}, {{b, {1}}}, c + d}
In[8]:= MatrixForm[M]
Out[8]//MatrixForm=
a
{1, a, -0.5}
{{b, {1}}}
c + d
In[9]:= Dimensions[M]
Out[9]= {4}

PS: Is a moderator ready to make me with a reputation of 100 in order I can enter tags.

Thank you for everything.

Regards,

JM

I am not able to find place in help which lists which changes interface(typesetting = extended); makes compared to interface(typesetting = standard);

Reason  I am asking, is that in interface(typesetting = extended); Maple adds a small annoying "dot"  between each term for multiplication, which is not there in standard.

Is there a place in documentation that mentions this as part of extended? Where to find it?

in Matlab and Mathematica it is possible to put the labels in contour plot, directly on the lines (with nice positioning).

This makes it much much easier to see the level of each contour line since the values are on the lines,  without having to jump to the legend and guess the color and try to visually match colors with the plot.

For example, in Matlab

clear; close all;
x = 0:0.05:20;
y = 0:0.05:15;
[x,y] = meshgrid(x,y);
z = (11-x-y).^2 + (1+x+10*y-x.*y).^2;
[C,h] =contour(x,y,z,10);
clabel(C,h)

gives

In Maple

f:=(11 - x - y)^2 + (1 + x + 10*y - x*y)^2:
plots:-contourplot(f, x=0..20, y=0..15,
         legend=true,
         contours=10,
         'axes'='boxed',
         legendstyle=[location=right], 
         colorscheme="DivergeRainbow");

Is there a way to tell Maple to put contour labels on the "middle" of the level lines (contour lines) similar to what Matlab does?

I see no such option in https://www.maplesoft.com/support/help/maple/view.aspx?path=plots/contourplot

I think I remeber doing this before but not sure and it is not in my cheat sheet.

Given an expression, I wanted to find all names in it. Which can be done using indets(f,name);

But then how to check if any of the names found are not in the Maple initial known names given in https://www.maplesoft.com/support/help/Maple/view.aspx?path=initialconstants

For example,

f:=x^2 - y^2+Pi;
indets(f,name);

Gives {Pi, x, y}  how does one then check if this list does not have any known name in it?

In this case Pi. I do not want to check explicitly for each name listed on the web page above.

Are these initial known names  grouped in some specific maple type that can be used to check against?

Or is there a command in Maple to return a list of all these initially known names? If so this list can be used to check against.

Asked google AI and it did not know.

Maple 2025.2

What does Error, (in dsolve/numeric/bvp) bad index into Matrix mean?
Also, I'm trying to run it, it is slow, any suggestions?

restart;
with(Student[VectorCalculus]);
with(DynamicSystems);
with(DEtools);
with(PDEtools, ReducedForm, declare, diff_table, dsubs);
NULL;
 #Digits:= trunc(evalhf(Digits)); #generally a very efficient setting

# Here we solve a 1D problem in 3 regions. In each region, we have concentration and potential (c,phi) distributions,
# We first solve the unperturbed steady-state problem and then the linearized perturbation problem (which rely on the steady state).
# Each region is defined in x = 0..1, and the regions are connected by interface conditions that 
# connect (c1(1),phi1(1)) to (c2(0),phi2(0)) and (c2(1),phi2(1)) to (c3(0),phi3(0))

Q:=10;   omega:=100;     J0:= 0.01;   # parameters
                            Q := 10

                          omega := 100

                           J0 := 0.01

# The unperturbed steady-state

c1:=1-J0/2*x: 
c3:=1-J0/2*(x-1):  
c12:= eval(c1,x=1); 
c32 := eval(c3,x=0); 
S1:=sqrt(Q^2+4*c12^2): 
S3:=sqrt(Q^2+4*c32^2):  
c21:=eval((S1-Q)/2); 
c23:=eval((S3-Q)/2);  
I0:=fsolve(Q*i0/2/J0*ln((J0*S1-Q*i0)/(J0*S3-Q*i0))=(J0-S1+S3)/2,i0);  
V:=(I0/J0+1)*ln(c32/c12)+ln((c21+Q)/(c23+Q))+(J0+2*c23-2*c21)/Q; # the potential drop across the system 
c2:=solve(y-c21+Q*I0/2/J0*ln((Q*I0-Q*J0-2*J0*y)/(Q*I0-Q*J0-2*J0*c21))=-J0/2*x,y):  
phi1:=I0/J0*ln(c1)+V: 
phi3:=I0/J0*ln(c3): 
dphi1:=diff(phi1,x); 
dphi3:=diff(phi3,x); 
phi21:=I0/J0*ln(c12)+V-0.5*ln((c21+Q)/c21); 
phi2:=(2*c21-2*c2+Q*phi21-J0*x)/Q: 
dphi2:=diff(phi2,x); 
dphi12 := eval(dphi1, x=1); 
dphi21 := eval(dphi2, x=0); 
dphi23 := eval(dphi2, x=1); 
dphi32 := eval(dphi3, x=0); 
INT1 := int(1/(2*c1), x = 0 .. 1); 
INT2 := int(1/(2*c2 + Q), x = 0 .. 1); 
INT3 := int(1/(2*c3), x = 0 .. 1); 
INT := INT1 + INT2 + INT3;
                      c12 := 0.9950000000

                       c32 := 1.005000000

                      c21 := 0.09804129000

                      c23 := 0.1000024500

                      I0 := 0.01419804328

                       V := 0.02539628566

                              0.007099021640   
                dphi1 := - --------------------
                           1 - 0.005000000000 x

                              0.007099021640        
           dphi3 := - ------------------------------
                      1.005000000 - 0.005000000000 x

                     phi21 := -2.299074561

dphi2 := (0.001000000000 LambertW(-0.2818670588 exp(-0.2818670588

   - 0.0007043224058 x)))/(1

   + LambertW(-0.2818670588 exp(-0.2818670588 - 0.0007043224058 x)

  )) - 0.001000000000


                   dphi12 := -0.007134695118

                   dphi21 := -0.001392499832

                   dphi23 := -0.001391964358

                   dphi32 := -0.007063703124

                      INT1 := 0.5012541824

                     INT2 := 0.09805801917

                      INT3 := 0.4987541511

                       INT := 1.098066353


sys1 := {
-omega*C11(x)+diff(diff(C12(x), x), x)=0,
omega*C12(x)+diff(diff(C11(x), x), x) = 0,
-omega*C21(x)+diff(diff(C22(x), x)+(c2*sigma2-C22(x)*dphi2*Q)/(2*c2+Q), x) =0,
 omega*C22(x)+diff(diff(C21(x), x)+(c2*sigma1-C21(x)*dphi2*Q)/(2*c2+Q), x) = 0,
-omega*C31(x)+diff(diff(C32(x), x), x)=0,
omega*C32(x)+diff(diff(C31(x), x), x) = 0
}:

sys2 := {
diff(FA1(x), x) = C11(x)*dphi1/c1,
diff(FA2(x), x) = C21(x)*dphi2/(c2+Q/2),
diff(FA3(x), x) = C31(x)*dphi3/c3,
diff(FB1(x), x) = C12(x)*dphi1/c1,
diff(FB2(x), x) = C22(x)*dphi2/(c2+Q/2),
diff(FB3(x), x) = C32(x)*dphi3/c3
}: 

Bc := {
C11(0) = 0, C12(0) = 0,  C31(1) = 0, C32(1) = 0,
FA1(0) = 0, FB1(0) = 0,  FA3(1) = 0, FB3(1) = 0, 

2*C11(1)/c12 = C21(0)/(c21+Q)+C21(0)/c21, 
2*C12(1)/c12 = C22(0)/(c21+Q)+C22(0)/c21,
C21(1)/(c23+Q)+C21(1)/c23 = 2*C31(0)/c32,
C22(1)/(c23+Q)+C22(1)/c23 = 2*C32(0)/c32,

D(C11)(1)+dphi12*C11(1)-sigma1/2-c12*D(FA1)(1) = D(C21)(0)+dphi21*C21(0)-(c21+Q)*sigma1/(2*c21+Q)-(c21+Q)*D(FA2)(0),
D(C12)(1)+dphi12*C12(1)-sigma2/2-c12*D(FB1)(1) = D(C22)(0)+dphi21*C22(0)-(c21+Q)*sigma2/(2*c21+Q)-(c21+Q)*D(FB2)(0),
D(C11)(1)-dphi12*C11(1)+sigma1/2+c12*D(FA1)(1) = D(C21)(0)-dphi21*C21(0)+c21*sigma1/(2*c21+Q)+c21*D(FA2)(0),
D(C12)(1)-dphi12*C12(1)+sigma2/2+c12*D(FB1)(1) = D(C22)(0)-dphi21*C22(0)+c21*sigma2/(2*c21+Q)+c21*D(FB2)(0),

D(C31)(0)+dphi32*C31(0)-sigma1/2-c32*D(FA3)(0) = D(C21)(1)+dphi23*C21(1)-(c23+Q)*sigma1/(2*c23+Q)-(c23+Q)*D(FA2)(1),
D(C32)(0)+dphi32*C32(0)-sigma2/2-c32*D(FB3)(0) = D(C22)(1)+dphi23*C22(1)-(c23+Q)*sigma2/(2*c23+Q)-(c23+Q)*D(FB2)(1),
D(C31)(0)-dphi32*C31(0)+sigma1/2+c32*D(FA3)(0) = D(C21)(1)-dphi23*C21(1)+c23*sigma1/(2*c23+Q)+c23*D(FA2)(1),
D(C32)(0)-dphi32*C32(0)+sigma2/2+c32*D(FB3)(0) = D(C22)(1)-dphi23*C22(1)+c23*sigma2/(2*c23+Q)+c23*D(FB2)(1)
}:
 
 


all_sys := sys1 union sys2 union Bc:
sol1 := dsolve(all_sys, initmesh = 100, maxmesh = 15000, numeric, method = bvp[midrich], output = listprocedure):
#(all_sys, numeric, method = bvp[midrich]);

Error, (in dsolve/numeric/bvp) bad index into Matrix

Hello,

 I would like to bulild a Gaussian Mixture Model in Maple using the most straightforward apprach:

Apperantly something goes wrong, PDF in (5) is a product not a sum and variance is quadratic in w (6) not linear as it should be.

How to correct this?

Helllo folkx :)

What is wrong in my functions f and g ?

I don't catch the point.

Thanks.

JM--

interface(version);
    Standard Worksheet Interface, Maple 2025.2, Windows 11,
     November 11 2025 Build ID 1971053

with(RandomTools):

Generate(float(range = 2.532000 .. 7.723000, digits = 4));
                             2.537

f := x -> Generate(float(range = 0 .. 100)):

f(30);
                            94.3141

f(0.200000);
                            23.9622

randomize();
                         2413841372727

f(30);
                            86.2657

plot(f(x), x = 1 .. 100.000000);

plots[listplot](sort([seq(Generate(float(range = 0.032100 .. 162.000000, digits = 3)), i = 1 .. 20)]));

plots[listplot](sort([seq(Generate(float(range = 0.032100 .. 162.000000, digits = 3, method = uniform)), i = 1 .. 20)]));

g := ((x -> Generate(float(range = 0 .. x))) assuming (x*float and 0 < x)):

plot(g(x), x = 1 .. 50);
Error, (in RandomTools:-Generate) invalid input: unknown expects value for keyword parameter range to be of type numeric .. numeric, but received 0 .. x

Is the following behavior expected? using  t=0 .. 3*Pi  vs.  t=0 .. round(3*Pi) give different plots.  Why? Should not the plot be the same?

ps. do not know if I asked this before or not. I can't remember. Search in Mapleprimes is not easy.

interface(version);

`Standard Worksheet Interface, Maple 2025.2, Windows 10, November 11 2025 Build ID 1971053`

restart;

ode := diff(y(t), t$2) + y(t)=0;
DEtools:-DEplot(ode, y(t), t=0 .. 3*Pi, y=-1 .. 1,[[y(0)=1,D(y)(0)=0]],linecolor=blue);

diff(diff(y(t), t), t)+y(t) = 0

DEtools:-DEplot(ode, y(t), t=0 .. round(3*Pi), y=-1 .. 1,[[y(0)=1,D(y)(0)=0]],linecolor=blue);

 

 

Download deplot_with_round_jan_17_2026.mw

Would this be considered a bug or expected?

Everytime I see internal error in red, for me, it tells me it is a bug. But wanted to check first what others think.

restart;

interface(version);

`Standard Worksheet Interface, Maple 2025.2, Windows 10, November 11 2025 Build ID 1971053`

ode:=x^2*diff(y(x), x$2) + (cos(x)-1)*diff(y(x), x) + exp(x)*y(x) = 0;
sol:=dsolve(ode,y(x),type='series',x=0):
sol1:=eval(%, _C2=0):
sol2:=eval(%%, _C1=0):

x^2*(diff(diff(y(x), x), x))+(cos(x)-1)*(diff(y(x), x))+exp(x)*y(x) = 0

Y:= unapply(rhs(sol1), x):
eval(lhs(ode), y=Y):
MultiSeries:-asympt(%, x);

Error, (in simpl/min) non-real argument to max/min: -13/2+1/2*I*3^(1/2)

Y:= unapply(rhs(sol2), x):
eval(lhs(ode), y=Y):
MultiSeries:-asympt(%, x);

Error, (in simpl/min) non-real argument to max/min: -13/2-1/2*I*3^(1/2)

 

 

Download asympt_none_real_argument_jan_17_2026.mw

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