MaplePrimes Questions

Show that x-2 is a factor of p(x)=x^3+3x^2-4x-12

I)determine all the linear factors of p(x)

ii)what are the zeros of y=p(x)

iii)sketch function y=p(x)

Hi there.

I would like to get advice about most elegant and effective ways of building animated plots (sequnces of plots) of two kinds:

1. Coordinates of point on some background curve. So each plot in sequence contain constant background curve and single point that moving from plot to plot;

2. Line of points from some array. So i-th plot in sequence draw line that build on i (1..i) points from array.

I want to demonstrate these animated plots on some example - Kepler problem (point moving on ellipse):

ell.mw

But I don't think that my code is effective.

Thank you.

Suppose I have one or more equations in the variables x[1] , ..., x[n], where each equation is a linear combination of rational functions in x[1] , ..., x[n]. For example, one equation might be:

(a*x[1]+b*x[2])/x[3] + c * x[1]^2 / ( d + e*x[2]) = f

Any such equation can be turned into a polynomial by multiplying both sides by the products of all the denominators. In the example, this would be x[3]( e*x[2] + d ).

My question is whether there is a Maple command to do this automatically? This would be helpful as I have a large number of equations.

I seem to remember that the save command had a bug about truncating big integers, and it was solved.
But now (Maple 2020) it is present again.
I wonder whether it is present in Maple 2021 too.

restart;
fname:="d:/tmp/ftest.mpl":
f:=proc(n)
  local i,k;
  for i to n do f(i):=parse(cat("", seq(k mod 10, k=1..10*i))) od;
  f(n);
end:

f(80):
length(%);  # 800, ok
save f, fname;
f:='f':
#restart;
read fname:
f(80):
length(%);  # 100  ???

 

In Maple 2021

restart;
B:=sqrt( (-4*u^(1/3)+1)*u^(4/3));
A:=1/(-12*u+3*u^(2/3)-3*B);
res:=int(A,u);
simplify(res)

This is one of the integrals, that in Maple 2020 did not handle. In Maple 2020, it gives this

restart;
B:=sqrt( (-4*u^(1/3)+1)*u^(4/3));
A:=1/( -12*u+ 3*u^(2/3)-3*B);
res:=int(A,u);

The difference is that in Maple 2021 int is able to solve this (but gives very long output which I will not post here). The problem is now simplify() gives an error on the result. I was trying to see if possible to obtain the same small result as Mathematica's after simplifying. Here is Mathematica's result

ClearAll[u];
B = Sqrt[(-4*u^(1/3) + 1)*u^(4/3)];
A = 1/(-12*u + 3*u^(2/3) - 3*B);
res = Integrate[A, u]

It is good that Maple can solve this integral, but why simplify gives error on the result? Is there a workaround?

 

I read the code in the link below and have some thoughts on drawing the graph.

https://www.mapleprimes.com/questions/216092-Options-For-Graph-Drawing-In-The-GraphTheory

restart:
with(GraphTheory):
with(SpecialGraphs): 
G     := PetersenGraph();:
POS := GetVertexPositions(G);
EG   := Edges(G); 
PLOT(
   seq( CURVES([POS[EG[i][1]], POS[EG[i][2]]], LINESTYLE(3) ), i=1..numelems(Edges(G))),
   POINTS(POS, SYMBOL(_SOLIDBOX, 35), COLOR(RGB, 1, 1, 0)),
   seq(TEXT(POS[i], i), i=1..numelems(Vertices(G))),
   AXESSTYLE(NONE)
)

 

 

But if we want to change the edge to a curvilinear style, it seems very difficult. We know  PetersenGraph is 1-planar graph.  The following picture is one of  its 1-plane drawing.  That is  also what I want to draw .

 

PS: 1-planar graph is a graph that can be drawn in the Euclidean plane in such a way that each edge has at most one crossing point, where it crosses a single additional edge

Although I asked a similar question, but it uses too many special curve functions and the method is relatively isolated. Because the cycle graph is too special.  https://www.mapleprimes.com/questions/228987--Can-We-Draw-Curved-Edges-In-The-Graph

I also noticed the optional items of the edge style.  But there are no curves, such as arcs, parabola, etc.

The plot style must be one of line, point, pointline, polygon (patchnogrid), or polygonoutline (patch).  

I am trying to draw a parabola, it seems to be quite difficult. And it completely deviated from the use of graph theory package.

drawarc :=proc(A,B,C,ecolor);

local  c,ax,cx ,ay,cy,ox,oy,oo,x,y,b,a,an_end,an_start,r,yuanhu:
ax :=evalf(geometry)[HorizontalCoord](A):
cx :=evalf(geometry)[HorizontalCoord](C):
ay :=evalf(geometry)[VerticalCoord](A):
cy :=evalf(geometry)[VerticalCoord](C):

geometry[circle](c,[ A ,B ,C], [x,y],'centername' =o):

ox :=evalf(geometry[HorizontalCoord] (o)):
oy :=evalf(geometry[ VerticalCoord] (o)):

if(cx -ox)>0 then
b :=arctan((cy -oy) /(cx -ox)):
elif(cx -ox)=0 and (cy -oy)>0 then

b :=Pi/2 :
elif(cx -ox)=0 and (cy -oy)<0 then

b :=-Pi/ 2 :
else 
b :=Pi +arctan((cy -oy) /(cx -ox)):
fi :
if(ax -ox)>0 then 
a :=arctan((ay -oy) /(ax -ox)):
elif(ax -ox)=0 and (ay -oy)>0 then

a :=Pi /2 :
elif(ax -ox)=0 and (ay -oy)<0 then

a :=-Pi/ 2 ;
else 
a :=Pi +arctan((ay -oy)/ (ax -ox)):
fi ;
if(evalf(b)<evalf(a))then
an_start :=a :
else
an_start :=a +2*Pi :
fi :
an_end :=b :

r :=geometry[ radius] (c); 
yuanhu :=plottools[ arc] ([ ox , oy] , r , an_start..an_end):

plots[ display] (yuanhu , scaling =constrained, color =ecolor,axes=none);

end :

geometry[point] (a , -3 .00 , 1 .70);
geometry[point] (b , 0 .35 , -0 .45);
geometry[point] (c , 3 .13 , 1 .86);
l :=[a , b , c] ;
drawarc(a,b,c,blue);

I would like to ask maple if there is a more versatile and simpler way to draw a curve of  graph drawing.

drawarcs:=proc(VL ::list , ecolor , scope);
local i , num , arcs , arc_text , vl , display_set ;
vl :=VL ;
num:=nops(vl);
arcs :={};
i:=1;
if num <3 then 
"There isn' t enough points in the point list." ;
return ;
elif irem(num-1 , 2)<>0 then  
"The number of the list must be multiple of 2 when it minus 1 .";
fi :
while i <num do
arcs :={drawarc(vl[i] ,vl[i +1] , vl[i +2],ecolor),op(arcs)};
i:=i +2 ;
od ;
arc_text :=geometry[ draw] ({vl[1] , vl[num] }, printtext =true , color =ecolor);
display_set:={op(arcs),arc_text};
plots[ display] (display_set , view =[ -abs(scope)..abs(scope), -abs(scope)..abs(scope)] , scaling =constrained,axes=none);
end proc:
geometry[ point] (v1 , 0 ,0):
geometry[ point] (a , 3, 9):
geometry[ point] (b , 7, 9):
geometry[ point] (c, 6,8):
geometry[ point] (d , 12,9):
geometry[ point] (e , 7 ,2):
geometry[ point] (v3 , 9 ,0):
vl:=[ v1,a,b,c,d,e,v3] :
drawarcs(vl,red,20);

try.mwtry.mw

The above program is too cumbersome and not robust

macro(GS=GetVertexPositions):
with(GraphTheory):
with(SpecialGraphs): 
G     := PetersenGraph():
POS := GetVertexPositions(G):
EG   := Edges(G) minus {{6,10},{6,7}}:
s1:=PLOT(
   seq( CURVES([POS[EG[i][1]], POS[EG[i][2]]], LINESTYLE(3) ), i=1..numelems(Edges(G))-2),
   POINTS(POS, SYMBOL(_SOLIDBOX, 35), COLOR(RGB, 1, 1, 0)),
   seq(TEXT(POS[i], i), i=1..numelems(Vertices(G))),
   AXESSTYLE(NONE)
):
geometry[ point] (a,op(GS(G)[6])):
geometry[ point] (b , op(GS(G)[7])):
geometry[ point] (c , op(GS(G)[10])):
geometry[ point] (d ,op(GS(G)[8])[1]+0.3,op(GS(G)[8])[2]-0.5):
geometry[ point] (d2 ,op(GS(G)[9])[1]-0.3,op(GS(G)[9])[2]-0.5):
s2:=drawarc(a,d,b,red):
s3:=drawarc(c,d2,a,red):
plots:-display({s1,s2,s3});

 

 

 

 

 

See A342180 in OEIS. Two codes have been written for this, one in Python (17 terms found), the other in Mathematica (33 terms). Could a Maple code go beyond a(33), assuming higher terms exist? 

So in multivariate calculus there is a function called Lagrange Multipliers that searches for maxima, minima and saddle points on a 3d surface with an algebraic as a constraint. I was wondering if there was a way to do something similar on a polygon constraint by feeding the corner points to a procedure and returning all extrema and saddle points? Ideas I've had so far is using the directional derivative on the corners in the direction towards the next corner and looking if it is bigger or equal than 0 if multiplied with the directional derivative towards the previous corner (if yes, extrema or saddle point, if no not) however this adresses only corners and there may be extrema on the lines between the corners too. What should I do for that? 

Hi,

Is there a way to make all computations in Maple to run modulo specified prime p? If, for example, I want to use a function such as DifferentialAlgebra:-RosenfeldGroebner and force it to run its internal computations modulo p, can this be done?

So far I have tried to use GF(p, k), but there seem to be issues where `+` and other operations require defining all symbold via :-ConvertIn(). 

Thanks.

 

I was hoping to find a nice symbolic solution for the root of this equation:

a,c,d,k are parameters.
Unfortunately, I got an RootOf expression, which does not make sense to me. Assumptions do no help me further.

Next week, I have to present my results, but I don't know how to interpret is (the help file does not bring any relief). Is there something to say about the root? Suppose, I wanted to use side restriction on a problem? E.g., find a solution conditional on the fact that the derivative is zero. 


Clearly, in the plot it seems simple.

In one case there is a solution Maple provides: a  (a parameter)

This seems strange, because numerically there is one solution (and clearly not a).

restart

version(); interface(version)

 User Interface: 1502365
         Kernel: 1502365
        Library: 1502365

 

1502365

 

`Standard Worksheet Interface, Maple 2020.2, Windows 10, November 11 2020 Build ID 1502365`

(1)

f := proc (t) options operator, arrow; c/(1+exp(k*(t-a)))-c*(t-a)*k*exp(k*(t-a))/(1+exp(k*(t-a)))^2+d/(1+exp(-k*(t-a)))+d*(t-a)*k*exp(-k*(t-a))/(1+exp(-k*(t-a)))^2 end proc

proc (t) options operator, arrow; c/(1+exp(k*(t-a)))-c*(t-a)*k*exp(k*(t-a))/(1+exp(k*(t-a)))^2+d/(1+exp(-k*(t-a)))+d*(t-a)*k*exp(-k*(t-a))/(1+exp(-k*(t-a)))^2 end proc

(2)

assume(k > 0)

additionally(a > 0)

additionally(t > 0, t < 21)

about(a, k, t)

Originally a, renamed a~:
  is assumed to be: RealRange(Open(0),infinity)

Originally k, renamed k~:
  is assumed to be: RealRange(Open(0),infinity)

Originally t, renamed t~:
  is assumed to be: RealRange(Open(0),Open(21))
 

 

interface(showassumed = 0)

0

(3)

solve(f(t) = 0, t)

Warning, solve may be ignoring assumptions on the input variables.

 

(k*a+RootOf(-(exp(_Z))^4*d+(exp(_Z))^3*_Z*c-(exp(_Z))^3*_Z*d-(exp(_Z))^3*c-3*(exp(_Z))^3*d+2*c*_Z*(exp(_Z))^2-2*(exp(_Z))^2*_Z*d-3*c*(exp(_Z))^2-3*d*(exp(_Z))^2+c*_Z*exp(_Z)-d*_Z*exp(_Z)-3*c*exp(_Z)-d*exp(_Z)-c))/k

(4)

[allvalues(%)]

[(k*a+I*Pi+(2*I)*Pi*_Z1)/k, (k*a+RootOf(-d*(exp(_Z))^2+c*_Z*exp(_Z)-d*_Z*exp(_Z)-c*exp(_Z)-d*exp(_Z)-c))/k]

(5)

Re([op(%)][1])

a

(6)

Re([op(`%%`)][2])

(k*a+Re(RootOf(-d*(exp(_Z))^2+c*_Z*exp(_Z)-d*_Z*exp(_Z)-c*exp(_Z)-d*exp(_Z)-c)))/k

(7)

a := 'a'; b := 'b'; c := 'c'; d := 'd'; k := 'k'; t := 't'

a

 

b

 

c

 

d

 

t

(8)

Now, numerically:

b := 40; k := .3; a := 10; c := 2.8; d := -1.5

40

 

.3

 

10

 

2.8

 

-1.5

(9)

RealDomain:-solve(f(t) = 0, t)

11.02361521

(10)

plot(f(t), t = 0 .. 20, color = "DarkBlue", thickness = 2)

 

``


 

Download Please_NO_RootOf.mw

Let d and i two integers 

Put 

A := -(sum((-1)^k*binomial(i, k)*pochhammer(d*k+1, i), k = 0 .. i))/factorial(i)

and 

B := (sum((-1)^k*binomial(i+1, k)*pochhammer(d*k+1, i+1), k = 0 .. i+1))/(d*factorial(i+1))

Question: Show that A=B

Thanks!

Dear administration, I hope you all are good,why my question have been deleted? My question is a little similar to the one before, but there are still a lot of differences.I didn't do a backup which was bad.Once deleted, there is no chance of modification.

I have:

dx6PN := 9836.535181*(1 - 2.890681911*x(t) + 4*Pi*x(t)^(3/2) + 3.753665653*x(t)^2 - 37.77895388*x(t)^(5/2) + (120.1000376 - (856*ln(16*x(t)))/105)*x(t)^3 + 54.24658055*x(t)^(7/2) + (9.292369248 - 23.08463043*ln(x(t)))*x(t)^4 + (540.5708789 - 102.446*ln(x(t)))*x(t)^(9/2) + (415.3887908 + 318.8547366*ln(x(t)))*x(t)^5 + (1549.709468 - 384.6723254*ln(x(t)))*x(t)^(11/2) + (2172.892557 + 407.4405529*ln(x(t)) + 33.2307*ln(x(t))^2)*x(t)^6)*x(t)^5

Ms := 0.0003214719000

xlow := 0.04672277118

tin := 4.125604512

I want to solve the following for t>tin to obtain xphi. I then want to plot xphi over the range tin to tin+1:

diff(x(t), t) = dx6PN, diff(xphi(t), t) = (x(t)^(3/2))/Ms, x(0) = xlow, xphi(tin) = 0

I could use some help.

Hi,

Is there a possibility of aligning choices in a horizontal manner?

Thanks

QuizzTest1.mw

Given two lists say of same number of elements 

 

A = [1,0,3,4,5,5]

B=[0,1,2,6,3,6]

How to write a code find number of elements of A which are greater than the number of elements of B index wise in the above 1>0,3>2,5>3 so three elements. 

And also the number of elements of B greater than the number of elements A index wise

1>0,6>4,6>4.hence 3 elements

 

Index wise compared to note 

 

Kind help 

 

First 310 311 312 313 314 315 316 Last Page 312 of 2308