Maple 2023 Questions and Posts

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

Perhaps a stupid question but I fail to convert 21/4a1/4/pi1/4 (a result of a calculation performed by maple) into (2a/pi)1/4.

I tried simplify, combine, collect, ... with options. None of them work.

Thank you. 

This question is an expansion of my previous reply. 

There exist sixty kinds of statements in Maple, whose major ​​​​portion can be used as an expression or within an expression (e.g., assignment, loop, and condition). But why is use an exception?

Moreover, since it is reasonable to think of use as a (partial) generalization (see below) of the subs function, shouldn't the behaviour of use be consistent with do/if?

Compare: "seq((…;…;…), x in x__0):" (not allowed) vs. "for x in x__0 do …;…;… od:" (allowed); "subs(x = x__0, (…;…;…)):" (not allowed) vs. "use x = x__0 in …;…;… od:" (Not allowed! Why?).)

Edit. Besides that, is there some workaround to do something like

  # If use can be used as an expression or within an expression, 
use x = 2 + y in 'use y = 4 in x + y end' end;
  # should return “use y~ = 4 in (2 + y) + y~ end use;” and 
(use y = 2 + x in x -> x + y end);
  # should output “x~ -> x~ + (2 + x);”. 
  # Unfortunately, I cannot find a workaround to stimulate them.

 at present? Note that the `subs` function is unable to do so, so in my opinion, only when the use of `use` is no longer limited to statements will it become a sweeping generalization of `subs`.

long time ago I asked about automatic spacing to improve latex for sqrt. A nice solution was provided in https://www.mapleprimes.com/questions/231062-Adding-Space-After-Sqrt-To-Improve-The-Latex

The above is activatived using spaceaftersqrt = true option for latex:-Settings

There is a similar issue for inert integration where a space is typically added before the final dx This is done similar to the above fix using \, See for example this Latex web site giving many examples.

But there is no option I could see to tell Maple to do this automatically for integration.

So all my inert integrals now look not too good as the dx is too close to the integrand. Here are 2 examples with the settings I am using

restart;

latex:-Settings(useimaginaryunit=i,
      usecolor = false,
      powersoftrigonometricfunctions= mixed, ## computernotation,
      leavespaceafterfunctionname = true,
      cacheresults = false,
      spaceaftersqrt = true,
      usetypesettingcurrentsettings=true,
      linelength=10000      
);

sol:=sqrt(4*y^3-a*y-b)*a;
Intat( subs(y=a,1/sol),a=y(x));
latex(%);

Int(sol,y);
latex(%);

I copied the latex and compiled it, and this is the result

\documentclass[12pt]{book}
\usepackage{amsmath}
\begin{document}

\[
\int_{}^{y \left(x \right)}\frac{1}{\sqrt{4 a^{3}-a^{2}-b}\, a}d a
\]

\[
\int \sqrt{4 y^{3}-a y -b}\, a d y
\]

\end{document}

Which gives

Compare the output when adding \, by hand to the latex

\documentclass[12pt]{book}
\usepackage{amsmath}
\begin{document}

\[
\int_{}^{y \left(x \right)}\frac{1}{\sqrt{4 a^{3}-a^{2}-b}\, a}\, d a
\]

\[
\int \sqrt{4 y^{3}-a y -b}\, a \, d y
\]

\end{document}

Which now gives much better result

Actually, what would be nice if the "d" in "dx" was mathrm which becomes

\documentclass[12pt]{book}
\usepackage{amsmath}
\begin{document}

\[
\int_{}^{y \left(x \right)}\frac{1}{\sqrt{4 a^{3}-a^{2}-b}\, a}\, \mathrm{d} a
\]

\[
\int \sqrt{4 y^{3}-a y -b}\, a \, \mathrm{d} y
\]

\end{document}

But may be I am asking for too much here. But having an option to add \, only for inert integration will be good to have.

Does there exist an option to do this that may be I overlooked?

Maple 2023.2

 

How I can plot a volumetric body with the coordinates provided in the text file attachment?

after finding the geometry curve I want to find the curve that passes through the middle source.

1.txt

There are two opposing commands remove and select in Maple. According to the main help page, StringTools:-RegSplit effectively implements the removal (i.e., capturing substrings that does not match the given pattern), but as regards extracting the matching parts of the input string (e.g., this example from MatLab), where is the command to carry out the selection?
At present I can do something like 

use StringTools in RegFilter := (p::string, s::string) -> select[2](RegMatch, sprintf("^%s$", p), (op@NGrams)~(s, [`$`](Length(s)))) end:
RegFilter("a.++b", "aabbbaaabb");
 = 
 ["aab", "abb", "aab", "abb", "aabb", "abbb", "aaab", "aabb", 

   "aabbb", "aaabb", "abbbaaab", "aabbbaaab", "abbbaaabb", 

   "aabbbaaabb"]


Nevertheless, there exist at least two disadvantages to it.

This is essentially equivalent to letting the matcher keeps starting at the same position until no more new matches are found, while sometimes one may just need the matcher to continue the shortest-match testing at the character following the last matched substring after finding a match:

For instance, there should be three flags in “RegFilter("a.+?b", "aabbbaaabb", 'overlapped'=⁇);”: 
⒈“["aab", "aaab"]” (selection with no overlap), 
⒉“["aab", "abb", "aaab", "aab", "abb"]” ( with partial overlaps), and 
⒊“["aab", "aabb", "aabbb", "aabbbaaab", "aabbbaaabb", "abb", "abbb", "abbbaaab", "abbbaaabb", "aaab", "aaabb", "aab", "aabb", "abb"]” ( with full overlaps). 

Unfortunately, the  above can only handle the last mode.

Another disadvantage is its inefficiency. Considering the following regular expression which matchs email-like strings

sample := Import("https://github.com/mariomka/regex-benchmark/raw/optimized/input-text.txt"): # lengthy 
re := "[a-zA-Z_0-9\\.+-]+@[a-zA-Z_0-9\\.-]+\\.[a-zA-Z_0-9\\.-]+":
time[real]((remnants := StringTools:-RegSplit(re, sample)));
 = 
                             3.157

So Maple is capable of completing this removal within 4 seconds, yet if I execute the analogous

timelimit(60, time[real](RegFilter(re, sample))); 

Maple will end up running out of memory.

In view of these, where is the generic StringTools:-RegFilter functionality? Or can we construct those matched cases from  and the original text?

integral of sqrt(sin(x)) is known to be as given in few place such as in here and other places.

Maple gives a result which is much more complicated (but also in terms of EllipticE special function). 

Could someone find a way to simplify it to the above answer and also to the same answer given by Mathematica?

int(sqrt(sin(x)),x)

Compare to 

Maple's result seems to be correct, as I plotted it and compared the smaller known resut. But I was not able to simplify it to obtain the smaller antiderivative.

Any tricks to do that?

Hi all

I need your advice on Maple usage after a long break. I installed Maple on my laptop and first of all tried to launch my old program. Surprisingly, the old file opened. While the core Maple functionality remained familiar, the user interface had undergone some changes.

Yet, I soon encountered challenges when attempting to perform even the simplest operations, like file browsing or text selection; the Maple Standard GUI seemed uncharacteristically sluggish.  I switched to Maple Input mode but it didn't help much. Are there ways to improve my experience with Maple? Is it caused by the outdated hardware?

My system:
Ubuntu 22.04.3 LTS
Dell Inc. Latitude 5510 (1TB SSD, 32GB RAM).

Maybe it works much better on Windows?

Thank you for any suggestions.

Hi, 

Some of my maple documents contain data tables. 

When I want to view these documents with the maple cloud viewer, the data tables are invisible (the table is completely grayed out) and it is therefore impossible to change the values in this table. 

The table properties are such that it is enabled, visible and editable. 
Does anyone have an idea how to solve this problem? 
Thanks in advance. 

Both, Maple and MapleSim in Versions from 2021 to 2023 do not start. A logfile is saved which starts as

# A fatal error has been detected by the Java Runtime Environment:

#

#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000000000000, pid=17256, tid=10520

#

# JRE version: OpenJDK Runtime Environment Temurin-19.0.1+10 (19.0.1+10) (build 19.0.1+10)

# Java VM: OpenJDK 64-Bit Server VM Temurin-19.0.1+10 (19.0.1+10, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)

# Problematic frame:

# C  0x0000000000000000

#

This only occurs when the notebook (on which the error occurs) is connected to the domain network. If the notebook is not connected, Maple and MapleSim can be started and will continue to run when the network is reconnected.

Has anybody seen this before or any ideas what this could be?

Edit: This all happened under Windows 10 on a notebook that has been running Maple for 3 years and only recently displayed this error.

Edit2: Connection via an USB doc which also connects to an external monitor.

Hello,
I recently discovered the "Physics" package wich provides tools for manipulating abstract vectors (non-component).
In the "Physics:-Vectors", an orthonormal basis (i,j,k) is available and my main concern is how to generate arbitrary other 3D orthonormal bases to be able to calculate results in "vectorial form" without manipulating vectors' components.

To better explain my needs I have setup a kind of minimal example in the attached file where some questions are asked.

Thanks in advance for any feedback.

orthonormal-triads.mw

NULL

restart

with(Physics)

with(Physics[Vectors])

Creation of 2 rotation matrices

dir1 := `<,>`(0, 0, 1)

dir2 := `<,>`(0, 1, 0)

seq(assign(cat(R, i), Student:-LinearAlgebra:-RotationMatrix(theta[i], eval(cat(dir, i)))), i = 1 .. 2)

print(R1, R2)

Matrix(%id = 36893490614987576012), Matrix(%id = 36893490614987577572)

(1)

whattype(R1)

Creation of  orthogonal unit "Physics:-Vectors" from previous matrices

x1_ := _i*R1[1, 1]+_j*R1[2, 1]+_k*R1[3, 1]``

y1_ := _i*R1[1, 2]+_j*R1[2, 2]+_k*R1[3, 2]

z1_ := _i*R1[1, 3]+_j*R1[2, 3]+_k*R1[3, 3]NULL

NULL

x2_ := _i*R2[1, 1]+_j*R2[2, 1]+_k*R2[3, 1]NULL

y2_ := _i*R2[1, 2]+_j*R2[2, 2]+_k*R2[3, 2]

z2_ := _i*R2[1, 3]+_j*R2[2, 3]+_k*R2[3, 3]

Q1: Is there a more elegant way of creating "Physics:-Vectors" from matrices ?

Now, suppose that we want to compute `&x`(`#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("y2"),mo("&rarr;"))`) : since `#mover(mi("y2"),mo("&rarr;"))` = `#mover(mi("j"),mo("&and;"))` we have `&x`(`#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("y2"),mo("&rarr;"))`) = sin(`#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("j"),mo("&and;"))`)*`#mover(mi("z1"),mo("&rarr;"))` and sin(`#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("j"),mo("&and;"))`)*`#mover(mi("z1"),mo("&rarr;"))` = sin((1/2)*Pi-`&theta;__1`)*`#mover(mi("z1"),mo("&rarr;"))` and sin((1/2)*Pi-`&theta;__1`)*`#mover(mi("z1"),mo("&rarr;"))` = cos(theta[1])*`#mover(mi("z1"),mo("&rarr;"))`

The cross product operator  `&x`(x1_, y2_) yields

cos(theta[1])*_k

(2)

(which is a correct answer) instead of cos(theta[1])*`#mover(mi("z1"),mo("&rarr;"))` because vector `#mover(mi("z1"),mo("&rarr;"))` has is not known as a unit basis vector.

Similarly, `&x`(z1_, x1_) yields -sin(theta[1])*`#mover(mi("i"),mo("&and;"))`+cos(theta[1])*`#mover(mi("j"),mo("&and;"))` instead of  `#mover(mi("y1"),mo("&rarr;"))` as it would be the case when computing `&x`(_k, _i) ?

Q2: Is there a way to declare new triads of "Physics:-Vectors" with properties similar to the provided triad _i, _j, _k ?

Q3: Is the code defining the canonical basis i, _j, _kavailable for inspection and inspiration to setup orthonormal triads ?

Q4: Is it possible to get a (column) matrix of the vector components ? The function Physics:-Vectors:-Component(y1_, n) can only get 1 component at a time and only in the canonical basis i, _j, _k.

NULL

restart

with(Physics)

with(Physics[Vectors])NULL

After a proper definition of 2 new vector bases `#mover(mi("x1"),mo("&rarr;"))`, `#mover(mi("y1"),mo("&rarr;"))`, `#mover(mi("z1"),mo("&rarr;"))` and `#mover(mi("x2"),mo("&rarr;"))`, `#mover(mi("y2"),mo("&rarr;"))`, `#mover(mi("z2"),mo("&rarr;"))`, the position vector OM_ := l__1*x1_+l__2*x2_NULLNULL

l__1*x1_+l__2*x2_

(3)

NULL

projected on `#mover(mi("x2"),mo("&rarr;"))` would yield directly Typesetting[delayDotProduct](l__1, `#mover(mi("x2"),mo("&rarr;"))`.`#mover(mi("x1"),mo("&rarr;"))`, true)+l__2 instead of expand(OM_.x2_)

l__1*Physics:-Vectors:-`.`(x1_, x2_)+l__2*Physics:-Vectors:-Norm(x2_)^2

(4)

because of the unit vectors.

Download orthonormal-triads.mw

This used to work in Maple 2022.  Something is broken in 2023. 

 

restart;

kernelopts(version);

`Maple 2023.1, X86 64 LINUX, Jul 07 2023, Build ID 1723669`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1561 and is the same as the version installed in this computer, created 2023, October 20, 22:58 hours Pacific Time.`

U := Int(exp(-1/4*t - 1/4*x)*piecewise(x < -2, 1, x < -1, -x - 1, 0), x = -t .. 0);

Int(exp(-(1/4)*t-(1/4)*x)*piecewise(x < -2, 1, x < -1, -x-1, 0), x = -t .. 0)

Uval := simplify(value(U));

Uval := `simplify/piecewise/unfactor`(4*piecewise(t < 1, 0, t < 2, t-5+4*exp(`&ndash;`((1/4)*t)+1/4), 2 <= t, 1+4*exp(`&ndash;`((1/4)*t)+1/4)-4*exp(`&ndash;`((1/4)*t)+1/2)))

eval(Uval, {x=5, t=6});

`simplify/piecewise/unfactor`(4+16*exp(-5/4)-16*exp(-1))

 
 

Download simplify-piecewise-bug.mw

 

When printing a Maple Worksheet  often I go in the PrintPrewiev of the Mac and then select some sides to print.

This is not working anymore since I have updated from Maple 2021 to Maple 2023.

Is this known ?

Any help for his ?

Can anyone assist with this error please?

#Clear memory and load package.
restart;  
with(LinearAlgebra):

#Initialise variables,matrices and vectors.
b:=<<18>,<-2>>:
c:=<<1>,<1>>:
i:=0:
P:=<1.08,1.37,1.56,1.61>;
t:=<5,10,15,20>;
tol:=1e-6:

#Initialise Gauss-Newton matrices.
n:=Dimension(t):
f:=Matrix(n,1):
J:=Matrix(n,2):

#Display initial parameter values.
printf("Gauss-Newton Method\n");
printf("-------------------\n");
printf("Before iterations,A = %f and B = %f\n",b(1),b(2));

#Perform the Gauss-Newton method.
while max(abs(evalf(c)))>tol do
  i:=i+1;
  for r from 1 to n do
     f(r,1):=evalf((In(b(1)+t[r])+b(2))-P[r]);
     J(r,1):=evalf(1/b(1)+t[r]);
     J(r,2):=evalf(1);
end do;
c:=Multiply(MatrixInverse(Multiply(Transpose(J),J)),Multiply(Transpose(J),f));
b:=b-c;
printf("After iterations %d, A = %f and B = %f\n",i,b(1),b(2));
end do:

Vector(4, {(1) = 1.08, (2) = 1.37, (3) = 1.56, (4) = 1.61})

 

Vector[column](%id = 36893488152076174028)

 

Gauss-Newton Method
-------------------
Before iterations,A = 18.000000 and B = -2.000000
After iterations 1, A =

 

Error, (in fprintf) number expected for floating point format

 

NULL

Download Asst_3_Q4b.mw

I can import maple, but I get an error when importing namespace/symbols:

import maple.namespace as mpl

Hi!

I'm having problems with my maple not saving. I get no error message and no windows pop up.
The error occurred after the summer holidays in Maple 2022. I use Windows 11, everything is up to date. Have no Anti-virus programs.

  I have tried the following after I discovered the error:
- To install Maple 2023
- Uninstall and delete all maple folders, then reinstall Maple 2023
- Pressed Ctrl + s
- Press "Save as..."
- Pressed on the floppy disk/save icon
- Restarted computer and updated windows
- Run Maple as administrator

The only thing I can be allowed to do is:
- Ctrl + p
- Print to PDF/printer

Really hope you can help!

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