Maple 2022 Questions and Posts

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

This a more a math question than  a maple programming question. But interesting.

I have a point P=[x,y] on a line y= 2+3x. The point maps to Pn=[f(x, y), g(x, y)]. That represents a conic.

I want to find the equation of the conic. I did it by calculating 5 points and that works fine but only because I know I'm looking for a conic. 

Can the problem by solved without having to get the five points?
I copied and pasted the equations for the lines because they were generated by commands in a pagkage I have.

restart

NULL

NULL

P := [X, Y]

[X, Y]

``

NULL

Pn := [(5*X+12*Y)*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y), (2*(12*X-5*Y))*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y)]

[(5*X+12*Y)*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y), 2*(12*X-5*Y)*(-384+48*X+55*Y)/(225*X^2+225*Y^2-1800*X-602*Y)]

NULL

``

Y := 2+3*Xn

2+3*X

``

for i to 5 do P || i := eval(Pn, X = i) end do

[181139/51416, -19775/25708]

NULL

l12 := 153621*x*(1/68840)+169429*y*(1/27536)-15067/17210

(153621/68840)*x+(169429/27536)*y-15067/17210

NULL

l34 := -5733*x*(1/473062)+258973*y*(1/946124)+244205/946124

-(5733/473062)*x+(258973/946124)*y+244205/946124

c1 := l12*l34

((153621/68840)*x+(169429/27536)*y-15067/17210)*(-(5733/473062)*x+(258973/946124)*y+244205/946124)

NULL

l13 := 5499*x*(1/2360)+6539*y*(1/944)-793/472

(5499/2360)*x+(6539/944)*y-793/472

l24 := 596115*x*(1/6899489)+7228091*y*(1/6899489)+195364/363131

(596115/6899489)*x+(7228091/6899489)*y+195364/363131

plots:-implicitplot([l12, l34, l13, l24])

c2 := l13*l24

((5499/2360)*x+(6539/944)*y-793/472)*((596115/6899489)*x+(7228091/6899489)*y+195364/363131)

c := simplify(c2*lambda+c1)

(655607277/3256558808)*(x+(2515/846)*y-305/423)*(x+(556007/45855)*y+285532/45855)*lambda-(880709193/32565588080)*(x-(19921/882)*y-18785/882)*(x+(65165/23634)*y-4636/11817)

lambda := solve(eval(c, [x = P5[1], y = P5[2]]), lambda)

-1/4

simplify(c)

-(5039454771/65131176160)*x^2+(1/130262352320)*(-29130506847*y+40315638168)*x-(423368829/3256558808)*y^2+(111619143207/130262352320)*y

plt1 := plot(Y, X = -10 .. 10)

NULL

NULL

plt2 := plots:-implicitplot([c])

plots:-display(plt1, plt2, colour = ["Red", "Green"])

NULL

for i in [-7, 13/3, 42*(1/7)] do x := eval(Pn[1], X = i); y := eval(Pn[2], X = i); simplify(c) end do

0

NULL

Download Q_23-03-04_how_to_find_conic_from_mapping.mw

Maple continuously shows 'Evaluating' and there is no output. How to fix it?

restart

with(LinearAlgebra)

assume(x::real); assume(t::real); assume(`α__1`::real); assume(`α__2`::real); assume(nu::real)

A2s := Matrix([[H__11*exp(I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__13*exp(I*v__21)/(`λ__1`-conjugate(`λ__2`))+1, H__12*exp(-I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__14*exp(-I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__11*exp(I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__13*exp(I*v__22)/(`λ__2`-conjugate(`λ__2`)), H__12*exp(-I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__14*exp(-I*v__22)/(`λ__2`-conjugate(`λ__2`))], [H__12*exp(I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__14*exp(I*v__21)/(`λ__1`-conjugate(`λ__2`)), 1+H__11*exp(-I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__13*exp(-I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__12*exp(I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__14*exp(I*v__22)/(`λ__2`-conjugate(`λ__2`)), H__11*exp(-I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__13*exp(-I*v__22)/(`λ__2`-conjugate(`λ__2`))], [H__13*exp(I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__33*exp(I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__14*exp(-I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__34*exp(-I*v__21)/(`λ__1`-conjugate(`λ__2`)), 1+H__13*exp(I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__33*exp(I*v__22)/(`λ__2`-conjugate(`λ__2`)), H__14*exp(-I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__34*exp(-I*v__22)/(`λ__2`-conjugate(`λ__2`))], [H__14*exp(I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__34*exp(I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__13*exp(-I*v__11)/(`λ__1`-conjugate(`λ__1`))+H__33*exp(-I*v__21)/(`λ__1`-conjugate(`λ__2`)), H__14*exp(I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__34*exp(I*v__22)/(`λ__2`-conjugate(`λ__2`)), H__13*exp(-I*v__12)/(`λ__2`-conjugate(`λ__1`))+H__33*exp(-I*v__22)/(`λ__2`-conjugate(`λ__2`))+1]])

Matrix(%id = 36893490803012390908)

(1)

vvalue := {v__11 = (conjugate(`λ__1`)-`#msub(mi("λ",fontstyle = "normal"),mn("1"))`)*x+(4*`α__1`*(conjugate(`λ__1`)^3-`λ__1`^3)+2*`α__2`*(conjugate(`λ__1`)^2-`λ__1`^2)-8*nu*(conjugate(`λ__1`)^4-`λ__1`^4))*t, v__12 = (conjugate(`λ__1`)-`#msub(mi("λ",fontstyle = "normal"),mn("2"))`)*x+(4*`α__1`*(conjugate(`λ__1`)^3-`λ__2`^3)+2*`α__2`*(conjugate(`λ__1`)^2-`λ__2`^2)-8*nu*(conjugate(`λ__1`)^4-`λ__2`^4))*t, v__21 = (conjugate(`λ__2`)-`#msub(mi("λ",fontstyle = "normal"),mn("1"))`)*x+(4*`α__1`*(conjugate(`λ__2`)^3-`λ__1`^3)+2*`α__2`*(conjugate(`λ__2`)^2-`λ__1`^2)-8*nu*(conjugate(`λ__2`)^4-`λ__1`^4))*t, v__22 = (conjugate(`λ__2`)-`#msub(mi("λ",fontstyle = "normal"),mn("2"))`)*x+(4*`α__1`*(conjugate(`λ__2`)^3-`λ__2`^3)+2*`α__2`*(conjugate(`λ__2`)^2-`λ__2`^2)-8*nu*(conjugate(`λ__2`)^4-`λ__2`^4))*t}

{v__11 = (conjugate(lambda__1)-`#msub(mi("λ",fontstyle = "normal"),mn("1"))`)*x+(4*alpha__1*(conjugate(lambda__1)^3-lambda__1^3)+2*alpha__2*(conjugate(lambda__1)^2-lambda__1^2)-8*nu*(conjugate(lambda__1)^4-lambda__1^4))*t, v__12 = (conjugate(lambda__1)-`#msub(mi("λ",fontstyle = "normal"),mn("2"))`)*x+(4*alpha__1*(conjugate(lambda__1)^3-lambda__2^3)+2*alpha__2*(conjugate(lambda__1)^2-lambda__2^2)-8*nu*(conjugate(lambda__1)^4-lambda__2^4))*t, v__21 = (conjugate(lambda__2)-`#msub(mi("λ",fontstyle = "normal"),mn("1"))`)*x+(4*alpha__1*(conjugate(lambda__2)^3-lambda__1^3)+2*alpha__2*(conjugate(lambda__2)^2-lambda__1^2)-8*nu*(conjugate(lambda__2)^4-lambda__1^4))*t, v__22 = (conjugate(lambda__2)-`#msub(mi("λ",fontstyle = "normal"),mn("2"))`)*x+(4*alpha__1*(conjugate(lambda__2)^3-lambda__2^3)+2*alpha__2*(conjugate(lambda__2)^2-lambda__2^2)-8*nu*(conjugate(lambda__2)^4-lambda__2^4))*t}

(2)

NULL

A2s2 := Determinant(A2s); dets22 := simplify(A2s2, size); length(%)

8949

(3)

dets22f := simplify(subs(vvalue, dets22))

NULL

Download sol1det.mw

I get about 3-4 of these each day when I run my long script. Maple 2022.2 on windows 10

They happen much more for me in Maple 2022 than before. I am on windows 10 pro with 128 GB ram, new PC, very fast PC.

googling, I see others having same problem. 

https://www.reddit.com/r/maplesoft/comments/uixics/frequent_kernel_connection_has_been_lost_on_maple/

"Ever since I upgraded to Maple 2022, relatively intensive symbolic calculations and plots frequently kill the kernel and throw the error message “Kernel Connection has been lost”. This never happened on Maple 2021."

It happens for me whenever I run something that takes long time and it is always random when and where it happens.

This is really disappointing as one expects software quality of a product to improve over time but for me, I find Maple's becoming less robust and its quality becoming worst not better.  This is too bad, because Maple is a good language and I like programming in it, but it is the software build quality of the overall software which needs to be improved. 

I see many hangs also where I have to kill mserver.exe may be 10 times a day just to get the script to complete. (this is besides this kernel lost connection problem). Those also happen at random places in the script. Restarting the script from same place, it runs OK now.

Is there something one can do to find why this lost connection happens?  Crash dump somewhere? Log file somewhere?

I do not have firewall. I use default windows 10 settings for security. Do not have any other special anti-virus software.  No other app I use on this PC crash like this. It is only Maple.

 

Hi,

I am trying to automatically combine plots that I created with an index: ex. IP[i] := plot(...

I can combine them manually, but the maximum value of i can be almost any number greater than 1, and I don’t want to edit things all the time. i can also be very big. I have tried several random ways of embedding the index, but I’ve had no success.

Any ideas? Thanks.

Jno.

This is my current code:

with~([NumberTheory, DocumentTools]):
tb := Tabulate([seq]([galois](CyclotomicPolynomial(i, x),x), i = 1 .. 10)):

I hope to export it into SVG file, but this code will report a error information:

Export("aatest.svg", tb)
printf("%", [[]]);

Yeah, it is incompatible with the Maple syntax. But I don't know why this command actually causes a serious logic error here. Actually, this seems fairly trifling in my view. Can you produce it again? 

restart

printf("%", [[]]);

NULL

Download printfIssue.mws

after updating to latest Physics package, I find now latex geneated is invalid as it gives compile error.

I looked at old files I have and I see the latex generated before was correct. so something changed in the latex() command to cause this and now none of my files compile when I run my Maple program.

Before, same code used to generate this

 \left(-x^{2}+1\right) \left(y^{\prime}\right)^{2} = 1-y^{2} 

which compiled correctly.

Here is worksheet
 

interface(version)

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1378 and is the same as the version installed in this computer, created 2023, January 29, 12:4 hours Pacific Time.`

latex:-Settings(useimaginaryunit=i,
      usecolor = false,
      powersoftrigonometricfunctions= mixed, ## computernotation,
      leavespaceafterfunctionname = true,
      cacheresults = false,
      spaceaftersqrt = true,
      linelength=10000  
);
Typesetting:-Unsuppress('all'); #always do this.
Typesetting:-Settings(prime=x,'typesetprime'=true); #this says to use y'(x) instead of dy/dx    
Typesetting:-Suppress(y(x)); # this says to use y' and not y'(x)

[useimaginaryunit = i, usecolor = false, powersoftrigonometricfunctions = mixed, leavespaceafterfunctionname = true, cacheresults = false, spaceaftersqrt = true, linelength = 10000]

x, false

ode:=(-x^2+1)*diff(y(x),x)^2 = 1-y(x)^2;

(-x^2+1)*(diff(y(x), x))^2 = 1-y(x)^2

latex(ode)

\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}

 

 

The error from the latex compiler is 

 

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

\begin{dmath*}
\left(-x^{2}+1\right) y^{\prime}^{2} = 1-y^{2}
\end{dmath*}

\end{document}

compiled using texlive lualatex command gives

(/usr/local/texlive/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! Double superscript.
<recently read> \mathsup 
         
l.12 \left(-x^{2}+1\right) y^{\prime}^{2}
                                        = 1-y^{2}
? 

The fix is to keep same latex as before or use an extra {} like this  {y^{\prime}}^{2} 

but I think \left(y^{\prime}\right)^{2} looks better. But y^{\prime}^{2} is definitly wrong latex.

Download latex_problem.mw

Hello guys
I'm having trouble solving a PDE using pdsolve-numerical. Here's a notebook attached.

I'm grateful if anyone can help.

Regards,

Oliveira

                   PDE1.mw

x := 19.073*Unit('m'^4*'kg'^2/('s'^6*'A'^2)); simplify(x); Units:-Simple:-simplify(x); Units:-Standard:-simplify(x); Units:-Natural:-simplify(x); convert(x, units, V^2); # None of the simplify commands do anything. Is there a way to get the last result?

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

restart;
ode := diff(y(x),x)/y(x)-(3*(4*x^2+y(x)^2+1))/(2*x*(4*x^2+y(x)^2-2-2*x))=0;
DEtools:-odeadvisor(ode);
sol:=dsolve(ode,y(x));

(diff(y(x), x))/y(x)-(3/2)*(4*x^2+y(x)^2+1)/(x*(4*x^2+y(x)^2-2-2*x)) = 0

[_rational]

Error, (in dsolve) invalid subscript selector

 

Download error_jan_27_2023.mw

I want to create the groups (Z/nZ)+ and (Z/nZ)*.

I can do this in python for n=7. I want to do this with other values of n.

(Z/7Z)+
   0 1 2 3 4 5 6
0 0 1 2 3 4 5 6
1 1 2 3 4 5 6 0
2 2 3 4 5 6 0 1
3 3 4 5 6 0 1 2
4 4 5 6 0 1 2 3
5 5 6 0 1 2 3 4
6 6 0 1 2 3 4 5
 
(Z/7Z)*
   1 2 3 4 5 6
1 1 2 3 4 5 6
2 2 4 6 1 3 5
3 3 6 2 5 1 4
4 4 1 5 2 6 3
5 5 3 1 6 4 2
6 6 5 4 3 2 1
 

I tried creating a Cayley table but can not get that right.

This question was inspired by https://www.mapleprimes.com/questions/235613-Convert-A-List-With-Nested-Ordered-Sets.

I want to replace several characters of a string separately. 

s:="[ (0, 1), (1, 2), (1, 10), (2, 3), (3, 4), (4, 5), (4, 9), (5, 6), (6, 7), (7, 8),(8, 9), (10, 11), (11, 12), (11, 16), (12, 13), (13, 14), (14, 15), (15, 16)]"

Like this their will be many say n element then I need to a list as 

{{0,1},{1,2},{1,10},......}

I took the for-loop as follows, but I'm wondering if there's a more concise way to deal with it.

with(StringTools):
L:="[ (0, 1), (1, 2), (1, 10), (2, 3), (3, 4), (4, 5), (4, 9), (5, 6), (6, 7), (7, 8),(8, 9), (10, 11), (11, 12), (11, 16), (12, 13), (13, 14), (14, 15), (15, 16)]":    
L1:=["(",")","[","]"]:
L2:=["{","}","{","}"]:
X:=L:
for i from 1 to nops(L1) do
X:=SubstituteAll(X,L1[i],L2[i]);
end do:
parse(X)

{{0, 1}, {1, 2}, {1, 10}, {2, 3}, {3, 4}, {4, 5}, {4, 9}, {5, 6}, {6, 7}, {7, 8}, {8, 9}, {10, 11}, {11, 12}, {11, 16}, {12, 13}, {13, 14}, {14, 15}, {15, 16}}

I know that a function acting repeatedly can use f @@ n, for example,

(sin@@2)(x);

But if f  has some  arguments, can it still be used?

I am trying to call an optimization function for a set of operations where the object function contains integrals. i get this error when i try to do the optimization, i actually want to optimize a cost function, this is the error i get: Error, (in Optimization:-NLPSolve) integration range or variable must be specified in the second argument, got 1. = 4 .. 7

here is my work: 

a2 := 18;
b2 := 5;
a1 := 3;
b1 := 2.5;
ci := 0.05;
cr := 1;
cf := 10;
p := 0.1;
L := 0.5;
S := 3;
T := 10;
cud := 50;
co := 0.02;
tr := 0.006;
ti := 0.0014;
tf := 0.014;
K := 2;
A := 2;
M := 7;
f01 := x -> b1*(x/a1)^(b1 - 1)*exp(-(x/a1)^b1)/a1;
f02 := x -> b2*(x/a2)^(b2 - 1)*exp(-(x/a2)^b2)/a2;
fx := x -> p*f01(x) + (1 - p)*f02(x);
fh := h -> L*exp(-L*h);
Fh := h -> 1 - exp(-L*h);

P1_1 := (K, A, M) -> sum(int(fx(x)*(1 - Fh(i*A - x)), x = (i - 1)*A .. i*A), i = 1 .. K);
L1_1 := (K, A, M) -> sum((i*A + tr + i*ti)*P1_1(K, A, M), i = 1 .. K);
C1_1 := (K, A, M) -> sum((ci*i + cr)*P1_1(K, A, M), i = 1 .. K);
NULL;
P2_1 := (K, A, M) -> sum(int(fh(h)*fx(x), [h = 0 .. i*A - x, x = (i - 1)*A .. i*A]), i = 1 .. K);
L2_1 := (K, A, M) -> sum((tf + (i - 1)*ti)*int((x + h)*fh(h)*fx(x), [h = 0 .. i*A - x, x = (i - 1)*A .. i*A]), i = 1 .. K);
C2_1 := (K, A, M) -> sum(((i - 1)*ci + cf)*P2_1(K, A, M), i = 1 .. K);
P3_1 := (K, A, M) -> int(fh(h)*fx(x), [h = 0 .. M - x, x = A*K .. M]);
L3_1 := (K, A, M) -> (K*ti + tf)*int((x + h)*fh(h)*fx(x), [h = 0 .. M - x, x = A*K .. M]);
C3_1 := (K, A, M) -> (K*ci + cf)*P3_1(K, A, M);
P4_1 := (K, A, M) -> int(fx(x)*(1 - Fh(M - x)), x = A*K .. M);
L4_1 := (K, A, M) -> (K*ti + tr + M)*int(fx(x)*(1 - Fh(M - x)), x = A*K .. M);
C4_1 := (K, A, M) -> (K*ci + cr)*int(fx(x)*(1 - Fh(M - x)), x = A*K .. M);
P5_1 := (K, A, M) -> int(fx(x), x = M .. infinity);
L5_1 := (K, A, M) -> (K*ti + tr + M)*int(fx(x), x = M .. infinity);
C5_1 := (K, A, M) -> (K*ci + cr)*int(fx(x), x = M .. infinity);
Ptotal_1 := (K, A, M) -> P1_1(K, A, M) + P2_1(K, A, M) + P3_1(K, A, M) + P4_1(K, A, M) + P5_1(K, A, M);
Ptotal_1(K, A, M);
evalf(Ptotal_1(K, A, M));
Ltotal_1 := (K, A, M) -> L1_1(K, A, M) + L2_1(K, A, M) + L3_1(K, A, M) + L4_1(K, A, M) + L5_1(K, A, M);
evalf(Ltotal_1(K, A, M));
Ctotal_1 := (K, A, M) -> C1_1(K, A, M) + C2_1(K, A, M) + C3_1(K, A, M) + C4_1(K, A, M) + C5_1(K, A, M);
Cost_rate_1 := (K, A, M) -> Ctotal_1(K, A, M)/Ltotal_1(K, A, M);
integralOF := int(Cost_rate_1(K, A, M), x = 1 .. 2);
evalf(integralOF);
                          0.2759938793

MTBOF := Ltotal_1(K, A, M)/(P2_1(K, A, M) + P3_1(K, A, M));
evalf(MTBOF);
                          159.4642167

rd := 1/MTBOF;
ro := 1/M + rd;
const1 := 0 <= K;
const2 := K*A <= M;
const3 := M <= 20;
const4 := 0 <= A;
const5 := 0 <= M;
totalconstr := {const1, const2, const3, const4, const5};

optimized_cost := Optimization:-Minimize(integralOF, totalconstr);
Error, (in Optimization:-NLPSolve) integration range or variable must be specified in the second argument, got 1. = 4 .. 7
NULL;
 

please, i need assitance urgently.. thanks

What is happening at f(0)?

Look at PlotProblem.mw

Writing an explanatory paragrah i want to use an approximately equal symbol. How can I do this? The palette has lots of symbols but not what in latex would be done with \approx

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