Maple 2021 Questions and Posts

These are Posts and Questions associated with the product, Maple 2021

Recently I saw a heated discussion on this post:https://www.mapleprimes.com/questions/233026-Write-Output-Of-For-Loop-To-txt-File

In Carl Love  's answer, I felt the power of adjacency matrix of graph. I carefully read maple's function to generate non IsomorphicGraphs:  NonIsomorphicGraphs. There was one passage that I thought was really interesting.

selectform = graph, adjacency, or bits
This specifies the form used for a graph when it is being passed to the select procedure. The forms are identical to those for outputform, but note that adjacency and bits are the most efficient forms, while graph is only reasonable for a relatively small number of comparison operations (1000 or less), as it needs to form a Graph for every comparison. Note also that when selectform=adjacency the same read-only Matrix is internally used to pass the data for every call to reduce overhead. This is not possible with a Graph structure.

I never quite understood what the advantage of this bits was. At least according to the help documentation, we have  to do many works to do to convert this into a adjacency matrix of graph.

[NonIsomorphicGraphs(8, output = graphs, restrictto = regular[2])]

bit := Vector[row](Bits:-Split(210256131, bits = (8*(8 - 1))/2));
M := Matrix(8, 8, shape = symmetric, datatype = integer[1]);
M[1, 2 .. 8] := bit[1 .. 7];

M[2, 3 .. 8] := bit[8 .. 13];

M[3, 4 .. 8] := bit[14 .. 18];
M[4, 5 .. 8] := bit[19 .. 22];

M[5, 6 .. 8] := bit[23 .. 25];

M[6, 7 .. 8] := bit[26 .. 27];
M[7, 8 .. 8] := bit[28 .. 28];
M;

From adjacency matrix of graph,  we can diractly get a lot of information about the graph, like edges, and the number of closed walks of a particular length, but from bits , what imformation of graph we can get?

If we have to convert it to an adjacency matrix fist, maybe it's a little bit more complicated from above long codes. At least there isn't a more efficient way to convert?

Hi,

I am generating several random weighted graphs using the following code:

with(GraphTheory):
with(RandomGraphs):
G:=RandomGraph(10,20,connected):
G1:=AssignEdgeWeights(G,5..25):
DrawGraph(G1,showlabels=true,stylesheet=[edgecolor=blue,weightfont = [times,bold,11]])

By default weight labels appear to be positioned at the midpoint of each edge. Is there a way to change that positioning?

Thanks!

Hey everyone ! 

I want to get the analytical function from a piecewise differential equation defined on 6 intervals but Maple returns me a numerical result... I think it hides a Runge Kutta method.. However, it returned me an analytical function for a similar piecewise differential equation defined on 3 intervals.

Do you know how I could get the analytical function defined on the 6 intervals ?

Thank you very much for your time ! 

Alex

eq := diff(Uy(x), x, x)-piecewise(x < d1, 12*F*x/(E*b*h^3), d1 < x and x < d2, 12*((F+F1)*x-F1*d1)/(E*b*h^3), d2 < x and x < d3, 12*((F+F1+F2)*x-F1*d1-F2*d2)/(E*b*h^3), d3 < x and x < d4, 12*((F5+F4-F)*x+F*L-F5*d5-F4*d4)/(E*b*h^3), d4 < x and x < d5, 12*((F5-F)*x+F*L-F5*d5)/(E*b*h^3), 12*F*(L-x)/(E*b*h^3))

diff(diff(Uy(x), x), x)-piecewise(x < d1, 12*F*x/(E*b*h^3), d1 < x and x < d2, 12*((F+F1)*x-F1*d1)/(E*b*h^3), d2 < x and x < d3, 12*((F+F1+F2)*x-F1*d1-F2*d2)/(E*b*h^3), d3 < x and x < d4, 12*((F5+F4-F)*x+F*L-F5*d5-F4*d4)/(E*b*h^3), d4 < x and x < d5, 12*((F5-F)*x+F*L-F5*d5)/(E*b*h^3), 12*F*(L-x)/(E*b*h^3))

(1)

dsolve({eq, Uy(0) = 0, Uy(L) = 0}, Uy(x))

assign(dsolve({eq, Uy(0) = 0, Uy(L) = 0}, Uy(x)))

Uy_sol := unapply(Uy(x), x)

proc (x) options operator, arrow; Uy(x) end proc

(2)

E := 210*10^9; L := 4; d1 := (1/6)*L; d2 := 2*L*(1/6); d3 := 3*L*(1/6); d4 := 4*L*(1/6); d5 := 5*L*(1/6); b := 0.1e-1; h := 0.5e-2

210000000000

 

4

 

2/3

 

4/3

 

2

 

8/3

 

10/3

 

0.1e-1

 

0.5e-2

(3)

eq

diff(diff(Uy(x), x), x)-piecewise(x < 2/3, 0.4571428572e-1*F*x, 2/3 < x and x < 4/3, 0.4571428572e-1*(F+F1)*x-0.3047619048e-1*F1, 4/3 < x and x < 2, 0.4571428572e-1*(F+F1+F2)*x-0.3047619048e-1*F1-0.6095238096e-1*F2, 2 < x and x < 8/3, 0.4571428572e-1*(F5+F4-F)*x+.1828571429*F-.1523809524*F5-.1219047619*F4, 8/3 < x and x < 10/3, 0.4571428572e-1*(F5-F)*x+.1828571429*F-.1523809524*F5, 0.4571428572e-1*F*(4-x))

(4)

dsolve({eq, Uy(0) = 0, Uy(L) = 0}, Uy(x))

Uy(x) = -(1/4)*(Int(Int(piecewise(_z1 < 2/3, (1142857143/25000000000)*F*_z1, _z1 < 4/3, (1142857143/25000000000)*F*_z1-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1, _z1 < 2, (1142857143/25000000000)*F*_z1-(380952381/6250000000)*F2-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1+(1142857143/25000000000)*_z1*F2, _z1 < 8/3, -(1142857143/25000000000)*F*_z1-(1219047619/10000000000)*F4-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*F4*_z1+(1142857143/25000000000)*_z1*F5, _z1 < 10/3, -(1142857143/25000000000)*F*_z1-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*_z1*F5, 10/3 <= _z1, -(1142857143/25000000000)*F*_z1+(1142857143/6250000000)*F), _z1 = 0 .. _z1), _z1 = 0 .. 4))*x+Int(Int(piecewise(_z1 < 2/3, (1142857143/25000000000)*F*_z1, _z1 < 4/3, (1142857143/25000000000)*F*_z1-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1, _z1 < 2, (1142857143/25000000000)*F*_z1-(380952381/6250000000)*F2-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1+(1142857143/25000000000)*_z1*F2, _z1 < 8/3, -(1142857143/25000000000)*F*_z1-(1219047619/10000000000)*F4-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*F4*_z1+(1142857143/25000000000)*_z1*F5, _z1 < 10/3, -(1142857143/25000000000)*F*_z1-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*_z1*F5, 10/3 <= _z1, -(1142857143/25000000000)*F*_z1+(1142857143/6250000000)*F), _z1 = 0 .. _z1), _z1 = 0 .. x)

(5)

Uy(x)[0]

Uy(x)[0]

(6)

assign(dsolve({eq, Uy(0) = 0, Uy(L) = 0}, Uy(x)))

Uy(x)[0]

(-(1/4)*(Int(Int(piecewise(_z1 < 2/3, (1142857143/25000000000)*F*_z1, _z1 < 4/3, (1142857143/25000000000)*F*_z1-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1, _z1 < 2, (1142857143/25000000000)*F*_z1-(380952381/6250000000)*F2-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1+(1142857143/25000000000)*_z1*F2, _z1 < 8/3, -(1142857143/25000000000)*F*_z1-(1219047619/10000000000)*F4-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*F4*_z1+(1142857143/25000000000)*_z1*F5, _z1 < 10/3, -(1142857143/25000000000)*F*_z1-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*_z1*F5, 10/3 <= _z1, -(1142857143/25000000000)*F*_z1+(1142857143/6250000000)*F), _z1 = 0 .. _z1), _z1 = 0 .. 4))*x+Int(Int(piecewise(_z1 < 2/3, (1142857143/25000000000)*F*_z1, _z1 < 4/3, (1142857143/25000000000)*F*_z1-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1, _z1 < 2, (1142857143/25000000000)*F*_z1-(380952381/6250000000)*F2-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1+(1142857143/25000000000)*_z1*F2, _z1 < 8/3, -(1142857143/25000000000)*F*_z1-(1219047619/10000000000)*F4-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*F4*_z1+(1142857143/25000000000)*_z1*F5, _z1 < 10/3, -(1142857143/25000000000)*F*_z1-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*_z1*F5, 10/3 <= _z1, -(1142857143/25000000000)*F*_z1+(1142857143/6250000000)*F), _z1 = 0 .. _z1), _z1 = 0 .. x))[0]

(7)

Uy(x < d1)

Uy(x < 2/3)

(8)

Uy(x)[x < d1]

(-(1/4)*(Int(Int(piecewise(_z1 < 2/3, (1142857143/25000000000)*F*_z1, _z1 < 4/3, (1142857143/25000000000)*F*_z1-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1, _z1 < 2, (1142857143/25000000000)*F*_z1-(380952381/6250000000)*F2-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1+(1142857143/25000000000)*_z1*F2, _z1 < 8/3, -(1142857143/25000000000)*F*_z1-(1219047619/10000000000)*F4-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*F4*_z1+(1142857143/25000000000)*_z1*F5, _z1 < 10/3, -(1142857143/25000000000)*F*_z1-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*_z1*F5, 10/3 <= _z1, -(1142857143/25000000000)*F*_z1+(1142857143/6250000000)*F), _z1 = 0 .. _z1), _z1 = 0 .. 4))*x+Int(Int(piecewise(_z1 < 2/3, (1142857143/25000000000)*F*_z1, _z1 < 4/3, (1142857143/25000000000)*F*_z1-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1, _z1 < 2, (1142857143/25000000000)*F*_z1-(380952381/6250000000)*F2-(380952381/12500000000)*F1+(1142857143/25000000000)*F1*_z1+(1142857143/25000000000)*_z1*F2, _z1 < 8/3, -(1142857143/25000000000)*F*_z1-(1219047619/10000000000)*F4-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*F4*_z1+(1142857143/25000000000)*_z1*F5, _z1 < 10/3, -(1142857143/25000000000)*F*_z1-(380952381/2500000000)*F5+(1828571429/10000000000)*F+(1142857143/25000000000)*_z1*F5, 10/3 <= _z1, -(1142857143/25000000000)*F*_z1+(1142857143/6250000000)*F), _z1 = 0 .. _z1), _z1 = 0 .. x))[x < 2/3]

(9)

NULL

Download cas_5v_F_inconnues.mw

Hi,

I try to display a different steps of an mathematical developpement with ShowSteps command, but But the command gives nothing in the new version Maple 2021?

Thanks for your Help

QShowSteps.mw

I do not know why int() on this integrand fails always first time, and works second time it is called. seems like something is not loaded correctly first time?

integrand:=(((-3*x^2-18*x-27)*exp(2)^2+(30*x^3+330*x^2+1170*x+1350)*exp(2)-75*x^4-1200*x^3-7050*x^2-18000*x-16875)*ln(x)+(12*x^2+54*x+81)*exp(2)^2+(-120*x^3-1106*x^2-3510*x-4050)*exp(2)+225*x^4+3560*x^3+20990*x^2+54000*x+50625)/((3*x^4+18*x^3+27*x^2)*exp(2)^2+(-30*x^5-330*x^4-1170*x^3-1350*x^2)*exp(2)+75*x^6+1200*x^5+7050*x^4+18000*x^3+16875*x^2):

print("First time");
int(integrand,x);

print("second time");
int(integrand,x);

Worksheet attached.

Update

Here is a movie. it is few minutes long. This happens by random and not each time. This movie shows the command starting from "restart" are repated 4 times. First two times, no error. Then the error shows up.  So it is random. Maybe it depends if Maple is busy with other things or not. I have each worksheet set to use its own server though. So I have no idea why this happens sometimes and not other times.

 

 

 

issue_int_nov_11_2021.mw

I think there is a problem here

restart;
the_integrand:=(((-2*x^2+2)*exp(exp(exp(3)))^2+(4*x^3-4*x)*exp(exp(exp(3)))-2*x^4-6*x^2+8)*exp(ln(x)-x^2)*ln(exp(exp(exp(3)))^2-2*x*exp(exp(exp(3)))+x^2+4)+((2*x^2-2)*exp(2)*exp(exp(exp(3)))^2+((-4*x^3+4*x)*exp(2)-2*x)*exp(exp(exp(3)))+(2*x^4+6*x^2-8)*exp(2)+2*x^2)*exp(ln(x)-x^2))/(exp(exp(exp(3)))^2-2*x*exp(exp(exp(3)))+x^2+4);

int(the_integrand,x,method=_RETURNVERBOSE)

#try MeijerG
int(the_integrand,x,method=MeijerG);

gives

I do not know if this known or not.

Maple 2021.1 on windows

This is Maple 2021.1 on windows.

===================
restart;
expr:=x^(6+1/3);
res:=series(expr,x=0,6);
==============

gives
        O(x^(19/3))

But type of the above is not series:

===========
type(res,'series');
        false
===========

Yet convert(res,polynom) works

================
convert(res,polynom)
          0
================

Which is correct conversion. But help says that

"convert/polynom
convert a series to polynomial form"

Notice, it says "series" there.

So the input must be type series. But Maple says
O(x^(19/3)) is not type series. I think this is wrong. The
type returned should be series. Now the type returned is 'function'
from the series command.

What Am I overlooking here?

fyi;

Maple 2021.1 on windows 10.

Screen in worksheet displays this (correct)

But latex generated when compiled using lualatex from TEXLIVE 2021 shows this

code 

sol:=(Vector(2, [x(t),y(t)])) = (Vector(2, [8*c[1]*exp((1/2+1/2*89^(1/2))*t)/(-3+89^(1/2))-8*c[2]*exp((1/2-1/2*89^(1/2))*t)/(3+89^(1/2))+2/11*t^2-3/11*exp(t)-2/121*t+23/1331,c[1]*exp((1/2+1/2*89^(1/2))*t)+c[2]*exp((1/2-1/2*89^(1/2))*t)-1/11*t^2-15/22*exp(t)+12/121*t-17/1331])):

sol:=simplify(sol);

latex(sol)

`Standard Worksheet Interface, Maple 2021.1, Windows 10, May 19 2021 Build ID 1539851`

`The "Physics Updates" version in the MapleCloud is 1105 and is the same as the version installed in this computer, created 2021, November 8, 23:55 hours Pacific Time.`

zip file attached include the latex file and worksheet used.

issue_latex_nov_6_2021.zip

restart; p := .5; n := 10; nseq := 2; with(Statistics); randomize(); x1 := seq(Sample(RandomVariable(BernoulliDistribution(p)), n), i = 1 .. nseq); x2 := seq(convert(x1[i], list), i = 1 .. nseq)

[HFloat(0.0), HFloat(1.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(1.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(1.0)], [HFloat(0.0), HFloat(1.0), HFloat(1.0), HFloat(1.0), HFloat(0.0), HFloat(0.0), HFloat(1.0), HFloat(0.0), HFloat(0.0), HFloat(0.0)]

(1)

x2[1]

[HFloat(0.0), HFloat(1.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(1.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(1.0)]

(2)

whattype(x2[1])

list

(3)

numboccur(x2[1], {0.})

0

(4)

NULL

But, when I plugged the list at (2) it works...  

numboccur([0., 0., 1., 1., 0., 0., 1., 0., 0., 0.], 0.)

7

(5)

``

NULL

NULL

Download numboccur.mwnumboccur.mw

restart;In this code "add" is a trouble.
A := Matrix([[1, 2, 1, 3], [1, 1, 2, 1], [1, -2, 5, -11]]);
cs := LinearAlgebra:-ColumnSpace(A);
cnames := [seq(c || j, j = 1 .. numelems(cs))];
cvals := seq(solve([entries(A[() .. (), k] -~ add(`*`~(cnames, cs)), 'nolist')], cnames)[], k = 1 .. op([1, 2], A));
seq(add*rhs~(cvals[k]) *~ cs, k = 1 .. op([1, 2], A));
add does not play its role. Why. Thank you.

The timelimit command of Maple can be used to do a computation if it uses less than a given amount of time, otherwise generating an error message that can be cought by try ... catch. Now my question is that there exists any similar command, but with a limitation on memory usage, not the time usage. I don't mean what datalimit in kernelopts can does, because I am not going to limit the memory usage of the whole Maple session, but just a command which may be used inside a larger procedure etc.

First sorry I didn't "invent" this series.It comes from another newsgroup which I will not tell.

It is irrelevant.

My question is twofold :

How to prove it with pen and paper that it diverges

How to prove it with Maple.

Maple seems very...quiet with this series.

Thanks a lot.

Kind regards to all

Jean-Michel

Universidad Metropolitana de Ciencias de la Educación
Santiago de Chile

Derivative operator on vectors of real variable (R3): applied to curvilinear motion with Maple and MapleSim

In the present work it will be demonstrated how the derivative operator acts in functions of real variable in the movement of a particle that performs a curvilinear trajectory; using the scientific software of the Maplesoft company known by the names Maple and MapleSim, because nowadays most university teachers (higher education) do not visualize the movement of the particle in real time as well as the results of the calculations of speed and acceleration simultaneously. The objectives achieved are to use the vector operator with the help of these programs. As a theoretical tool we will use the three-dimensional vector spaces of real variable with Newton's notation. The methodology we have used was native syntax and embedded components using block diagrams. For the case of particle motion we use the graphical programming proposed by MapleSim. Viable results were achieved for motivational effects and time reduction in complex calculations without neglecting innovation in physical sciences, for teachers in higher education and university students. This work is self-sustaining via Maple Cloud.

Lenin Araujo Castillo

Ambassador of Maple

I try to find kernel and image of a application whose i know the matrix.
restart;
with(LinearAlgebra);
A := Matrix([[1, 1, 1, -1], [-1, 1, -1, -1], [1, -1, -1, -1], [-1, -1, 1, 3]]);
k := op(NullSpace(A));#kernel
MatrixVectorMultiply(A, k);#check
C := op(ColumnSpace(A));
X := <x, y, z, t>;
F := MatrixVectorMultiply(A, X) - a*C[1] - b*C[2] - c*C[2];
G := op(convert(F, list));
solve({seq(G[i] = 0, i = 1 .. 4)}, {a, b, c}); why there is no solution ? Thank you.

simplified_MPH_to_RPM_to_engineering_units.mw

Good Morning,

I don't know why I have such difficulties with rotational units, esp the 2*pi conversions with radians and revolutions. 

   We are often back solving from MPH of the vehicle back to RPM of the wheel (revolutions per minute [or seconds]) to Rad/sec for engineering units such as torque*RPM calcs for power - kW.   

Almost everytime I try to use units to convert the units the worksheet will revert to "atomic" units.   I quote "atomic" as this is what I appears to be.:  See graphic (also simplifiied worksheet attached)

The unit length(radius) seems to be a factor that is not well documented.   It also seems the earlier rplies include extra work to use convert and possibly "symbolic = true") as an extra step per Acer in an earlier posting several years ago.   

When running calcs the convert, or simplify (to cancel length units m and inches out) the cancelations and the unit combinations seem to work awkwardly in this particular area.



 

First 18 19 20 21 22 23 24 Last Page 20 of 33