Maple 2022 Questions and Posts

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

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)$?

What kind of solution is it (see (3))? Why is there no solution when I put the initial condition v(0)=C1? Secondly, eq. (2) can be reduced to a first-order differential equation?

restart

interface(showassumed = 0)

declare(v(y))

(1)

q := v(y)*(diff(diff(diff(v(y), y), y), y))+(2*v(y)-(diff(v(y), y)))*(diff(diff(v(y), y), y))+(diff(v(y), y))*(v(y)^3+v(y)-(diff(v(y), y))) = 0

v(y)*(diff(diff(diff(v(y), y), y), y))+(2*v(y)-(diff(v(y), y)))*(diff(diff(v(y), y), y))+(diff(v(y), y))*(v(y)^3+v(y)-(diff(v(y), y))) = 0

(2)

dsolve(q)

v(y) = ODESolStruc(_a, [{(diff(diff(_b(_a), _a), _a))*_b(_a)^2+_b(_a)*((diff(_b(_a), _a))^2*_a+_a^3-(diff(_b(_a), _a))*_b(_a)+2*(diff(_b(_a), _a))*_a-_b(_a)+_a)/_a = 0}, {_a = v(y), _b(_a) = diff(v(y), y)}, {y = Int(1/_b(_a), _a)+_C1, v(y) = _a}])

(3)

NULL

dsolve({q, v(0) = C1})

v(y) = C1

(4)

NULL

Download CD_ode.mw

 

I have been making animated 3d plots recently; the last time was perhaps three years ago, and I had some problems then.  If I recall correctly, I couldn't make an animated 3d plot that was plotted in non-Cartesian coordinates.

 

I am very happy to report that this works very smoothly now in Maple 2022, and it's pretty fast, too.  I have a fairly complex function to plot, involving piecewise polynomials on a tensor product grid in the xi and eta variables (actually, I let plot3d pick out the grid; it seems happier to do so) and then plot them on an elliptical base, in coordinates x = d*cosh(xi)*cos(eta) and y=d*sinh(xi)*sin(eta)  (d is just a numerical constant, giving the location of the foci at (d,0) and (-d,0)), for 0 <= xi <= xi[0] (the outer elliptical boundary) and 0 <= eta <= 2Pi.  The straightforward command works, and building a sequence of plots and using plots[display] works.  I put option remember into my procedure w(xi,eta) and because the sample points are consistent for the time-dependent function exp(I*omega*t)*w(xi,eta) the xi-eta grid needs only to be done once and then one can compute (basically) as many frames as one wants in rapid succession.

 

Works great.  Thanks, folks!

 

for k to nplots do
    t := evalf(2*Pi*(k - 1)/nplots);
    plts[k] := plot3d([(xi, eta) -> focus*cosh(xi)*cos(eta), (xi, eta) -> focus*sinh(xi)*sin(eta), (xi, eta) -> Re(exp(omega*t*I)*w(xi, eta))], 0 .. xi[0], 0 .. 2*Pi, colour = ((xi, eta) -> Re(exp(omega*t*I)*w(xi, eta))), style = surfacecontour, lightmodel = "none");
end do;
plots[display](seq(plts[k], k = 1 .. nplots), insequence = true);
 

I have a system of ODE's which are solved numerically (with rkf45) to get function values over time. And i have datapoints for these functions, and would like to compare and calculate the error/deviation between model and data. I can't find a command / mechanism that does this.

Is it possible?

The graph we draw in the graph theory package appear to be vectorial. So the export pdf is also clear. 

with(GraphTheory):
DrawGraph(PathGraph(2), stylesheet=[vertexborder=false,
vertexpadding=5,edgecolor = blue,vertexcolor=black,edgethickness=2],size=[250,250])

draw1.pdf

We know that DrawGraph only offers straight forms for drawn edges.  Sometimes we need to draw graphs with curves.  But when I try to use maple, I find that the vertices (by pointplot) are blurred after zooming in (or even without zooming out).

with(plottools):    
with(plots):
Bezier:=proc(x0,y0,x1,y1,x2,y2,x3,y3)
local f,g,c,l1,l2,l3,p0,p1,p2,p3;
f:=t->x0*(1-t)^3+3*x1*t*(1-t)^2+3*x2*t^2*(1-t)+x3*t^3:
g:=t->y0*(1-t)^3+3*y1*t*(1-t)^2+3*y2*t^2*(1-t)+y3*t^3:
c:=plot([f(t),g(t),t=0..1],thickness=2,scaling=constrained, color=blue,axes=none):
p0:=pointplot([x0,y0],symbol= solidcircle,symbolsize = 50,color=black):
p1:=pointplot([x3,y3],symbol= solidcircle,symbolsize = 50,color=black):
display(c,p0,p1,size=[300,300]);
end:

x0:=0:   y0:=0:
x1:=-0.2:  y1:=0.2:
x2:=0.5:  y2:=0.2:
x3:=0.3:  y3:=0:
p:=Bezier(x0,y0,x1,y1,x2,y2,x3,y3)

 draw2.pdf 

How to make these vertices vectorially drawn (like DrawGraph)?

How can we unveil all the possible transformations that reduce the number of independent variables of a given pde? I tried it by using "InvarientSolutions" which gives eight possible transformations. But under those transformations, I got only two different odes. Is there any other method/command from which we can get other possible odes of a given pde?

 

pde_ode.mw

I have in internal procedure ppp that has an input prjpsn:=3. This set a Vector positions of x,y,z to either if prjpsn=1 

zpsn=1,   xpsn=2,  ypsn=3

or if prjpsn =3   

xpsn=1,   ypsn=2, zpsn=3

This then are used in another procedure. I can't get the values to transfere.  prjpsn would default to 3 in the module but can be set externally to 1 if needed.
The relevant parts are highlighted in green text. Cant get the worksheet to display.

Maple Worksheet - Errorprjpsn:=3


Failed to load the worksheet /maplenet/convert/Q_14-12-22_Module_internal_settings.mw .

Download Q_14-12-22_Module_internal_settings.mw

Let a, b, c, d be real numbers. Define two geometric regions implicitly: abcd>0∧abacadbcbdcda2b2c2d2, and abcd>0∧abcabdacdbcd>0. Suppose that somebody wants to prove that the former region is a subset of the latter one. Can we implement such an implication simply using certain ready-made commands in basic Maple? In other words, it is hoped that 

restart;
RealDomain:-simplify(forall([a, b, c, d], a + b​​​​​​​ + c + d > 0 and a*b + a*c + a*d + b*c + b*d + c*d > a^2 + b^2 + c^2 + d^2 implies a*b*c*d > 0 and a*b*c + a*b*d + a*c*d + b*c*d > 0));

Unfortunately, simplify just returns the statement unevaluated. So, how to address it in internal Maple? 

Note. The desired result (or return value) is true (see below).

  1. restart; # Do not with(Logic): here
    RegularChains:-SemiAlgebraicSetTools:-QuantifierElimination(&A [d, c, b, a], ((d + c + b + a > 0) &and (b*a + c*a + d*a + c*b + d*b + d*c > a^2 + b^2 + c^2 + d^2)) &implies ((d*c*b*a > 0) &and (d*c*b + d*c*a + d*b*a + c*b*a > 0)));
  2. restart;
    not SMTLIB:-Satisfiable(`not`(a + b + c + d > 0 and a*b + a*c + a*d + b*c + b*d + c*d > a^2 + b^2 + c^2 + d^2 implies d*c*b*a > 0 and a*b*c + a*b*d + a*c*d + b*c*d > 0)); # assuming real 

​​​​​​​​​​​​​​​​​​​​​Either ⒈ or ⒉ needs external calls. It seems that the Maple standard library functions in List of Commands still fail in simplifying expressions in the aforementioned form. Am I right?

File:

Solution_Methods.mw

Download Solution_Methods.mw

So i have an exam right around the corner, and maple decided to corrupt my file. I get the error "There was a problem in the loading process, you worksheet may be incomplete." I've tried the following troubleshooting:

Restart - No luck

Other computer - No luck

Checked the backupfolder. - 10 backups have been made, but they are all corupt aswell

I've Followed Can I repair a corrupted Maple document/worksheet file? (maplesoft.com) It didn't really do anything

Also tried the DeleteBadCharacters() proccess, but i get the error "Error, (in XMLTools:-ParseString) Element type "Equation" must be followed by either attribute specifications, ">" or "/>"."

Anyone who can help me out here? 

Hi there,

I updated to Maple 2022 recently. One problem I am facing is how after I write the code and get the output, which can be text or equations or plots, etc, when I try to copy it to MS Word for example, I don't have the option of "Copy as Image" anymore. This option was available in previous versions. So was it taken out in this version? If yes, what's a subtitue for that?

I am using Maple for a school project and need to be able to copy the 2D output to MS Word just like the previous versions of Maples did.

Regards

I am trying to run this procedure, but am getting an "Error, missing operation", highlighting the conditional break:

is_prime := proc()
     local i, x_check;
     printf(`Enter an integer to check if it is a prime number...`);
     x_check:=parse(readline(terminal));
     if x_check<=2 then
         printf(cat(x_check,` is a prime number.`));
     else
         for i from 2 to x_check-1 do
               if (irem(x_check,i)=0) then
                  printf(cat(x_check,` is not a prime number.`));
                  break 2;
             end if;
           end do;
         printf(cat(x_check,` is a prime number.`));
      end if;
end proc:

If I don't include the integer, I am able to run the procedure, but it does not function like I would like it to. I am running Maple 2022, and can sucessfully run the example conditional break code in the Help. What is wrong with my use of break?

GraphTheory/IsHamiltonian says that the method can be one of legacy, sat, or tsp. But why method = tsp brings about an error? 

GraphTheory:-IsHamiltonian(GraphTheory:-CompleteGraph(3, 3), method = tsp); # Maple 2022.2

Attachment: HamiltonianGraphQ.mws

I am trying to use the perpendicular symbol &bot; as a superscript. Can this be done? For somereason the document will not displat?

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/Q_10-12-22_Polar_point_line_symbol.mw .

Download Q_10-12-22_Polar_point_line_symbol.mw

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