MaplePrimes Questions

   It would seem that the option style = planar  of DrawGraph()    is  failure when some graphs are planar.
   For example: 

treeof5:=[NonIsomorphicGraphs(5,4,output= graphs,outputform=graph,restrictto = connected )]:
DrawGraph ~ (treeof5, stylesheet=[vertexborder=false,vertexpadding=20]);


 

We know tree is planar graph obviously. But when I add the option style = planar ,  drawing of the first tree of list displays an error :
Error, (in GraphTheory:-Graph) vertex 1 cannot be its own neighbour in list of neighbours

I did not find any reason to explain. 

How do I find integer solutions to this non-linear equation:

 

8= 7(x^2+y^2+z^2)+2x+4y-8z.

 

Tried isolve and it wasn't working. (I guess too many variables?)

 

Also, if f(x,y,z) is the RHS, how do I write a loop that finds integer solutions to f(x,y,z)=c for |x|,|y|,|z|< N, say?

Suppose that a given population can be divided into two parts, those who have a given disease and can infect others, and those who do not have it but susceptible. Assume that y the proportion of infectious individuals then the rate of spread dy/dt is proportional to the number of contacts and can be described as

dy/dt=8/9y(1/9-y), y(0)=y0

Where y > 0 is a function of t,  is the initial proportion of infectious individuals.

  1. Use MAPLE and sketch a direction field for your differential equation and include a sufficient number of solution curves and include the graph into your answer sheet.

(3 marks)

  1. Find all the equilibrium solutions and determine whether they are asymptotically stable or unstable.

(4 marks)

  1. Solve the above initial value problem and verify that the conclusions you reached in part(ii) are correct.

(5 marks)

Everytime I try to run my for loops, all the code I wish to be iterated over has to be on the same line/paragraph as the original for statement. I also have to end the for loop on the same line/paragraph otherwise maple returns an error saying my for loop is unterminated?

Is there some tool I should be using to format my code that I'm not aware of?

My array is as such

A:=Array(1..N/2);

(Array A is then filled with values)

sum(A);

Then Maple outputs all the values of the Array and not the sum of them all? What am I doing wrong? Any help is appreciated.

sourcesamples := [evalf(-1-sqrt(7)), -2, 1, evalf(-1 + sqrt(7)), 2];
templatesamples := [A, evalf(-1-sqrt(7)), A, -2, A, 1, A, evalf(-1 + sqrt(7)), A, 2, A];
samples := [-4, evalf(-1-sqrt(7)), -3, -2, 0, 1, evalf(3/2), evalf(-1 + sqrt(7)), evalf(9/5), 2, 3]

want to insert value alternatively according to the template and neighbor values

 

Some inserted values come from

floor(evalf(-1-sqrt(7)))
ceil(evalf(-1-sqrt(7)))

(round(evalf(-1+sqrt(7)),0) + 1)/2;
(2 + 1)/2
=evalf(3/2)

(round(evalf(-1+sqrt(7)),1) + 2)/2;
(1.6 + 2)/2
=evalf(9/5);

how to generalize this method into general case function instead of manual inesrt?

How does one import large polynomials with 10k terms or more (from Mathematica) into Maple? I don't think there is a compatiable file format between Mathematica and Maple.

I tried copying and pasting my two-variable Laurent polynomial from Mathematica into Maple. It does create a polynomial in Maple but just 1000 terms is enough to consume 5GB RAM and causes Maple to hang unresponsive. For some reason, just copying/pasting is enough to cause evaluation to occur in Maple without hitting the enter key. The "ready" dot at the bottom screen switches to "evaluating" dot automatically when I paste the polynomial in.

An old Maple book from 2011 states Maple is capable of handling 68,000 term polynomials -- I am sure this number has gone higher up now in 2020. 

with(RegularChains):
with(ChainTools):
with(MatrixTools):
with(ConstructibleSetTools):
with(ParametricSystemTools):
with(SemiAlgebraicSetTools):
with(FastArithmeticTools):
R := PolynomialRing([x,y,z,a,b]):
sys := [a*x^2+b*x+c]:
N := []:
P := [a]: 
H := [x,y,z]:
dec := RealTriangularize(sys,N,P,H,R):
Display(dec, R);

how to write : a <> 0 and (some x)(a*x^2+b*x+c) for quantifier elimination in maple?

is RealTriangularize parameters are after quantifier elimination or it accept quantifer expression?

if not, how to input above statement into real or lazy triangularize and expect return b^2 + 4*a*c;

Hi,

I'm coming from Mathematica since Mathematica uses single-core to compute multiplications of puiseux series, so I'm looking for any software that might do this faster. I don't know Maple -- I hope it can use multiple cores and runs faster.

 

My calculation is basically multplying out thousands of terms of the following type:

5/y + 10 + y + (((8/y^2 - 13/y + 108) - 64/y) + 10*y^2)*q + (3/y^3 + 2/y^2 - 240/y + 808 - 513*y + 108*y^2 + y^3)*q^2

How should I do this? Maple doesn't seem to have multivariate puiseux series data structure. But observe my series is simple -- I have a power series in q and a Laurent series in y.

I could

1. Multiply using 'expand' . My worry is, if I expand product of two series in q^10000 then this is probably slower than Mathematica since 'expand' would compute far more terms than necessary instead of throwing away the extra terms beyond q^10000 in some O(q^10000) notation like Mathematica does.

2. I could use 'series' in q. 

series((1/y + 10 + y + (((10/y^2 - 64/y + 108) - 64/y) + 10*y^2)*q + (1/y^3 + 108/y^2 - 513/y + 808 - 513*y + 108*y^2 + y^3)*q^2)*(1/y + 10 + y + (((10/y^2 - 64/y + 108) - 64/y) + 10*y^2)*q + (1/y^3 + 108/y^2 - 513/y + 808 - 513*y + 108*y^2 + y^3)*q^2), q = 0, 2)

This has the undesirable feature of not expanding out in y, returning 

series((1/y + 10 + y + (((10/y^2 - 64/y + 108) - 64/y) + 10*y^2)*q + (1/y^3 + 108/y^2 - 513/y + 808 - 513*y + 108*y^2 + y^3)*q^2)*(1/y + 10 + y + (((10/y^2 - 64/y + 108) - 64/y) + 10*y^2)*q + (1/y^3 + 108/y^2 - 513/y + 808 - 513*y + 108*y^2 + y^3)*q^2), q = 0, 2).

 

I could then call expand on this, but using both series and then expand makes me worry about runtime.

 

Any advice?

Here is the minimal working example: 

with(Physics):
Setup(noncommutativeprefix={W,V});
simplify(W^(-1)*(-W^(-1)-W*V^(-2)));

 

It gives the result  below, which is wrong. Or am I misinterpreting? (Maple 2018)

 

(-V^2-W^2)*(1/V^2)*(1/W^2)

how i can solve a system of integral equations? thanks for the help.
 

restart; with(LinearAlgebra); with(VectorCalculus)

pin1 := 1858.; pout1 := 0; pin2 := 0.1858e5; pout2 := 0; S := 1; T := 10; Fa1 := 0.; Fa2 := 0.
``

T[rr] := -pin-C10*simplify(int(B^2*sqrt((r^2-A)/B)^(2+m)/r^3-r/sqrt((r^2-A)/B)^(2-m), r = s .. t))/S^m-C20*simplify(int(r/(B^2*sqrt((r^2-A)/B)^(2-n))-sqrt((r^2-A)/B)^(2+n)/r^3, r = s .. t))/S^n

eq1 := C10*simplify(int((-2*A*r^2+A^2)/(r^3*sqrt((r^2-A)/B)^(2-m)), r = s .. t))/S^m+C20*simplify(int((2*A*r^2-A^2)/(B^2*r^3*sqrt((r^2-A)/B)^(2-n)), r = s .. t))/S^n

eq2 := 2*Pi*simplify(int(T[rr]*r, r = s .. t))-2*Pi*C10*simplify(int((B^4*sqrt((r^2-A)/B)^(2+m)-r^2*sqrt((r^2-A)/B)^m)/(B^2*r), r = s .. t))/S^m-2*Pi*C20*simplify(int((-B^3*r^3+A*B^3*r+r^3)/(B^2*sqrt((r^2-A)/B)^(2-n)), r = s .. t))/S^n

A := 0.50456255261718905958813087648305534133592085046840e-2; B := 1.0000045465297826882965065372650452712135679772907; S := 1; T := 10; Eq1 := simplify(subs([t = sqrt(B*T^2+A), s = sqrt(B*S^2+A)], eq1)); Eq2 := simplify(subs([pin = 1858., t = sqrt(B*T^2+A), s = sqrt(B*S^2+A)], eq2))

6.283156738*(int(0.5045671411e-2*C10*r*(int((2.*r^2-0.5045625526e-2)*(.9999954530*r^2-0.5045602584e-2)^((1/2)*m)/(r^3*(r^2-0.5045625526e-2)), r = 1.002521906 .. 10.00027501))-0.5045625526e-2*C20*r*(int((2.*r^2-0.5045625526e-2)*(.9999954530*r^2-0.5045602584e-2)^((1/2)*n)/((r^2-0.5045625526e-2)*r^3), r = 1.002521906 .. 10.00027501))-1858.008448*r, r = 1.002521906 .. 10.00027501))-6.283128170*C10*(int((.9999954530*r^2-0.5045602584e-2)^((1/2)*m)*(0.13641e-4*r^2-0.5045694353e-2)/r, r = 1.002521906 .. 10.00027501))+6.283156738*C20*(int((0.1364100000e-4*r^3-0.5045694353e-2*r)*(.9999954530*r^2-0.5045602584e-2)^((1/2)*n)/(r^2-0.5045625526e-2), r = 1.002521906 .. 10.00027501))

(1)

``

Eq3 := simplify(subs([t = sqrt(B*T^2+A), s = sqrt(B*S^2+A)], eq1)); Eq4 := simplify(subs([pin = 0.1858e5, t = sqrt(B*T^2+A), s = sqrt(B*S^2+A)], eq2))

6.283156738*(int(0.5045671411e-2*C10*r*(int((2.*r^2-0.5045625526e-2)*(.9999954530*r^2-0.5045602584e-2)^((1/2)*m)/(r^3*(r^2-0.5045625526e-2)), r = 1.002521906 .. 10.00027501))-0.5045625526e-2*C20*r*(int((2.*r^2-0.5045625526e-2)*(.9999954530*r^2-0.5045602584e-2)^((1/2)*n)/((r^2-0.5045625526e-2)*r^3), r = 1.002521906 .. 10.00027501))-18580.08448*r, r = 1.002521906 .. 10.00027501))-6.283128170*C10*(int((.9999954530*r^2-0.5045602584e-2)^((1/2)*m)*(0.13641e-4*r^2-0.5045694353e-2)/r, r = 1.002521906 .. 10.00027501))+6.283156738*C20*(int((0.1364100000e-4*r^3-0.5045694353e-2*r)*(.9999954530*r^2-0.5045602584e-2)^((1/2)*n)/(r^2-0.5045625526e-2), r = 1.002521906 .. 10.00027501))

(2)

  ``

NULL

ANS := fsolve({Eq1 = pout1-pin1, Eq2 = Fa1, Eq3 = pout2-pin2, Eq4 = Fa2}, {C10, C20, m, n})

``

NULL

NULL


 

Download fsolve.mw

Hello,

I have a procedure, SoS that returns the value for sos. After compiling the procedure, I get float(undefined) for the return value. How can this be fixed?

 

Thanks so much for your time.

 


 

restart; kernelopts(version); interface(version)

`Standard Worksheet Interface, Maple 2019.2, Windows 10, November 26 2019 Build ID 1435526`

(1)

NULL``

Erealm := Array([1235.773, 1383.61, 1457.262, 1500.264, 1550.184, 1612.161, 512.7612, 656.6554, 743.6461, 793.375, 855.7937, 939.1199, 79.9523, 128.1375, 167.1459, 193.592, 230.5401, 287.8348, 22.389, 29.41424, 35.91883, 40.86366, 48.79128, 63.4475, 15.34275, 17.10101, 18.63288, 19.77424, 21.5671, 24.84739, 13.8321, 14.52843, 15.07626, 15.47014, 16.07713, 17.16574, 13.13383, 13.63704, 13.95888, 14.16849, 14.46123, 14.93971, 12.76736, 13.2203, 13.50072, 13.673, 13.89852, 14.23242], datatype = float[8]); LFm := Array([.156795, .1248161, .1108722, .1032334, 0.9474591e-1, 0.8496174e-1, .361361, .3020133, .2706018, .2546556, .2356126, .2121333, .6883826, .6532309, .6155578, .5906291, .5578895, .5123917, .394458, .5326358, .6095816, .6489291, .6894866, .7232845, .1456468, .2226473, .2826954, .3228541, .3789496, .4632182, 0.6758032e-1, 0.9437384e-1, .1198126, .1387971, .1680719, .2181531, 0.5173809e-1, 0.586771e-1, 0.6591736e-1, 0.7206892e-1, 0.8243504e-1, .1024519, 0.457877e-1, 0.493836e-1, 0.5191291e-1, 0.539114e-1, 0.5708074e-1, 0.6330242e-1], datatype = float[8]); maxx := ArrayNumElems(LFm); E0 := 13.; E00 := 4200.; alpha := .5; beta := 0.7e-1
NULL

``

SoS := proc (E0::float, E00::float, alpha::float, beta::float, maxx::integer, Erealm::(Array(datatype = float[8])), LFm::(Array(datatype = float[8])))::float; local k, omegatau, Ecomplex, Erealc, Eimagc, LFc, sos; sos := 0.; for k to maxx do Ecomplex := Complex(Erealm[k], Erealm[k]*LFm[k]); omegatau := abs(-I*(((E0-E00)/(Ecomplex-E00))^(1/beta)-1)^(1/alpha)); Erealc := Re(E00+(E0-E00)/(1+(I*omegatau)^alpha)^beta); Eimagc := Im(E00+(E0-E00)/(1+(I*omegatau)^alpha)^beta); LFc := Eimagc/Erealc; sos := sos+(log10(Erealm[k])-log10(Erealc))^2+(LFm[k]-LFc)^2 end do; return sos end proc

``

``

SoS(E0, E00, alpha, beta, maxx, Erealm, LFm)

HFloat(0.015392438292813794)

(2)

cSoS := Compiler:-Compile(SoS); cSoS(E0, E00, alpha, beta, maxx, Erealm, LFm)

Float(undefined)

(3)

``

``


 

Download Compile_proc.mw

 

Hey, to all!

First post here and after searching the web for answers I thought I'll ask it here.

haven't used Maple for a long time so I'm quite new in it.

I've solved a PDE in a numeric and in a analytic way and I want to the find the difference between the results.

I've come up with this:

1.2.mw

Had few tries with a few commands but for no success.

I seem to be able to find the specific value of the analytical solution but not the numeric one although it is solved.

Also I can't subtract to find the difference.

I will appreciate help in any kind,

Thank you!

 

I'm not sure if it's possible to find a formula with predictive qualities, but I thought I'd ask anyway ...

IOD.mw

         I'd like to draw a graph with its  vertices  of 3d style.  Just like following image:

  

  I did not find the desired choices for this graph.

First 448 449 450 451 452 453 454 Last Page 450 of 2282