Maple 2021 Questions and Posts

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

Suppose I want to calculate gcd(g(x),f(x))=a(x)f(x)+b(x)g(x) for two polynomial, i.e finding the RHS representation of the gcd, then how to implement this in maple?

I know of the command GCD(f(x),g(x)) but how to find the RHS representation?

Thanks!

primes_integrale_exp.mwThe integral in x of 

exp(-sqrt(x^2 + c))

was done by Maple 11 but return unevaluated in Maple 2021,

see attached worksheet 

I am trying to solve the equation in the attached Maple file, but Maple cannot return a result.

 

restart

Digits := 30

30

(1)

with(plots)

[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]

(2)

with(Statistics)

NULL

say the f(x) is a Beta with parameters alpha and beta

 

alpha := 10

10

(3)

beta := 100000

100000

(4)

"f(x):=PDF(BetaDistribution(alpha,beta),x)"

proc (x) options operator, arrow, function_assign; Statistics:-PDF(BetaDistribution(alpha, beta), x) end proc

(5)

f(x)

piecewise(x < 0, 0, x < 1, x^9*(1-x)^99999/Beta(10, 100000), 0)

(6)

NULL

semilogplot(PDF(BetaDistribution(alpha, beta), x), x = 0 .. 1)

 

 

fsolve(int(f(x), x = 0 .. y) = .1, y = 0 .. 1)

Download test_fsolve_integ.mw

I try to sove the equation x^2-10*y^2=9 with tne procedure : 
genpellsolve := proc(D::posint, N::integer)
local t, u, L1, L2, sols, x, y;
if type(sqrt(D), integer) then error "D must be a nonsquare integer"; end
if; t, u := pellsolve(D); if 0 < N then L1 := 0;
L2 := floor(sqrt(1/2*N*(t - 1)/D)); elif N < 0 then L1 := ceil(sqrt(-N/D));
L2 := floor(sqrt(-1/2*N*(t + 1)/D)); else return {[0, 0]}; end if;
sols := {}; for y from L1 to L2 do x := sqrt(N + D*y^2);
if type(x, integer) then sols := sols union {[x, y]};
if (x^2 + D*y^2) mod N <> 0 or (2*x*y) mod N <> 0 then sols := sols union {[-x, y]};
end if;
end if;
end do;  return sols;
end proc:
This procedudure fails; I don't see why. Thank you for your help.

I run Maple 2021 under Ubuntu 20.04 on a new Lenovo laptop with 32Gb of Ram. Every time I start Maple, it runs for a few minutes and then loses the "kernel connection". I have to save the worksheet and re-start Maple. In dmesg, I find:

[ 1436.724570] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/user@1000.service,task=mserver,pid=8037,uid=1000
[ 1436.724589] Out of memory: Killed process 8037 (mserver) total-vm:31723552kB, anon-rss:31289772kB, file-rss:60kB, shmem-rss:0kB, UID:1000 pgtables:61656kB oom_score_adj:0
[ 1437.151441] oom_reaper: reaped process 8037 (mserver), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

indicating that Maple's virtual memory exceeded 30 Gb! This happens even if the only command I execute is, for instance, "resrart" or "A:=1" and nothing else. It also happens when no other applications are running and the "top" command indicates that around 30Gb of RAM is available.

In this state, Maple is utterly useless to me. This was a new install of Maple and a fresh install of Ubuntu on a new laptop, surely I am not the only one seeing this?

I have tried setting a 30Gb limit in "kerneloptions" for "stacklimit" but that di not make a difference.

If you have seen any behaviour like this, please respond. Is there some bug in Maple that leads to oncontrolled and unprovoked memory grabbing?

Dear all,

I'm using Maple to calculate the geodesics of the Poincare' Half Plane:

restart:
with(LinearAlgebra): with(DifferentialGeometry): with(Tensor): with(Tools): with(plots): 
DGsetup([x,y],M1)
g1 := evalDG(1/y^2*(dx &t dx+dy &t dy))
R1 := CurvatureTensor(g1)
K := SectionalCurvature(g1,R1,D_x,D_y)
Gamma := Christoffel(g1)
C := [x(t), y(t)]
V := GeodesicEquations(C, Gamma, t)
DE := Tools:-DGinfo(V, "CoefficientSet")

simplify(dsolve(DE, explicit))

I receive this error message

Error, (in simplify/siderels:-simplify/siderels) specified variables must be names or functions

How can I fix this error?

Thanks, Nicola

Hello,

I would like to print the current values of both displayed functions for x=1 in each frame of the animation. My example code is below:

plot1 := animate(plot, [a*x^2, x = -1 .. 1, color = "Green", thickness = 3], a = 0.2 .. 1.2);
plot2 := animate(plot, [a*x^2 + 0.3, x = -1 .. 1, color = "Red", thickness = 3], a = 0.2 .. 1.2);
display([plot1, plot2]);

I would be grateful for any tips.

Thank you,

Iza

ImportGraph reads one or more graphs from a file. For a file containing multiple graphs, the supported formats are digraph6, graph6, and sparse6. I notice that one option is "output = graph or list, or iterator". However, in my programming with Maple, I was reminded several times that list is only good for a small amount of data.  

Although I can convert the list to an array using the convert function, the time spent in the conversion process needs to be considered.

restart: 
with(GraphTheory):
L:=ImportGraph("C:/Users/eul10c.g6", graph6, output=list):#31026 connected eulerian graphs on 10 vertices graphs and Change to your path here.
convert(L,Array) 

So does it make more sense to provide an "output=Array" as an output option?

eul10c.txt

I am trying to use "solve" to solve a set of 2 equations defined by using summation function "sum". But I got an error saying "Error, (in sum) summation variable previously assigned, second argument evaluates to 3 = 1 .. 2". 

The Maple code is listed here

restart;
N := 2:
var:= seq(alpha[n], n = 1 .. N):
v(x):=sum(alpha[n]*phi[n](x), n = 1 .. N):
R(x):=diff(v(x), x $ 4) - p/EI:
eqs := seq('int'('R(x)'*phi[n](x), x = 0 .. L) = 0, n = 1 .. N):
for n to N do
    phi[n](x):= sin((2*n - 1)*Pi*x/L):
end do:       
solve({eqs}, {var});
Error, (in sum) summation variable previously assigned, second argument evaluates to 3 = 1 .. 2

I have the following example.

> A:= Vector(3,symbol=v)

A:= Vector(3,symbol=v)

>v[1]:= 5

v[1]:=5


> A

 Vector(3,symbol=v)

 

Is there any way such that v[1] is actually referring to the first element in the vector? In other words, changing v[1] actually modifies the vector A.

 

If the question does not make sense, then here is the actual scenario that I faced.

I need to solve a system of equations in the form of 

2 = c[2] + a[1],
2 = 2*c[3] + a[2],
-2 = -3*c[1] + a[3],
-1 = -2*c[2] + a[1],
-1 = -c[3] + a[2],
1 = a[3]

where a[i], c[i] refers to the entries in the vector.

solve returns the following:

[[a[1] = 1, a[2] = 0, a[3] = 1, c[1] = 1, c[2] = 1, c[3] = 1]]

I then did an assign(%). However, the entries in A and C are not changed. I want the answer returned by solve to be properly applied to the entries of the vectors.

a := x -> x + 1;
b := x -> a(x) + x^2;
a := x -> x + 5;
b(x);
                            2        
                           x  + x + 5

However, I wish my b(x) to be x^2 + x + 1. How could I do it?

 I have the following code snippet.

f := x^11 + 2*x^9 + 2*x^8 + x^6 + x^5 + 2*x^3 + 2*x^2 + 1;
g := 2*x^10 + x^7 + 2*x^4 + x;

Gcd(f, g) mod 3;
                        9      6    3    
                       x  + 2 x  + x  + 2
with(Algebraic);
Gcd(f, g) mod 3;
                              6    
                             x  + 1

It is surprising to me that using a package actually changes the behaviour of functions not in the package!

Is this a bug or a feature that I am not aware of?

Applications to develop exercises on systems of equations using the technique of determinants, Gauss and Crammer. For science and engineering students. In spanish.

Determinantes_Gauss_Crammer.mw

Lenin Araujo

Ambassador of Maple

I have just started using the GR functions available in Maple and have struggled to implement locally flat coordinates whilst using an arbitrary metric. I would like Maple to know that the first partial of g_ is 0 but that the second may not be. This knowledge would help simplify down some of the bulky expressions for the Riemann tensor in terms of g_. Any suggestions would be great as I have very little background knowledge with the submodule.

Thanks!

For_mapleprimes.mw

Why do I get 2 wrong answers here?

I see that they are all false but the last answer is close enough for my purposes

restart

  with(RealDomain)

 

"`f__1`(x):=6.-sqrt(-x^(2)+8*x+9.)" = proc (x) options operator, arrow, function_assign; 6.-RealDomain:-sqrt(-RealDomain:-`^`(x, 2)+8*x+9.) end procNULL

  l__ength := solve(10 = int(f__1(x), x = 0 .. l), l) = 8.855609656, -.4725737205, 6.810993084NULL

10 = int(f__1(x), x = 0 .. l__ength[1]) = 10 = 16.02268001"(->)"false

10 = int(f__1(x), x = 0 .. l__ength[2]) = 10 = -1.586294894"(->)"false``

10 = int(f__1(x), x = 0 .. l__ength[3]) = 10 = 10.00000001"(->)"false 

 

NULL

Download Not_working.mw

First 14 15 16 17 18 19 20 Last Page 16 of 40