Featured Post

We've reached quite a rhythm with Maple Flow - we update frequently, we add lots of improvements and we move fast.

What does this mean for you? It means that the feedback loop between development, the user experience and course correction has a fast time constant.

Without you being loud and vociferous, the feedback loop breaks. So don't be shy - tell us what you want!.

The new 2025.2 update builds on the theme of connectivity with two popular tools - Excel and Python. On top of that, we also have many other features and fixes that you've asked for.

Earlier versions of Maple Flow let you 

With the 2025.2 update, you can now copy and paste data from Excel into a Flow worksheet.

To be blunt, this is type of cross-application copy-paste behaviour is a no-brainer. It's such a natural workflow.

We've increasignly found that Python is now being used to script the interaction and data flow between different engineering tools. With Maple Flow 2025.2, you can now execute Maple Flow worksheets from a Python script. 

From Python, you can change and export any parameters and results defined in the worksheet

This gives me the dopamine hit of watching CPU utilization spike in the Task Manager (hey..I get my kicks where I can)

You can now do your parameter sweeps more quickly by executing the same worksheet in parallel, changing parameters for every run.

This is easy to set up - no special programming is needed.

  • Print Extents can now be set globally for all sessions, or just for the current session.
  • Any user-installed fonts used in the worksheet are now respected in the PDF export
  • Worksheets execute faster
  • The update includes fixes to many user-reported issues

You can install the Flow 2025.2 update via Help > Check for Updates (or if you're not already in the race, then grab a trial here and take Flow for a spin).

We're not pulling back on this aggresive development velocity, but we need you to point us in the right direction. Let's keep the feedback time constant small!

Featured Post

21880

This post was inspired by the following discussion thread  https://mapleprimes.com/questions/242266-Count-The-Number-Of-Paths , which considered the problem of finding all Hamiltonian paths on an integer lattice in R^2 that connect two distinct vertices. The  AllPaths  procedure solves a more general problem: it finds all self-disjoint paths connecting two distinct vertices not only in the plane  R^2  but also in space  R^3 . Of course, it also finds all Hamiltonian paths or allows one to determine their absence. The procedure does not use commands from GraphTheory package (only direct manipulation of sets and lists).
Required parameters of the procedure: is a set or list of lattice vertices specified by their coordinates, Start and Finish are the initial and final vertices. Optional parameter R (defaults it's NULL  if all paths are searched) and any symbol (if only Hamiltonian paths are searched). S can be either a rectangular integer lattice or a union of several such lattices.

Code of the procedure:

restart;
AllPaths:=proc(S::{set(list),listlist},Start::list,Finish::list,R::symbol:=NULL)
local N:=nops(S), S1:=convert(S, set), L, n, m, k, i, j, s, p, q, P, a, b, c;

L:={[Start]};
for n from 2 to N do

if R=NULL then

P:='P';
m:=nops(L);
for k from 1 to m do
if nops(Start)=2 then
i,j:=L[k][-1][];
s:={[i-1,j],[i,j+1],[i+1,j],[i,j-1]} else
a,b,c:=L[k][-1][];
s:={[a-1,b,c],[a,b+1,c],[a+1,b,c],[a,b-1,c],[a,b,c-1],[a,b,c+1]} fi; 
s:=`intersect`(s,S1) minus convert(L[k],set);
if s={} and L[k][-1]=Finish then P[k]:=L[k] else
if s={} and L[k][-1]<>Finish then P[k]:=NULL else
P[k]:=`if`(L[k][-1]=Finish,L[k],seq([L[k][],s[i]],i=1..nops(s)))  fi; fi;
od;
L:=convert(P,set) else

P:='P';
m:=nops(L);
for k from 1 to m do
if nops(Start)=2 then
i,j:=L[k][-1][];
s:={[i-1,j],[i,j+1],[i+1,j],[i,j-1]} else
a,b,c:=L[k][-1][];
s:={[a-1,b,c],[a,b+1,c],[a+1,b,c],[a,b-1,c],[a,b,c-1],[a,b,c+1]} fi;
s:=`intersect`(s,S1) minus convert(L[k],set);
if n<N then 
if s={} or L[k][-1]=Finish then P[k]:=NULL else
P[k]:=seq([L[k][],s[i]],i=1..nops(s)); fi else 
if L[k][-1]=Finish and s<>{} then P[k]:=NULL else P[k]:=seq([L[k][],s[i]],i=1..nops(s));
fi; fi;  
od;
L:=convert(P,set)

fi; od;

L;
end proc:


Examples of use.

In the first example from the post above, we find the number of Hamiltonian paths in 

L:=CodeTools:-Usage(AllPaths({seq(seq([i,j], i=1..11), j=1..3)}, [2,2], [10,2], 'H')):
nops(L);

   

In this same example, we find the number of all paths from A to B and the possible lengths of these paths.

L:=CodeTools:-Usage(AllPaths({seq(seq([i,j], i=1..11), j=1..3)}, [2,2], [10,2])):
nops(L);
map(t->nops(t), L);
L1:=select(t->nops(t)=%[-1], L):
nops(L1);

  

In the following example, we find the number of all paths, as well as the number of Hamiltonian paths, and animate these paths (total 24 one's).

S:={seq(seq([i,j],i=1..5),j=1..3)} union {seq(seq([i,j],i=4..7),j=3..5)}: A:=[1,1]: B:=[7,5]:
P:=plots:-display(plots:-pointplot(S, symbol=solidcircle, color=blue, symbolsize=15, view=[0..7.5,0..6.5], size=[600,500], scaling=constrained), plots:-textplot([[A[],"A"],[B[],"B"]], font=[times,bold,22], align=[left,above])):
L:=AllPaths(S,A,B):
nops(L);
map(t->nops(t), L);
L1:=select(t->nops(t)=%[-1], L):
nops(L1);
plots:-animate((plots:-display)@(plottools:-curve),[L1[round(a)], color=red, thickness=4], a=1..%, frames=180, background=P, size=[700,500], paraminfo=false);

                                      

                   

In the final example, we search for Hamiltonian paths in a lattice defined on the surface of a cube. Imagine a cube made of wires, and an ant must crawl along these wires from point  A(0,0,0)  to point B(2,2,2) , visiting all nodes of this lattice. Is this possible? We see that it is not. The length of the maximum path is 25, and this lattice has 26 vertices. An animation of one of the maximum paths is provided.

                           

S:={seq(seq(seq([i,j,k],i=0..2),j=0..2),k=0..2)} minus {[1,1,1]}: A:=[0,0,0]: B:=[2,2,2]:
P:=plots:-display(plots:-pointplot3d(S, symbol=solidcircle, color=blue, symbolsize=20, scaling=constrained), plots:-textplot3d([[A[],"A"],[B[],"B"]], font=[times,bold,22], align=[left,above]), plottools:-curve([[2,0,1],[2,2,1],[0,2,1],[0,0,1],[2,0,1]], color=black,thickness=0),plottools:-curve([[1,0,2],[1,0,0],[1,2,0],[1,2,2],[1,0,2]], color=black, thickness=0),plottools:-curve([[2,1,0],[0,1,0],[0,1,2],[2,1,2],[2,1,0]], color=black,thickness=0), tickmarks=[3,3,3]):
L:=AllPaths(S,A,B):
nops(L);
map(t->nops(t), L);
L1:=select(t->nops(t)=%[-1], L):
nops(L1);
plots:-animate((plots:-display)@(plottools:-curve),[L1[-1][1..round(a)], color=red, thickness=4], a=1..25, frames=240, background=P, paraminfo=false, axes=box, labels=[x,y,z]);

       

                              

We can see from this animation that the path does not pass through the vertex (0, 2, 2) .

Edit. A code error that could cause incorrect operation when using the  R  option has been fixed. Everything now works correctly. If there is no Hamiltonian path passing through all vertices, the procedure returns the empty set { } .

Paths1.mw



How to solve x^4-12*x-12=0

Maple asked by Cristian... 0 March 08