Maple 2022 Questions and Posts

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

Reading another question today I discovered that I can use syntax like

a := 2 _i + 3 _j

b:= _i - _j

a+b  

Maple computes the sum by vector component. This is very useful, and it prompted me to start reading the Multivariate Calculus Study Guide. I am still going through it but haven't seen this particular notation yet. When I check the type of above I get a result that sort of looks like `+` but actually it seems to be tilted to the right (so I guess it is italicized and represents some symbol).

What is this type?

I don't find much searching online, and I did see this page that says 

"Any symbol beginning with an underscore (_) is effectively reserved for use only by library code. It is not available to users. Failure to observe this rule can lead to unexpected results."

Edit: After a bit more looking, looks like my example code is using notation available from the Physics package, which I am now reading a bit about (but it is not clear to my why this package is used since I am not importing it explicitly).

I noticed something that seems to be new to my usage of Maple.

As I am typing in an expression in a Maple Worksheet (Document Mode), it seems Maple goes into "Evaluating" for a split second on every new keystroke.

For context, I have my own worksheet open and also the Maple Study Guide open for Multivariate Calculus. But just now I closed it and restarted Maple. A brand new worksheet has this same behavior. 

Did I just miss this before or is it normal for Maple to show "Evaluating" for a split second on every keystroke (instead of just "Ready")?

I just wrote up a bug report (aka "Software Change Request") but got a "We are currently experiencing technical difficulties" error so the report is not being sent.

I will just post here about the bug in case anyone knows what it is.

I am going through the Multivariate Calculus Study Guide. I went to section 1.1, and was going through the examples. At the end of an example is a link "Next Example", but when I click this I get an error and have to go back to section 1.1 Table of Contents. Kind of annoying. Also, I notice that Maple simply crashes seemingly randomly when going through this study guide. Very annoying.

Here is a screenshot of the write-up to the bug report service that isn't working, for the record

I was wondering if this is something wrong with my Maple installation or if other people experience it too.

For instance, given an adjacency matrix: 

convert([[1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0]], Matrix): # adjacency

The desired diagram resembles:

The first one comes from Mathematica; the second one comes from MATLAB.
In MMA, we can use GraphLayout -> "LayeredDigraphEmbedding"; in MatLab, we can use Layout = "layered". Note that overlapping edges should be avoided in a layered plot.

Currently, since the vertices of a 2-D graph can be manually positioned, we can click, drag and place them to embed vertices, route edges, and then get a hierarchical structure as follows:

However, it's just a clumsy and fiddly job. Isn't there a fully automatic and less time-consuming method to do so in Maple?

Hey dear friends, in the following code (which is also attached at bottom of this post)

restart;
with(Physics[Vectors]);
Setup(mathematicalnotation = true);
with(Physics);
Setup(op = {H, I__C, I__G, Omega, R, a_, p, r, rho, v_, `α_`, `ω_`, `ϰ_`})
Newton_generalized_MatForm := m*(Omega*rho*H(t)*diff(`ϰ_`(t), t) - rho*diff(H(t), t)*diff(`ϰ_`(t), t) - rho*H(t)*diff(`ϰ_`(t), t, t) + diff(v_(t), t)) = f_[c] + f_[g]

 i wish to get the  (kappa-dot) coefficients 

so I used the "Coefficients" function as follows:

Coefficients(Newton_generalized_MatForm, diff(varkappa_(t), t))

but the results aren't as expected and it's this:

so is there a way around this , thanks in advance
Coeff.mw

Hello!
I have a document which can't be opened that contains several things I need to take my exam in a couple of days. The document has crashed and keeps telling this message: "There were problems during the loading process. Your worksheet may be incomplete". The only thing left in the document is a command and there should be several solved tasks.

I have tried to open the launch.ini file and add some script which MapleSoft suggested could sovle the problem, but I dont have access to the file by some reason. I read somewhere that danish letters such as æøå could be the reason for the document crashing. Is there any way to save the file or is it just lost? Eksamenssæt.mw

This code can draw the subgroup lattice:

DrawSubgroupLattice(GaloisGroup(x^3 - 2, x), 'indices')

But I really want to know what the extension of field about each subgroup corresponds to, like this:

The root of the polynomial r1=21/3, r2=21/3(-1+sqrt(3) I)/2, r2=21/3(-1-sqrt(3) I)/2 in the above graph. Further, how do we draw the extension relation of this polynomial:

x5+15x+44

The maple can draw this graph? If maple can't draw it, what software can?

 

restart;

q := (u,v) -> u^2 + v^2;

proc (u, v) options operator, arrow; v^2+u^2 end proc

D[3](q);

Error, (in D/procedure) index out of range: function takes only 2 arguments

Question: How does D know that q takes two arguments?

In general, if I pass q to another proc, how can I find out, within
that proc, that q takes only two arguments?

download number-of-arguments.mw

Given a vector-valued function z(u,v), I want to calculate the derivative of z with respect to its first argument by applying the D operator to it. I don't see how.  Any suggestions?

restart;

z := (u,v) -> < a(u,v), b(u,v) >;

proc (u, v) options operator, arrow; `<,>`(a(u, v), b(u, v)) end proc

Calculate the derivative of z with respect to its first argument:

P := diff(z(u,v), u);

Vector(2, {(1) = diff(a(u, v), u), (2) = diff(b(u, v), u)})

Express P through the D operator:

Q := convert(P, D);

Vector(2, {(1) = (D[1](a))(u, v), (2) = (D[1](b))(u, v)})

Question:  How do we obtain Q directly by applying the D operator to z

without the help of diff?  This one doesn't work:

D[1](z)(u,v);
type(%, Vector);

(D[1](`<,>`))(a(u, v), b(u, v))*(D[1](a))(u, v)+(D[2](`<,>`))(a(u, v), b(u, v))*(D[1](b))(u, v)

false

Download diff.mw

restart;
with(Physics[Vectors]);
Setup(mathematicalnotation = true);
with(Physics);

Setup(op = {Omega, r});

lprint(m*Omega^2*r);

which outputs this:

i want to substitute  Physics:-`*` which is an overloaded version of matrice multiplication with the default one which is `.` so I wrote the following code :

use   `*`= :-`.` in
a := m*Omega^2*r
end use

the result is the same and its not substitute the physics product with the default one. what is the mistake here?

I also tried the following code and its worked. but I want to make it work with the 'use' function for general purposes

lprint(m . (:-`.`(Omega^2, r)))

thanks in advance

I'm trying to use Maple to take the following integral for positive values of a, b, c and non-negative integers i and j.

I know that for fixed values of j and k this doable — for example, for j=k=0 Mathematica gives

I'm trying the following code in Maple:

int(exp(-(x + y)/2)/(a*x + b*y + c), [x = 0 .. infinity, y = 0 .. infinity]) assuming (a::real, 0 < a, b::real, 0 < b, c::real, 0 < c)

Am I doing anything wrong?

Maple 2022.2 on windows 10. I found another serious problem with timelimit. When changing the timelimit value, solve hangs.

i.e. timelimit do not timeout.  But that is not all. Unable to terminate the process running the worksheet. Clicking on the little ! circle at the top does nothing.  But that is not all. Killing the server.exe from the task manager, now I am not even able to close the worksheet. Maple hangs on closing the worksheet.

This code below on  my PC produces this. I used 60 seconds to make it hang. When using 10 seconds it does not hang. You might have to change these values depending on how fast/slow your PC is. If it does not hang for you using 60, you might to try 100 and so on.

Why does it hang so bad? This really makes using Maple for development not practical if one can't even put a timeout on an operation like this. What is a user to do?  Not use solve? reduce the timelimit to avoid maple lockin? To what value? If I reduce all timelimits to 5 seconds, this will cause problems as I could lose solutions that will show up with more time.

Anyone else can produce this? Make sure to save all your work before because you might not be able to close the worksheet after this.  I use worksheet mode only.
 

interface(version);

restart;

interface(warnlevel=4);
kernelopts('assertlevel'=2):

eq:=1/24*ln(9*u + 2) + 1/8*ln(u) - 1/24*ln(3*sqrt(4*u + 1) + 1) - 1/8*ln(sqrt(4*u + 1) - 1) + 1/24*ln(3*sqrt(4*u + 1) - 1) + 1/8*ln(sqrt(4*u + 1) + 1) - 1/2*ln(x) - c[1] = 0;

try
   the_sol := timelimit(60,[solve(eq,u)]);
   print("finished before timeout");
  catch:
    print("Timed out OK");
end try;

 


 

Download solve_hangs_different_timing_dec_23_2022.mw

This is really a question on getting index positions of a sub list from the main list.

Have a list of Vertices and a list of populations for each vertes.

Then from the Neighbours list I need the respective positions in the Vertex list to sum to corresponding values from the population list.

2nd Question  Can the population values be displayed near its vertex or in the vertes circle? e.g y=5

restart

NULL

with(GraphTheory)

with(SpecialGraphs)

Vs := [x, y, z, w]

[x, y, z, w]

Popvs := [-2, 1, 6, 3]

[-2, 1, 6, 3]

newPopsvs := Popvs

[-2, 1, 6, 3]

``

X := Graph(Vs)

GRAPHLN(undirected, unweighted, [x, y, z, w], Array(1..4, {(1) = {}, (2) = {}, (3) = {}, (4) = {}}), `GRAPHLN/table/1`, 0)

``

AddEdge(X, {{w, y}, {w, z}, {x, y}, {y, z}})

GRAPHLN(undirected, unweighted, [x, y, z, w], Array(1..4, {(1) = {2}, (2) = {1, 3, 4}, (3) = {2, 4}, (4) = {2, 3}}), `GRAPHLN/table/1`, 0)

Nbs := [seq(Neighbors(X, Vs[i]), i = 1 .. nops(Vs))]

[[y], [x, z, w], [y, w], [y, z]]

``

vp := [[0, 0], [1, 0], [1.5, 1], [2, 0]]

[[0, 0], [1, 0], [1.5, 1], [2, 0]]

SetVertexPositions(X, vp)

DrawGraph(X)

k := rand(1 .. 4)

NULL

for c to nops(Nbs) do Nbs[c]; select(proc (i) options operator, arrow; Vs[i] = Nbs[c, 1 .. -1] end proc, [`$`(1 .. nops(Vs))]) end do

[]

NULL

Download Q_23-12-22_Test_Graph_indices_.mw

As we know, choosing different generators can all represent the same group. But how can I get the combination of these different generators by maple? For example, how do I get the following different combinations of generators of C6?

If we have two univariate polynomials $f(x)$ and $g(x)$ such that

$gcd(f(x),g(x))=1$

then we know there exist two other polynomials $a(x)$ and $b(x)$ such that $a(x)f(x)+b(x)g(x)=1$. For example, if $f(x)=x^3−1$ and $g(x)=x^2+2$, then we can set

$a(x)=\frac{2x−1}{9}$, $b(x)=\frac{−2x^2+x+4}{9}$

Here the polynomials $a(x)$ and $b(x)$ are known as Bezout polynomials and they can be found using the extended Euclidean algorithm, which I know how to do using pen and paper, but not in Maple.

So my question is: in Maple, is there a way, given $f(x)$ and $g(x)$, to solve for $a(x)$ and $b(x)$?

First 23 24 25 26 27 28 29 Last Page 25 of 43