Maple 2023 Questions and Posts

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

can someone help me curve fitting these parameeters...i only got 1 for all of this 90As4.mw

restart

with(Statistics)with(plots)with(Optimization)with(LinearAlgebra)

E[1] := 126*10^9E[2] := 11*10^9G[12] := 6.6*10^9G_0__12 := 10.1*10^9nu[12] := .28E_0__2 := 15.5*10^9

true_strain := [0, .406915, .710106, .989362, 1.28457, 1.53989, 1.86702, 2.21011, 2.625, 2.99202]; true_stress := [0, 46.0227*10^6, 81.8182*10^6, 109.091*10^6, 138.068*10^6, 163.636*10^6, 194.318*10^6, 219.886*10^6, 248.864*10^6, 267.614*10^6]; epsilon_dot := 10^(-4)

sigma_t := map(proc (epsilon) options operator, arrow; E[instantaneous]*(1-lambda[90*deg]*epsilon*(sum(P[i], i = 1 .. 10)-(sum(P[i]*exp(lambda[i]*epsilon/epsilon_dot), i = 1 .. 10)))/epsilon_dot)*epsilon end proc, true_strain)

``

obj := sum((sigma_t[i]-true_stress[i])^2, i = 1 .. 10)

indets(obj, name)

{E[instantaneous], P[1], P[2], P[3], P[4], P[5], P[6], P[7], P[8], P[9], P[10], lambda[1], lambda[2], lambda[3], lambda[4], lambda[5], lambda[6], lambda[7], lambda[8], lambda[9], lambda[10], lambda[90*deg]}

(1)

Optimization[Interactive](obj)

The solution was obtained with the following warning:
  no iterations performed as initial point satisfies first-order conditions

 

[Float(infinity), [E[instantaneous] = HFloat(1.0), P[1] = HFloat(1.0), P[2] = HFloat(1.0), P[3] = HFloat(1.0), P[4] = HFloat(1.0), P[5] = HFloat(1.0), P[6] = HFloat(1.0), P[7] = HFloat(1.0), P[8] = HFloat(1.0), P[9] = HFloat(1.0), P[10] = HFloat(1.0), lambda[1] = HFloat(1.0), lambda[2] = HFloat(1.0), lambda[3] = HFloat(1.0), lambda[4] = HFloat(1.0), lambda[5] = HFloat(1.0), lambda[6] = HFloat(1.0), lambda[7] = HFloat(1.0), lambda[8] = HFloat(1.0), lambda[9] = HFloat(1.0), lambda[10] = HFloat(1.0), lambda[90*deg] = HFloat(1.0)]]

(2)
 

NULL

Download 90As4.mw

How do I stop truncation in Maple 2023?  Everything was working fine yesterday but today all of a sudden all assignments are truncated to only 10 digits.

If:

with(Units) :

a_Terra := 149598023.*Unit(km) :
A_Luna := 0.136 :
L_Sol := 3.75E28*Unit(lm) :
S_sphere := r -> 4*Pi*r^2 :

J_Luna := A_Luna*L_Sol/S_sphere(a_Terra) :

Then:

"" gives ""

but

"" gives ""

"" without "evalf" also provides a truncated number instead of showing the "Pi" for an exact value.  So something is wrong in the assignment settings.

Somehow the settings must have changed for how assignments are stored. The answer is irrational with a factor of "1/Pi" and so should not be truncated for calculations.  "a_Terra" is assigned with 9 significant digits ("" km) which I am wondering if maybe why "evalf" is truncating to 10 digits (though it should round and not truncate in that case) but it wasn't doing this before.

"Tools --> Options --> Precision" hasn't changed is set globally to round screen display to 32 decimal places and to round calculation to 64 significant digits.

Is there a way to reassign the arcsecant function "arcsec()" as "asec()" so that "arcsec" can be assigned to the arcsecond unit "Unit(arcsec)"?

Ideally, I would like all of the inverse trigonometric functions to use the shorter notation "asec()" instead of "arcsec()".  I usually do this as aliases, i.e. "alias(asin = arcsin) : alias(asec = arcsec) :" but this won't allow reusing "arcsec" for a unit instead.

Example error for Maple 2023:

alias(asec = arcsec) :
AddUnit(astronomical_unit, context = astronomy, default = true, prefix = SI, conversion = 149597870700*m) : # https://en.wikipedia.org/wiki/astronomical_unit
AddUnit(second, context = angle, spelling = arcsecond, plural = arcseconds, symbol = arcsec, prefix = SI_negative) :

AddUnit(parsec, context = astronomy, default = true, prefix = SI, conversion = AU/tan(arcsec)) ; # https://en.wikipedia.org/wiki/Parsec#Calculating_the_value_of_a_parsec

"Pi/648000" has to be used instead of "arcsec" here when defining the parsec since "arcsec" is already reserved for the arcsecant function, even with "alias(asec = arcsec) ;".

Correction: it looks like the parsec was redefined by the IAU in 2012 as exactly "648000*AU/Pi" without any tangents (or sines) in the definition (so the angle subtended by 1 AU at 1 PC is actually 0.999999999992" not 1").  Both "astronomical_unit" and "parsec" have the wrong values in Maple 2023 which need to be corrected manually.  But the conflict between arcseconds and arcsecants remains the same.

https://iau.org/static/resolutions/IAU2015_English.pdf

https://iopscience.iop.org/article/10.3847/0004-6256/152/2/41

I am trying to install Syrup in my home computer (I have it installed in my work computer).  I followed the instructions in the Readme file: 

From Standard Maple:
    Open the file Syrup-Installer.mla.
    To do so, use File -> Open, choose file type 
    "Maple Library Archive (.mla)", select the file, and
    click "Open".

Everything seemed to work and the help page opened up:  But, it is not the syrup help page.  furthermore, when I type ?Syrup, it doesn't open it either.

 

When I try to run a worksheet that uses Syrup (that works on my work computer), I get these errors:

I"m going to reboot now and try again.  

Jorge

As Maple is not equipped to handle numerical solutions of elliptic PDEs, can anyone help top solve PDEs by finite differences or any other numerical solver?

pde.mw

See attached worksheet in Maple 2023.

This example is taken from the Maple help page. I want to 'zoom in' on a plot3d object. The only way I have found was from responses [1] on the maple primes forum. It uses InlinePlot and the scale option to perform the 'zoom in'. Since InlinePlot generates the plot in terms of XML there is no graphic out, only a text based output. In order to reconstitute the InlinePlot as a plot object I can view visually I need to use some additional commands from the DocumentTool package. This is all great but the output, which in our case is P3, is not a plot object and therefore cannot be exported as a png. Is there a way to convert the InlinePlot with the scaling applied back to a typical plot object so I can export it as a .png, using Export("output_plot.png",P3,base=worksheetdir)?

can_I_convert_InlinePlot(P3)_back_to_a_regular_plot_object_so_I_can_export_it_as_a_png.mw

I am running Maple 2023 - yes I should update - and I found a weird "bug" if you could call it that. For different versions of the Physics package I am getting different answers on the same problem. 
 

This is what I was getting when I run Version 1410:

restart;

with(Physics):

 

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1744. The version installed in this computer is 1410 created 2023, March 11, 12:59 hours Pacific Time, found in the directory /Users/b2hull/maple/toolbox/2023/Physics Updates/lib/`

(1)

Setup(mathematicalnotation=true):

g_[arbitrary]:

_______________________________________________________

 

`Systems of spacetime coordinates are:`*{X = (x1, x2, x3, x4)}

 

`Default differentiation variables for d_, D_ and dAlembertian are:`*{X = (x1, x2, x3, x4)}

 

`Setting `*lowercaselatin_is*` letters to represent `*space*` indices`

 

`The arbitrary metric in coordinates `*[x1, x2, x3, x4]

 

`Signature: `(`- - - +`)

 

_______________________________________________________

(2)

LG :=(g_[~mu,~nu]*Ricci[mu,nu])*sqrt(-%g_[determinant]);

Physics:-g_[`~mu`, `~nu`]*Physics:-Ricci[mu, nu]*(-%g_[determinant])^(1/2)

(3)

SG:=Intc(LG,X)

Int(Int(Int(Int(Physics:-g_[`~mu`, `~nu`]*Physics:-Ricci[mu, nu]*(-%g_[determinant])^(1/2), x1 = -infinity .. infinity), x2 = -infinity .. infinity), x3 = -infinity .. infinity), x4 = -infinity .. infinity)

(4)

EQ:=Fundiff(SG,%g_[~delta,~gamma])/sqrt(-%g_[determinant])

((1/2)*%g_[`~mu`, `~nu`]*Physics:-Ricci[mu, nu]*%g_[delta, gamma]*%g_[determinant]/(-%g_[determinant])^(1/2)+Physics:-Ricci[mu, nu]*(-%g_[determinant])^(1/2)*%g_[delta, `~mu`]*%g_[gamma, `~nu`])/(-%g_[determinant])^(1/2)

(5)

Simplify(subs(%g_=g_,EQ))

-(1/2)*Physics:-g_[delta, gamma]*Physics:-Ricci[nu, `~nu`]+Physics:-Ricci[delta, gamma]

(6)

 

 

 

And this is what I get if I used the latet update for 2023, Version 1683:

restart;

with(Physics):

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1744. The version installed in this computer is 1683 created 2024, March 6, 17:43 hours Pacific Time, found in the directory /Users/b2hull/maple/toolbox/2023/Physics Updates/lib/`

(1)

Setup(mathematicalnotation=true):

g_[arbitrary]:

_______________________________________________________

 

`Systems of spacetime coordinates are:`*{X = (x1, x2, x3, x4)}

 

`Default differentiation variables for d_, D_ and dAlembertian are:`*{X = (x1, x2, x3, x4)}

 

`Setting `*lowercaselatin_is*` letters to represent `*space*` indices`

 

`The arbitrary metric in coordinates `*[x1, x2, x3, x4]

 

`Signature: `(`- - - +`)

 

_______________________________________________________

(2)

LG :=(g_[~mu,~nu]*Ricci[mu,nu])*sqrt(-%g_[determinant]);

Physics:-g_[`~mu`, `~nu`]*Physics:-Ricci[mu, nu]*(-%g_[determinant])^(1/2)

(3)

SG:=Intc(LG,X)

Int(Int(Int(Int(Physics:-g_[`~mu`, `~nu`]*Physics:-Ricci[mu, nu]*(-%g_[determinant])^(1/2), x1 = -infinity .. infinity), x2 = -infinity .. infinity), x3 = -infinity .. infinity), x4 = -infinity .. infinity)

(4)

EQ:=Fundiff(SG,%g_[~delta,~gamma])/sqrt(-%g_[determinant])

-(1/2)*%g_[delta, gamma]*Physics:-g_[`~mu`, `~nu`]*Physics:-Ricci[mu, nu]

(5)

Simplify(subs(%g_=g_,EQ))

-(1/2)*Physics:-g_[delta, gamma]*Physics:-Ricci[nu, `~nu`]

(6)

 

 

Strange right? I bring this up because it makes me wonder about potential errors in other computations...

The answer - equation 6 - in 1410 is the correct answer. This is simply a derivation of the Einstein Tensor. 

I`m trying execute the example of Deeplearnig:

with(DeepLearning);
v1 := Vector(8, i -> i, datatype = float[8]);
v2 := Vector(8, [-1.0, 1.0, 5.0, 11.0, 19.0, 29.0, 41.0, 55.0], datatype = float[8]);
model := Sequential([DenseLayer(1, inputshape = [1])]);
model := Vector(2, {(1) = Typesetting:-mi("`DeepLearning 

   Model`"), (2) = Typesetting:-mi("`<keras.engine.sequential.Se\

  quential object at 0x000001C5B6520700>`")})


model:-Compile(optimizer = "sgd", loss = "mean_squared_error");
model:-Fit(v1, v2, epochs = 500);
"<Python object: <keras.callbacks.History object at 0x000001C5CC\

  EE9DE0>>"


convert("<Python object: <keras.callbacks.History object at 0x000001C5CCEE9DE0>>", 'symbol');
<Python object: <keras.callbacks.History object at 0x000001C5CCE\

  E9DE0>>


model:-Predict([10]);

 

But, finally, there is this error:

Error, (in Predict) AttributeError: 'CatchOutErr' object has no attribute 'flush'

['Traceback (most recent call last):\n', '  File "C:\\Program Files\\Maple 2023\\Python.X86_64_WINDOWS\\lib\\site-packages\\keras\\utils\\traceback_utils.py", line 70, in error_handler\n    raise e.with_traceback(filtered_tb) from None\n', '  File "C:\\Program Files\\Maple 2023\\Python.X86_64_WINDOWS\\lib\\site-packages\\keras\\utils\\io_utils.py", line 80, in print_msg\n    sys.stdout.flush()\n', "AttributeError: 'CatchOutErr' object has no attribute 'flush'\n"]

What`s is happening?

Thanks!

Hello,

I'm encountering an issue with the "roots of complex number" message while running my Maple code. Maple seems unable to solve this problem for me.

I would greatly appreciate any ideas or suggestions that could help me resolve this error.

Vib-code.mw

I keep getting an error: invalid subscript selector on specifically this part of my code:

MuligIndgange := subsop(RemoveList\[i\]=NULL, MuligIndgange).
Whenever I comment out the MuligIndgange := part it works.

I can't for the life of me see why it's happening, and whenever I use this code outside my proc it works aswell.

Any help is appreciated, and if you need more context I'll be happy to give it.

for i to numelems(MuligIndgange) do
     if M1[MuligIndgange[i][1], MuligIndgange[i][2]] =/= 0 then
         RemoveList := [op(RemoveList), i];
      end if;
end do;
for i from numelems(RemoveList) by -1 to 1 do
    MuligIndgange := subsop(RemoveList[i] = NULL, MuligIndgange);
end do;

Simple question (I'm sure) here.  I have one worksheet where the variable does not show up in the ouput of an assignment like this:

whereas I was expecting the output to include the variable being assigned like this in most other worksheets:

I am having some difficulting locating the cause (and therefore the setting) to have the behavior set back to including the variable name in the ouput.  Thanks in advance for your help.

Is it possible overlay one column graph on top of another ? And if, how do I do it?

Regards

I have a repetative set of parameter names used in procedures in a package. I settled on making all optional inputs in the format {name::type:=something}. Originally I wanted to use non capitalised names for the optional inputs. But the names clash with Maple commands. I have all sorts of quicky abbreviations like prnt etc. These are both messy and tacky. For many of my choices I would seem to have to use capitalised naming to give a meaningful name. The problem here is these names are used in other Maple packages. So sooner or later there is going to be a clash.

Is there a way a of handling this? Like can I defiine package parameter names? Or should I just stick with my abbreviations?

I read somewhere about this problem in the help years ago. I think Basis was the example used in different packages GroebinerBasis and Polynomial package and using PackageName:-Basis to avoid the clash with both loaded. But that is more a command level handling.

restart

 

illegal:=proc(x,y,{Point:=[symbol=solidcircle,colour=purple]},{Line:=[colour=green,thickness=2]},{Colour:="Blue"},{Scale:=5},{Print:="y"})

print("1 Point= ",Point);  #I currently use points
print("2 Line= ",Line);   #                 linetype
print("3 Colour=  ",Colour); #              clr     this has nothing to do with plotting colour
print("4 Scale= ",Scale);   #               scl   
print("5 Print= ",Print);   #               prnt
Scale*x/y
end proc

 

proc (x, y, { Colour := "Blue", Line := [colour = green, thickness = 2], Point := [symbol = solidcircle, colour = purple], Print := "y", Scale := 5 }) print("1 Point= ", Point); print("2 Line= ", Line); print("3 Colour=  ", Colour); print("4 Scale= ", Scale); print("5 Print= ", Print); Scale*x/y end proc

(1)

illegal(3,7)

"1 Point= ", [symbol = solidcircle, colour = purple]

 

"2 Line= ", [colour = green, thickness = 2]

 

"3 Colour=  ", "Blue"

 

"4 Scale= ", 5

 

"5 Print= ", "y"

 

15/7

(2)

illegal(3,7,line=[linestyle=dash,colour=black,thickness=4])

"1 Point= ", [symbol = solidcircle, colour = purple]

 

"2 Line= ", [colour = green, thickness = 2]

 

"3 Colour=  ", "Blue"

 

"4 Scale= ", 5

 

"5 Print= ", "y"

 

15/7

(3)
 

 

Download 2024-03-09_Illegal_or_Not.mw

I've been writing this code to simulate the orbit of Venus in a simple 2D polar plot, but it keeps telling me that I have insufficient initial conditions, here is the code:

restart:with(Physics):with(VariationalCalculus):with(plots):with(plottools):

R[V] := 0.72*AU: #`starting radius for venus`

AU := 1: #`astronomical unit`

G := 6.674*10^(-11): #`gravitational constant`

m[S] := (333*10^3)*m[E]: #`mass of the sun`

m[V] := 0.815*m[E]: #`mass of venus`

m[E] := 1: #`mass of the earth`

x[V] := t -> r[V](t)*cos(theta[V](t)): #`x-coordinate`

y[V] := t -> r[V](t)*sin(theta[V](t)): #` y-coordinate`

x[VP] := t -> diff(x[V](t), t): #` x-velocity`

y[VP] := t -> diff(y[V](t), t): #`y-velocity`

T[V] := m[V]*simplify(x[VP](t)^2 + y[VP](t)^2)/2: #`kinetic energy of the system`

V[V] := (-G)*m[V]*m[S]*1/r[V](t): #`potential energy of the system`

L[V] := T[V] - V[V]; #`lagrangian of the system`

EL[Vr] := diff(L[V], r[V](t)) - diff(diff(L[V], diff(r[V](t), t)), t) = 0: #` e-l for the r-coordinate`

EL[`Vtheta;`] := diff(L[V], theta[V](t)) - diff(diff(L[V], diff(theta[V](t), t)), t) = 0: #`e-l for the theta-coordinate`

EL[V] := [EL[Vr], EL[`Vtheta;`]]; #` system of equations`

F[V] := G*m[V]*m[S]*1/R[V]^2: #`gravitational force for venus starting position`

omega[V] := sqrt(F[V]*R[V]*1/m[V])*1/R[V]: #`angular velocity for venus starting position`

IC[V] := [r[V](0) = R[V], D(r[V])(0) = 0, theta[V](0) = 0, D(theta[V])(0) = omega[V]]; #`initial conditions, r-position, r-velocity, theta-position, theta-velocity`

SOL := dsolve(EL[V], IC[V], [r[V](t), theta[V](t)], numeric, output = listprocedure); #`numerical solution`

Error, (in dsolve/numeric/type_check) insufficient initial/boundary value information for procedure defined problem
 

I have included both the initial values for r,dr/dt, theta and dtheta/dt.

I'm not sure what other initial conditions I could be missing?

Currently, a stand-alone or embeddable Python is by default bundled with Maple and is installed silently (namely, without notification) when installing Maple, but why is there no prompt panel asking for Python configuration (just like Why does Maple ask for a Matlab installation when I install it? and Configuring the Maple Kernel for Jupyter)? 
Actually, I am wondering why I am not capable of installing Maple without bundling Python (even if I am able to clear those files in $MAPLE/Python.$SYS later). In my opinion, a bundling Python suite is more or less unnecessary; wouldn't it be better to provide a tooltip asking for approval? If one really need to interact with Python, one may instruct Maple to make use of some available local version of Python from the outset (rather than having to install an additional Python interpreter with numerous extra packages that occupy almost 2 GB!), and if one does not require such a functionality, one can simply skip the Python installation and free up 2GB immediately. So, will installing Python (or another popular external program, if it is going to be integrated or connected with Maple in future releases) be optional during the Maple installation process? 

1 2 3 4 5 6 7 Last Page 1 of 29