Maple 2019 Questions and Posts

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

Hope that no one minds a beginners question.   How do I enter non-null k=0 robertson-walker tetrad in the physics package?  Not the tensor package as that has depreciated or the differential geometry package as notation is different there.

How can I set Maple 2019 so that all inputs are of the color red?

I am using a Lenovo Notebook 64-bit.

 

Thank you, Jan Drösler

 

I am trying to write a metric in Maple 2019, using the Physics package in Cartesian coordinates. I know that there is already a pre-installed way in which to set the coordinates to Cartesian, namely, if we have something like 

Setup(coordinates=cartesian);

or similarly, using the Coordiantes calling sequence, such that we may define something like

Coordinates(A=cartesian);Setup(coordinates=A);

yet, if I am not mistaken, this gives the coordinates in the following form: {x,y,z,t}, yet I seek to define the metric in the following, perhaps more arbitrary coordinate system, {x1,x2,x3,t}. Is there any way to setup the coordinate system to read like the set I just described, such that I can then take a norm of these three spatial coordaintes to be |x|? Any help would be greatly appreciated. 

   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. 

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?

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

 

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.

Hi,

I would like to determine if some lengthy expression F is linear in one of its inderteminates X.
 I use to use type(F, linear(X)) to do this but I've just found that if F is piiecewise defined, then type(F, linear(X)) returns false even if E is linear in X...
For instance, let  F := a*X+piecewise(Y<0, X, b)
then type(F, X) returns false.

I do not pretend it is a bug: at first sight I would say that F is linear with respect to X but maybe the notion of linearity with respect to an indeterlinate must be interpretated as "linear on each branch" ?

For the moment I've circumvented the problem by doing this :
dF := diff(F, X):
has(dF, X):
# returns {\emptyset} if F is linear in X
 

But, as I said, F can be a rather lengthy expression invoking a lot of piecewise constructors, and I don't think that computing dF is an efficient way to do the job.

Do you have a better idea to proceed?

Thanks in advance

When the Explore command results in a slider, for example like this:

Explore(plot(x^2 + a, x = 0 .. 10), a = 10.5000000000 .. 11.5000000000)

The value shown next to the slider has only one decimal place, despite the fact that the slider can be easly placed at values in between.  Is there a way to change the number of decimal places shown on the slider label for the Explore command?

Thanks.

Hi ,

How to animate implicitplot?

Thanks 


 

NULL

 

NULL

 

plots:-animatecurve(1/x, x = 0 .. 5, thickness = 5, size = [150, 150], axes = none, color = red)

 

with(plots, implicitplot)

 

P1 := implicitplot(x^2+y^2 = 9, x = -3 .. 3, y = -9 .. 9, thickness = 5, size = [150, 150], axes = none, color = red)

 

``

``

plots:-animatecurve(2*abs(x), x = -.5 .. .5, thickness = 5, size = [150, 150], axes = none, color = red)

 

with(plots, implicitplot)

 

implicitplot(x = -3*abs(sin(y)), x = -3 .. 3, y = 0 .. 6, thickness = 5, size = [150, 150], axes = none, color = red)

 

NULL

 

 

NULL

 

NULL

with(plots)

P1 := plots:-animatecurve(sqrt(1-(abs(x)-1)^2), x = -2 .. 2, thickness = 5, axes = none)

P2 := plots:-animatecurve(arccos(1-abs(x))-Pi, x = -2 .. 2, thickness = 5, axes = none)

P := display(P1, P2, view = [-2 .. 2, -3 .. 1], size = [350, 350], axes = none)

 

NULL

 

 

 

 

``


 

Download LoveMaple1Anim.mws.mw
 

NULL

 

NULL

 

plots:-animatecurve(1/x, x = 0 .. 5, thickness = 5, size = [150, 150], axes = none, color = red)

 

with(plots, implicitplot)

 

P1 := implicitplot(x^2+y^2 = 9, x = -3 .. 3, y = -9 .. 9, thickness = 5, size = [150, 150], axes = none, color = red)

 

``

``

plots:-animatecurve(2*abs(x), x = -.5 .. .5, thickness = 5, size = [150, 150], axes = none, color = red)

 

with(plots, implicitplot)

 

implicitplot(x = -3*abs(sin(y)), x = -3 .. 3, y = 0 .. 6, thickness = 5, size = [150, 150], axes = none, color = red)

 

NULL

 

 

NULL

 

NULL

with(plots)

P1 := plots:-animatecurve(sqrt(1-(abs(x)-1)^2), x = -2 .. 2, thickness = 5, axes = none)

P2 := plots:-animatecurve(arccos(1-abs(x))-Pi, x = -2 .. 2, thickness = 5, axes = none)

P := display(P1, P2, view = [-2 .. 2, -3 .. 1], size = [350, 350], axes = none)

 

NULL

 

 

 

 

``


 

Download LoveMaple1Anim.mws.mw

 

Hello everyone.

I have a very simple question.  When I use maple to solve the following equations,  everything works as expected

solve({
a + b + c + d = 0,
d * (480-471.1) + b * (484.3-471.1) + c * (547.2-471.1) + m4 = 0,
a * (471.1-484.3) + d * (480-484.3) + c * (547.2-484.3)  + m4 = 0,
a * (471.1-547.2) + d * (480-547.2) + b * (484.3-547.2) + m4 = 0,
a * (471.1-477) + d * (480-477) + b * (484.3-477) + c * (547.2-477) + m4 = 0,
a * (471.1-494) + d * (480-494) + b * (484.3 - 494) + c * (547.2 - 494) + m4 = 0,
a * (471.1-540) + d * (480-540) + b * (484.3 - 540) + c * (547.2-540) + m4 = 0,
a * (471.1-477) + m1 = 0,
a * (471.1-494) + d * (480-494) + b * (484.3 - 494) + m2 = 0,
a * (471.1-540) + d * (480-540) + b * (484.3 - 540) + m3 = 0},{a,b,c,d,m4})

Now if I add one more equation to it then maple won't solve

solve({
a + b + c + d = 0,
d * (480-471.1) + b * (484.3-471.1) + c * (547.2-471.1) + m4 = 0,
a * (471.1-484.3) + d * (480-484.3) + c * (547.2-484.3)  + m4 = 0,
a * (471.1-547.2) + d * (480-547.2) + b * (484.3-547.2) + m4 = 0,
a * (471.1-477) + d * (480-477) + b * (484.3-477) + c * (547.2-477) + m4 = 0,
a * (471.1-494) + d * (480-494) + b * (484.3 - 494) + c * (547.2 - 494) + m4 = 0,
a * (471.1-540) + d * (480-540) + b * (484.3 - 540) + c * (547.2-540) + m4 = 0,
a * (471.1-477) + m1 = 0,
a * (471.1-494) + d * (480-494) + b * (484.3 - 494) + m2 = 0,
a * (471.1-540) + d * (480-540) + b * (484.3 - 540) + m3 = 0
a * (471.1-481) + d * (480-481) + mx = 0},{a,b,c,d,m4,mx})

Obviously,  using the first solve command,  I can solve for a and d.  I can substitude that into the last equation and solve for mx.  But for some reason, maple just won't do that for me directly from the second solve command.

Can someone help?  thanks

 

 

Refers to yMaple 2019.1

The command alias(X(s)=laplace(x(t),s,t)) will not be executed in the  code following it. It seems that the 'funny font' L used instead of the word 'laplace' ist not recognized. Maple 2018.2.1 works fine, since it doesn't use the 'L" but works with 'laplace'. Is there a fix ?

The ideas here are to allow 3D plotting commands such as plot3d to handle a `size` option similarly to how 2D plotting commands do so, and for the plots:-display command to also handle it for 3D plots.

The size denotes the dimensions of the inlined plotting window, and not the relative lengths of the three axes.

I'd be interested in any new problems introduced with this, eg. export, etc.

restart;

#
# Using ToInert/FromInert
#
# This might go in an initialzation file.
#
try
  __ver:=(u->:-parse(u[7..:-StringTools:-Search(",",u)-1]))(:-sprintf("%s",:-kernelopts(':-version')));
  if __ver>=18.0 and __ver<=2019.2 then
    __KO:=:-kernelopts(':-opaquemodules'=false);
    :-unprotect(:-Plot:-Options:-Verify:-ProcessParameters);
    __KK:=ToInert(eval(:-Plot:-Options:-Verify:-ProcessParameters)):
    __LL:=[:-op([1,2,1,..],__KK)]:
    __NN:=:-nops(:-remove(:-type,[:-op([1,..],__KK)],
                          ':-specfunc(:-_Inert_SET)'))
          +:-select(:-has,[:-seq([__i,__LL[__i]],
                                 __i=1..:-nops(__LL))],
                    "size")[1][1];
    if :-has(:-op([5,2,2,2,1],__KK),:-_Inert_PARAM(__NN)) then
      __KK:=:-subsop([5,2,2,2,1]
                     =:-subs([:-_Inert_PARAM(__NN)=:-NULL],
                              :-op([5,2,2,2,1],__KK)),__KK);
      :-Plot:-Options:-Verify:-ProcessParameters:=
      :-FromInert(:-subsop([5,2,2,3,1]
                  =:-subs([:-_Inert_STRING("size")=:-NULL],
                          :-op([5,2,2,3,1],__KK)),__KK));
      :-print("3D size patch done");
    else
      :-print("3D size patch not appropriate; possibly already done");
    end if;
  else
    :-print(sprintf("3D size patch not appropriate for version %a"),__ver);
  end if;
catch:
  :-print("3D size patch failed");
finally
  :-protect(:-Plot:-Options:-Verify:-ProcessParameters);
  :-kernelopts(':-opaquemodules'=__KO);
end try:

"3D size patch done"

 

P := plot3d(sin(x)*y^2, x=-Pi..Pi, y=-1..1, size=[150,150],
            font=[Times,5], labels=["","",""]):
P;

plots:-display(P, size=[300,300], font=[Times,10]);

#
# inherited from the contourplot3d (the plot3d is unset).
#
plots:-display(
  plots:-contourplot3d(sin(x)*y^2, x=-Pi..Pi, y=-1..1,
                       thickness=3, contours=20, size=[800,800]),
  plot3d(sin(x)*y^2, x=-Pi..Pi, y=-1..1, color="Gray",
         transparency=0.1, style=surface)
);

# Some options should still act as 2D-plot-specific.
#
try plot3d(sin(x)*y^2, x=-Pi..Pi, y=-1..1, legend="Q");
    print("Not OK");
catch:
if StringTools:-FormatMessage(lastexception[2..-1])
   ="the legend option is not available for 3-D plots"
then print("OK"); else print("Not OK"); error; end if; end try;

"OK"

 

Download 3Dsize_hotedit.mw

If this works fine then it might be a candidate for inclusion in an initialization file, so that it's
automatically available.

I want to solve the following ode: 

ode := diff(x(t), t) = k*(a - x(t))*(b - 2*x(t))^2

k, a and b are positive real numbers and I want to add the condition that a-x(t) >= 0 and b-2x(t) >=0, in addition to x(0)=0

how to I do that?

First 22 23 24 25 26 27 28 Last Page 24 of 44