Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I am trying to plot a function where one of the variables is determind via a procedure that uses fsolve and depends on some parameters. When I go to try and make a plot using Explore to vary the parameters I get the following error:
"in fsolve  S  is in the equation, and is not solved for"
My worksheet is seen below:

restart;

 

T := 2^(2/3)*(16*CC(S,mu,Z,Pr)^2*Pi^2 + 2*Pi^2*Z^2 + 16*Pi*S*CC(S,mu,Z,Pr) + 3*S^2)*Pr^(1/3)/(4*(4*CC(S,mu,Z,Pr)*Pi + S)^(2/3)*(2*Pi^2*Z^2 + 4*Pi*S*CC(S,mu,Z,Pr) + S^2)^(2/3)*CC(S,mu,Z,Pr)^(1/3)*Pi^(2/3))

(1/4)*2^(2/3)*(16*CC(S, mu, Z, Pr)^2*Pi^2+2*Pi^2*Z^2+16*Pi*S*CC(S, mu, Z, Pr)+3*S^2)*Pr^(1/3)/((4*CC(S, mu, Z, Pr)*Pi+S)^(2/3)*(2*Pi^2*Z^2+4*Pi*S*CC(S, mu, Z, Pr)+S^2)^(2/3)*CC(S, mu, Z, Pr)^(1/3)*Pi^(2/3))

(1)

 

mu = 2^(2/3)*S*(16*C^2*Pi^2 - 2*Pi^2*Z^2 - S^2)*Pr^(1/3)/(4*(4*C*Pi + S)^(2/3)*(2*Pi^2*Z^2 + 4*C*Pi*S + S^2)^(2/3)*C^(4/3)*Pi^(2/3))

mu = (1/4)*2^(2/3)*S*(16*C^2*Pi^2-2*Pi^2*Z^2-S^2)*Pr^(1/3)/((4*C*Pi+S)^(2/3)*(2*Pi^2*Z^2+4*C*Pi*S+S^2)^(2/3)*C^(4/3)*Pi^(2/3))

(2)

CC:=proc(S,mu,Z,Pr)
fsolve((2),C,C=0.01..100)
end proc;

proc (S, mu, Z, Pr) fsolve(mu = (1/4)*2^(2/3)*S*(16*C^2*Pi^2-2*Pi^2*Z^2-S^2)*Pr^(1/3)/((4*C*Pi+S)^(2/3)*(2*Pi^2*Z^2+4*C*Pi*S+S^2)^(2/3)*C^(4/3)*Pi^(2/3)), C, C = 0.1e-1 .. 100) end proc

(3)

CC(1,0,0.5,0.2)

.1938622552

(4)

Explore(plot(T,0..15),parameters=[[mu=0 .. 1,minorticks=0.25],[Z=0..0.5,minorticks=0.1],[Pr=0..1,minorticks=0.25]])


When I try to move the sliders on my parameters this is where I get the error. I want to plot over S, but I can only get CC once I have all the other values including S. I assume it has something to do with the fact that my plotting variable is in the procedure?

Any help would be greatly appreciated, thanks. 

Download Explore_Plot_Problem.mw

A note on what I've been working on for the past while. Some of you may have seen the announcement on LinkedIn yesterday; this is for the home audience.

The question I've been chasing is the one that's underneath the Physics package, the dsolve / pdsolve formal methods and heuristics, the advanced Mathematical Functions and FunctionAdvisor, and most of what I've written for Maple over the years. How can mathematicians and physicists speed up significantly their work using Computer Algebra Systems (CAS) and at the same time trust the result a computer hands back? The new chapter is what happens when AI sits between the human and the CAS, and the answer to that, in my view, turns out to be a much harder problem than the AI hype suggests.

Why? Because AI is increasingly the driver of computational mathematics in research, engineering, and education. The Mathematica and Maple code those AIs increasingly depend on is the same code I spent decades building. And the unsolved problem isn't whether AI can do mathematics. It can. The problem is that an incorrect AI result arrives with the same confidence as a correct one.

On 100 challenging problems of undergraduate mathematics we tested, six independent state-of-the-art AIs returned mathematically equivalent answers on only 21% of them, and even within a single AI, repeated runs disagreed with themselves on 3% to 57% of the problems (details). The gap this validation crosses, between probabilistic inference and certified computation, is epistemological, not technological. It won't close with more training data. It needs validation across multiple AIs and multiple CAS, with no single engine having the final word.

ExaktAI addresses that gap. It guides AI through mathematical computation, validates each step against Maple and Mathematica, and delivers an executable document where you can audit, reproduce, and edit the result. The goal: to have AI-mathematics that is validated, where the human in the loop is non-negotiable.

ExaktAI is now well developed (TRL 6: System prototype demonstration in a simulated environment, on the ISED / Innovative Solutions Canada TRL scale). At the end an image. A Beta is scheduled for late summer / fall 2026; details at exaktai.ai.

In summary: ExaktAI is my present, and if you work on AI for mathematics and computer algebra, or the validation problem for AI, I'd love to hear your perspective.



Edgardo S. Cheb-Terrab
ExaktAI
Research Fellow Emeritus at Maplesoft.

Para_1.mw.  please help to correct this error.

It seems that in Maple 2025+ on Windows 11, the SMTLIB package is not working. For example:

SMTLIB:-Satisfiable( {x^2+y^2+z^2<1, x*y*z>1} ) assuming real;

complains about error loading external library mplsmtlib.dll.

Is there an explanation, or a workaround?

I have usually used $include within a module when building packages, where the included file has all the procedures.

What I would like to have is to have the module itself in an external file which would be included.

read "this:///lib/NODEFunctions";
savelib('NODEFunctions', "this://");

$include "NODEXML.mm"
# read "this:///lib/NODEXML";
savelib('NODEXML', "this://");

The first 2 lines show the usual way I do it, where NODEFunctions is a module within the Maple file. In that file there is an $include for the proc() parts only.

The second attempt unfortunatly throws a "Error, unexpected string" error. I have tried both with and with a ; at the end of the $include line.

"NODEXML.mm" is a file with the complete module definition with proc().

I am currently working with inert integrals and summations in Maple, and I encountered a difficulty when manipulating symbolic expressions. I would appreciate any suggestions or recommended approaches.

Specifically, I would like to achieve the following:

  1. Convert an inert expression in the form of a “summation inside an integral” into an equivalent “sum of integrals” form.
    In other words, transform expressions of the type:
    Int(i=1∑n​fi​(x,t),x=a..b)

    into
    ∑​Int(fi​(x,t),x=a..b)

    while preserving the inert (Int) representation rather than evaluating the integral directly.

    I have tried commands such as value, expand, convert, and related manipulation methods, but I have not yet found a suitable solution.
     

  2. The integrand contains two variables, where xxx is the integration variable.
    How can terms that are independent of xxx be automatically extracted outside the inert integral? For example, if the integrand contains coefficients or functions depending only on ttt, I would like Maple to rewrite
    Int(g(t)f(x),x=a..b)

    as g(t)Int(f(x),x=a..b)

    without forcing evaluation of the inert integral.

    Any recommendations, built-in commands, or pattern-based approaches would be greatly appreciated.
    question525.mw

Hi,

I need to run the following procedure a couple of million times. Although it works, Maple sometimes chokes for no apparent reason (if there is a reason, please let me know). I was wondering whether an expert could help me tweak the procedure (or possibly rewrite it) to achieve the best possible performance. I am planning to use Grid:-Map or, if possible, Threads:-Map.

 

generateNonlinearModelsPlus := proc(model::list,fullmodel::list,vars::list:=[x,y,z])
description "This function generates a list of all models with one more monomial from the full model":
local tab::table(),n:=nops(model),i,j,k:=1,ans,terms,aaa,allmoncoefThreads:
# local procedure
allmoncoefThreads := proc(f::list,vars::list)
description "This function finds the monomials multipled by their coefficients for each expression (equation) of a list.":
local n:=numelems(f),i,mon:=[seq](0,i=1..n),M,cc:=[seq](0,i=1..n),ans:
for i from 1 to n do
  cc[i]:=[coeffs](expand(f[i]),vars, 'M'):
  mon[i]:=[M]:
end do:
ans:=[seq](zip((ww,vv)->ww*vv,cc[i],mon[i]),i=1..n):
return(ans)
end proc:
# main part
ans:=zip((w,v)->expand(simplify(v-w)),model,fullmodel): # Find the monomials that are not in model
terms:=allmoncoefThreads(ans,vars): # Separate the monomials
#
for i from 1 to n do
   aaa:=model:
   for j from 1 to nops(terms[i]) do
       aaa[i]:=model[i]+terms[i,j]:
       tab[k]:=aaa:
       k:=k+1:
   end do:
end do:
tab:=convert(tab,list):
return(tab):
end proc:

Here is an example of how I run it: 

model:=[y*alpha[1, 2], z*alpha[2, 3], x^3*alpha[3, 10] + x*alpha[3, 1] + alpha[3, 0]]:

fullmodel:=[x^3*alpha[1, 10] + x^2*y*alpha[1, 11] + x^2*z*alpha[1, 12] + x*y^2*alpha[1, 13] + x*y*z*alpha[1, 14] + x*z^2*alpha[1, 15] + y^3*alpha[1, 16] + y^2*z*alpha[1, 17] + y*z^2*alpha[1, 18] + z^3*alpha[1, 19] + x^2*alpha[1, 4] + x*y*alpha[1, 5] + x*z*alpha[1, 6] + y^2*alpha[1, 7] + y*z*alpha[1, 8] + z^2*alpha[1, 9] + x*alpha[1, 1] + y*alpha[1, 2] + z*alpha[1, 3] + alpha[1, 0], x^3*alpha[2, 10] + x^2*y*alpha[2, 11] + x^2*z*alpha[2, 12] + x*y^2*alpha[2, 13] + x*y*z*alpha[2, 14] + x*z^2*alpha[2, 15] + y^3*alpha[2, 16] + y^2*z*alpha[2, 17] + y*z^2*alpha[2, 18] + z^3*alpha[2, 19] + x^2*alpha[2, 4] + x*y*alpha[2, 5] + x*z*alpha[2, 6] + y^2*alpha[2, 7] + y*z*alpha[2, 8] + z^2*alpha[2, 9] + x*alpha[2, 1] + y*alpha[2, 2] + z*alpha[2, 3] + alpha[2, 0], x^3*alpha[3, 10] + x^2*y*alpha[3, 11] + x^2*z*alpha[3, 12] + x*y^2*alpha[3, 13] + x*y*z*alpha[3, 14] + x*z^2*alpha[3, 15] + y^3*alpha[3, 16] + y^2*z*alpha[3, 17] + y*z^2*alpha[3, 18] + z^3*alpha[3, 19] + x^2*alpha[3, 4] + x*y*alpha[3, 5] + x*z*alpha[3, 6] + y^2*alpha[3, 7] + y*z*alpha[3, 8] + z^2*alpha[3, 9] + x*alpha[3, 1] + y*alpha[3, 2] + z*alpha[3, 3] + alpha[3, 0]]:

vars:=[x,y,z]:

ans:=generateNonlinearModelsPlus(model,fullmodel,vars)

Many thanks.

For quite some time, I have wanted to solve the system attached in "test" using Maple. The smallest solution in natural numbers x, y, and z test.mw

restart

kernelopts(version)

`Maple 2026.0, X86 64 WINDOWS, Apr 28 2026, Build ID 2011354`

(1)

interface(version)

`Standard Worksheet Interface, Maple 2026.1, Windows 11, April 28 2026 Build ID 2011354`

(2)

with(NumberTheory)

isolve({x*y*z = w^2, x+y+z = u^2, x*y+x*z+y*z = v^2})

{u = _Z1, v = 0, w = 0, x = _Z1^2, y = 0, z = 0}

(3)

"(->)"

{u = _Z1, v = 0, w = 0, x = _Z1^2, y = 0, z = 0}

(4)

``

Download test.mw

is known, and all these numbers are less than 4 × 10¹². Is this possible in Maple?

(x=1633780814400; y=252782198228; z=3474741058973)



M being some sparse matrix, plots:-sparsematrixplot(M) displays a patchwork of squares with two different colors: one for elements of M different 0 and the other for elements of M equal to 0.
The squares are separated by what visually appears like blank lines (in fact tere are no such lines, just gaps between the different squares making them not adjacent).

So my question: Is it possible, without resorting to any workaround based upon PLOT(POLYGONS(..)) or plottools functions (I know how to write such workarounds and I'm not interested in that) to suppress these "white lines", or otherwise said to make the squares adjacent? 
I thought that maybe some (hidden?) option acting like style=patchnogrid could exist, or to an undocumented feaure...

Thanks for your reply.

The title is the question. I am fairly certain that Maple in itself (up to 2023) does not have this. There is of course Statistics:-Histogram, but that is a 1-D histogram only.

Given 2 Vectors of floats, say, xvec[n] and yvec[n]. The idea would be to divide up a 2-D grid into "pixels" that accumulate a count when (xvec[i],yvec[i]) falls into the range for a pixel (xrange,yrange). Plotting each of these pixels as rectangular column creates the histogram.

I could of course program one myself, but as I am lazy and this seems like a common kind of plot (at least in statistics and in physics), someone may well have done such a thing. DDG search did not find anything, at least not wrt. Maple.

Here is an example plot close to what I am thinking of (random plot pulled off the web). The color scheme of the plot is not what I am after (although it does look nice).

Lego plot of a 600MeV/A Si track. Empty pixels (i.e. TOT count = 0) are ...

 
Thanks in advance,
Mac Dude

Hi MaplePrimes, and all,

Here is a new, to me, set of numbers
defined by ,
the first three numbers are {1,2,3}
and then, 
the next number is the sum of the three 
previous numbers,
so,
{1,2,3,6,11,20, ... }
but can only calculate a finite number of numbers
the, so called, Tribonacci numbers
could start with {0,1,0}
see online
https://oeis.org/A001590

and
triple_recursive_sequence_simple_first.mw

triple_recursive_sequence_simple_first.pdf

regards,
Matt
 

Here is a snippet of code that returns an error message. The details of the h procedure should be irrelevant.

h:=proc(k,x)
local z,w;
nans(parameters=[k,x]);
z:=nans(0.98);
w:=rhs(z[2]),rhs(z[3])
end proc;
 h := proc (k, x) local z, w; nans(parameters = [k, x]); z := 

    nans(.98); w := rhs(z[2]), rhs(z[3]) end proc;


h(7.7,0.3);
0.310903619302454933005944397083, 0.731944275983583692659532399302

plot([h(7.7,x),x=0..30]);
Error, (in dsolve/numeric/process_parameters) 'parameters' must be specified as a list of numeric values

Note that the line h(7.7,0.3); is just there to show that h functions well. It accepts 2 numerical inputs and spits out a pair of numerical values.

Why is plot not plotting? Why is plot asking about inner workings of h?

If I try

f:=proc(x,y)

cos(x),sin(x*y) 
end proc;
plot([f(x,7.7),x=0..3]);
that woks fine. Plot does not inquire about f.

I am trying to select from a default list and a modified list to get a third combined list of the unmodified default elements and the mdfified elements plus extra elements. This is for plot data. I have managed to extract the colour data using something I did a couple of years ago. Though at this stage I don't relly know how that works either but it works.

restart

with(ListTools)

[BinaryPlace, BinarySearch, Categorize, Classify, Collect, Deal, DotProduct, Enumerate, FindMaximalElement, FindMinimalElement, FindRepetitions, Flatten, FlattenOnce, Group, Interleave, InversePermutation, Join, JoinSequence, LengthSplit, MakeUnique, Occurrences, Pad, PartialSums, Reverse, Rotate, Search, SearchAll, SelectFirst, SelectLast, Slice, Sorted, Split, Transpose, Unpermute]

(1)

PlotDefaults:=['colour' = ':-blue', symbol = ':-solidcircle', ':-symbolsize' = 8,thickness=2]; #for points and lines

[colour = blue, symbol = solidcircle, symbolsize = 8, thickness = 2]

(2)

Inputs:=['color'=[red, black, blue],symbol=square,':-linestyle'=dash]; #'color'=[red, black, blue],

 

[color = [red, black, blue], symbol = square, linestyle = dash]

(3)

if has(Inputs,{colour,color}) then
Colourlist:=remove(has,remove(has,Flatten(eval([':-color',':-colour'],Inputs)),':-colour'),':-color')
else
Colourlist:=remove(has,remove(has,Flatten(eval([':-color',':-colour'],PlotDefaults)),':-colour'),':-color');
end if

[red, black, blue]

(4)


Make this list

plotdata:=[symbol=square,':-linestyle'=dash,':-symbolsize' = 8,thickness=2]

[symbol = square, linestyle = dash, symbolsize = 8, thickness = 2]

(5)

mx:=max(nops(PlotDefaults),nops(Inputs))

4

(6)

Plotdata:=[];
for i to mx do

end do

 

 

[]

(7)
 

 

Download 2026-05-18_Q_Select_from_Two_Lists_to_get_New_List.mw

Currently I have Maple versions 2023,2025, and 2026 installed on Windows 11. Today I installed a workbook package containing a module that I just completed using the PackageTools installer in Maple 2026.. To my surprise, I found that a package installed from Maple 2026 was also available in Maple 2023 and, conversely, a package installed in Maple 2023 was automatically available in Maple 2026. i noticed that, with the exception of the Maple Customer Support Updates, the toolbox directory is no longer broken down by versions. I also noticed that the directory containing the module installed by Maple 2026 was named by the workbook instead of the module name (ie. hopfwords.maple). As I recall, the toolboxes used to be version dependent. 

The question is to what extent can one assume that a package created in Maple 2026 will be compatible with at least the more recent versions of Maple, I am also wondering why the directory name is now the workbook name instead of the module name. 

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