Maple 2022 Questions and Posts

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

I was trying to assign a Vector to a Vector inside a procedure. However, when the Vector has a size of 5, I was able to do that. But not when the Vector has a size of 7.

I have the following example. I can't assign the Vector over when the Vector has a size of 7 as shown in oneStep_egcd2.  But I can do that when the size is 5 in oneStep_egcd. Copying the contents over using a for loop works as expected. 

 

a:= 17; b:= 5;

17

 

5

(1)

 

# <s, a, t, b, g>
prev := <1, a, 0, b, a>;

Vector(5, {(1) = 1, (2) = 17, (3) = 0, (4) = 5, (5) = 17})

(2)

curr := <0, a, 1, b, b>;

Vector(5, {(1) = 0, (2) = 17, (3) = 1, (4) = 5, (5) = 5})

(3)

oneStep_egcd := proc(prev::Vector, curr::Vector)
    local q, t1, t2, t3;
    if (curr[5] <> 0) then
        q := iquo(prev[5], curr[5]);
        t1, t2, t3 := prev[1] - curr[1] * q, prev[3] - curr[3] * q, prev[5] - curr[5] * q;
        prev = curr;
        curr[1], curr[3], curr[5] := t1, t2, t3;
    end if:
end proc:

oneStep_egcd(prev, curr)

1, -3, 2

(4)

NULL

NULL

# <s, expr_s, a, t, expr_t, b, g>
prev := <1, 1, a, 0, 0, b, a>;

Vector(7, {(1) = 1, (2) = 1, (3) = 17, (4) = 0, (5) = 0, (6) = 5, (7) = 17})

(5)

curr := <0, 0, a, 1, 1, b, b>;

Vector(7, {(1) = 0, (2) = 0, (3) = 17, (4) = 1, (5) = 1, (6) = 5, (7) = 5})

(6)

oneStep_egcd2 := proc(prev::Vector, curr::Vector)
    local q, sb_q, t1, t2, t4, t5, t7;
    if (curr[7] <> 0) then
        q := iquo(prev[7], curr[7]);
        sb_q := (q);
        t1 := prev[1] - curr[1] * q;
        t2 := prev[2] - curr[2] * q;
        t4 := prev[4] - curr[4] * q;
        t5 := prev[5] - curr[5] * q;
        t7 := prev[7] - curr[7] * q;
        prev := curr;
        curr[1], curr[2], curr[4], curr[5], curr[7] := t1, t2, t4, t5, t7;
    end if:
end proc:

oneStep_egcd2(prev, curr)

Error, (in oneStep_egcd2) invalid left hand side in assignment

 

NULL

oneStep_egcd3 := proc(prev::Vector, curr::Vector)
    local q, sb_q, t1, t2, t4, t5, t7, i;
    if (curr[7] <> 0) then
        q := iquo(prev[7], curr[7]);
        sb_q := (q);
        t1 := prev[1] - curr[1] * q;
        t2 := prev[2] - curr[2] * q;
        t4 := prev[4] - curr[4] * q;
        t5 := prev[5] - curr[5] * q;
        t7 := prev[7] - curr[7] * q;
        for i to 7 do
            prev[i] := curr[i];
        end do;
        curr[1], curr[2], curr[4], curr[5], curr[7] := t1, t2, t4, t5, t7;
    end if:
end proc:

oneStep_egcd3(prev, curr)

1, 1, -3, -3, 2

(7)

NULL

Download ErrorExample.mw

I would like to do some point and line calculations, and the geom3d package seems a good one.

But how do I define a generic point such that I can use it in a function to generate genric points and lines?

eg

    P:=(a,b,c)->point(P, a,b,c) 

or equivalent?

I would then want to define generic lines between generic points.

Consider the following. 

We have a matrix A with five parameters in it.

If we tell Maple to solve Ax=0, it gives us the trivial solution.

Then, if I make a matrix B where I choose specific values for those five parameters and I tell Maple to solve Bx=0 I get a non-trivial solution.

Why doesn't Maple give me a more informative result in the Ax=0 case? 

A := Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = a__1, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (2, 5) = b__1, (3, 1) = -216, (3, 2) = -18, (3, 3) = 0, (3, 4) = 0, (3, 5) = c__1, (4, 1) = 0, (4, 2) = 0, (4, 3) = 1, (4, 4) = 0, (4, 5) = d__1, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 1, (5, 5) = e__1}) = Matrix(%id = 36893488151959194068)NULL

with(LinearAlgebra)

GaussianElimination(A)

Matrix(%id = 36893488151959184316)

(1)

LinearSolve(A, `<,>`(0, 0, 0, 0, 0))

Vector[column](%id = 36893488151959183100)

(2)

B := Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = -216, (3, 2) = -18, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 1, (4, 4) = 0, (4, 5) = 1, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 1, (5, 5) = 4}) = Matrix([[1, 0, 0, 0, 0], [0, 1, 0, 0, 0], [-216, -18, 0, 0, 0], [0, 0, 1, 0, 1], [0, 0, 0, 1, 4]])NULL

GaussianElimination(B) = Matrix(%id = 36893488151959174788)NULL

LinearSolve(B, `<,>`(0, 0, 0, 0, 0))

Vector[column](%id = 36893488151959164916)

(3)

``

NULL

An even easier way to show a non-trivial solution is to just make the entire last column zero.

Download polyn_matrix.mw

Consider the following worksheet (perhaps it is better to download the worksheet and execute since the contents below aren't showing the commands used to plot the last two plots).

NULL

T = log(R)/(a+b*log(R))^2

plot(log(R)/(-1.16+.675*log(R))^2, R = 1000 .. 30000)

 

NULL

10^log[10](T) = log(R)/(a+b*log(R))^2

NULL

log[10](T) = log[10](log(R)/(a+b*log(R))^2)

NULL

w = log[10](z/(b*z+a)^2)

w = ln(z/(b*z+a)^2)/ln(10)

(1)

NULL

plot(log[10](z/(-1.16+.675*z)^2), z = log(1000) .. log(30000))

 

NULL

``

NULL

plots:-loglogplot(log(R)/(-1.16+.675*log(R))^2, R = 1000 .. 30000)

 

NULL

 

My question is about making a loglog plot of the equation

for R between 1000 and 30000.

 

The second to last plot is of w as a function of z, as in the last equation below

and the plot command is (where I have subbed in a=-1.16 and b=0.675)

In the second to last plot, of course we have negative values of w. If we were to consider the underlying values of T, they would never be negative of course.

The last plot is the command

I think this last plot is what I want (though I am not sure because I am not totally sure what plots:-loglogplot is doing).

 

My question is how to obtain this loglog plot manually. That is, I want the axes to show values of R on the x axis and T on the y axis (just like a usual loglog plot shows).

In other words, how to go from the second to last plot to the same plot but showing the corresponding R and T values instead of z and w.

Download loglog.mw


Here is a small worksheet to illustrate my question

Consider the expression

 

solve(sqrt(log[10](R)/T) = a+b*log[10](R), T) = ln(R)*ln(10)/(ln(10)^2*a^2+2*ln(10)*ln(R)*a*b+ln(R)^2*b^2)NULL

NULL

Can we somehow tell Maple to keep the logarithms in base 10?

 

NULL


I'd like for the final expression to have only base 10 logarithms.

 

When I do it with pen and paper, I get

 

It is this last expression that I would like Maple to output.

Download log10.mw

Dear power users, I am making the switch from Mathcad towards Maple and would like to know what is the most efficient alternative in Maple for a solve block. I have attached a work document to illustrate better my question.SolveBlockQuestion.mw Any help is highly appreciated.

For some of the users with eye problems like me, the white canvas is burning eyes out of sockets as the monitor needs to be close up. Even turning down the intensity do not work especially since all other applications on Linux can be configured to have a dark-theme, but NOT Maple it seems.

What is the reason for this resistance from Maple Developers to just ram this white canvas down our throats verion after version.

Users have been asking since about Maple 11 to change  this.

I mean, Maple is not exactly cheap, which would have been an excuse, and is formidable intellectual software, so "ability" should not be a problem

However am I to believe that just changing the canvas color, turns out to be  a serious intellectual challenge for developers ?

Google yields such custom canvas request spanning more than a decade, but users arrive at crickets and a dead end.

Please be kind and give us a customizable canvas or any DARK theme of your choice for users with visual challenges and the lots of normal users who also want a custom canvas color or dark theme. It is overdue.

At the moment I use the cumbersome table-solution with a gray background, which helps some, but it is clunky and no alternative for long term use as the window and bars itself are still white and distracts and defeats the objective somewhat.

map seems to work differently on lists and Matricies.  How do I get map to work on the Matrix?

a := [[1.2, 4.3], [3.2, 5.3]]

[[1.2, 4.3], [3.2, 5.3]]

(1)

whattype(a)

list

(2)

a[1]

[1.2, 4.3]

(3)

b := map(proc (x) options operator, arrow; [floor(x[1]), x[2]] end proc, a)

[[1, 4.3], [3, 5.3]]

(4)

c := convert(a, Matrix)

Matrix(%id = 36893488148073393796)

(5)

whattype(c)

Matrix

(6)

c[1]

Vector[row](%id = 36893488148073381388)

(7)

d := map(proc (x) options operator, arrow; [floor(x[1]), x[2]] end proc, c)

Matrix(%id = 36893488148073382844)

(8)

``

Download ListMatrixmap.mw

When I try to solve the determinant the system hangs and Maple doesn't give any result. Here $\lambda_1,2$ is not a function of 'x' and 't'.

restart

with(LinearAlgebra)

with(plots)

with(Physics)

``

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1)

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

alias(v = v(x, t))

v

(2)

``

B1 := Matrix([[exp(I*v__11)/(`&lambda;__1`-conjugate(`&lambda;__1`)), 0, 0, 0, exp(I*v__12)/(`&lambda;__2`-conjugate(`&lambda;__1`)), 0, 0, 0], [0, exp(I*v__11)/(`&lambda;__1`-conjugate(`&lambda;__1`)), 0, 0, 0, exp(I*v__12)/(`&lambda;__2`-conjugate(`&lambda;__1`)), 0, 0], [0, 0, exp(-I*v__11)/(`&lambda;__1`-conjugate(`&lambda;__1`)), 0, 0, 0, exp(-I*v__12)/(`&lambda;__2`-conjugate(`&lambda;__1`)), 0], [0, 0, 0, exp(-I*v__11)/(`&lambda;__1`-conjugate(`&lambda;__1`)), 0, 0, 0, exp(-I*v__12)/(`&lambda;__2`-conjugate(`&lambda;__1`))], [exp(I*v__21)/(`&lambda;__1`-conjugate(`&lambda;__2`)), 0, 0, 0, exp(I*v__22)/(`&lambda;__2`-conjugate(`&lambda;__2`)), 0, 0, 0], [0, exp(I*v__21)/(`&lambda;__1`-conjugate(`&lambda;__2`)), 0, 0, 0, exp(I*v__22)/(`&lambda;__2`-conjugate(`&lambda;__2`)), 0, 0], [0, 0, exp(-I*v__21)/(`&lambda;__1`-conjugate(`&lambda;__2`)), 0, 0, 0, exp(-I*v__22)/(`&lambda;__2`-conjugate(`&lambda;__2`)), 0], [0, 0, 0, exp(-I*v__21)/(`&lambda;__1`-conjugate(`&lambda;__2`)), 0, 0, 0, exp(-I*v__22)/(`&lambda;__2`-conjugate(`&lambda;__2`))]]); H := Matrix([[H__11, H__12, H__13, H__14, H__15, H__16, H__17, H__18], [H__12, H__11, H__14, H__13, H__16, H__15, H__18, H__17], [H__13, H__14, H__33, H__34, H__17, H__18, H__55, H__38], [H__14, H__13, H__34, H__33, H__18, H__17, H__38, H__55], [H__15, H__16, H__17, H__18, H__11, H__12, H__13, H__14], [H__16, H__15, H__18, H__17, H__12, H__11, H__14, H__13], [H__17, H__18, H__55, H__38, H__13, H__14, H__33, H__34], [H__18, H__17, H__38, H__55, H__14, H__13, H__34, H__33]]); B := H.B1; idn8 := Matrix([[1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1]])

Omeg := B+idn8

``

vvalue := {v__11 = (conjugate(`&lambda;__1`)-`&lambda;__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`)-`&lambda;__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`)-`&lambda;__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`)-`&lambda;__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}

B2 := Determinant(B)

Omegdet := Determinant(Omeg)

NULL

NULL

Download determinant.mw

In a dataframe you can easily replace 'undefined' by another value using FillMissing. However, if you want to remove the row in which a cell contained 'undefined' this seems not to be possible. 'DropMissing' will remove the complete column in which one of the cells contains 'undefined'. Is there another command that removes the row of the dataframe as a column contains an 'undefined'? Sorry for the simplistic question but I am still in my learning curve. 

Hello. I am trying to solve the following polynomial system. Maple solution is empty but when I add the polynomial X4_4-2^(1/2)/10 to the list then maple gives me a set of solutions. What could I be doing wrong?

with(SolveTools):
F:=[
10*X4_4 + Y1_1,
10*X4_4*Y1_1 + 2,
20*X4_4*Y3_1,
2*Y3_1,
10*X4_4*Y1_2,
20*X4_4*Y3_2 + 2,
10*X4_4 + 2*Y3_2,
4*L2 - 7*L1 + 5*L3 - 6*L4 + 5*L5 + 9*L6 - 6*L7 - 1,
L1 + 10*L2*X4_4,
10*L5*X4_4,
2*L4 + 20*L3*X4_4,
2*L7 + 20*L6*X4_4
]:
V:=[X4_4, Y1_1, Y1_2, Y3_1, Y3_2, L1, L2, L3, L4, L5, L6, L7]:

Sols := PolynomialSystem(F, V);

Auto_regne_dokument.mw

My maple froze while it was running. I saved and closed it and now it gives me this message when i try to open it "There was a problem in the loading process, you worksheet may be incomplete.". 

There is only one backup file and it is corrupted as well. I tried to see if i could work it out in the text file, but im not very good at doing this.

If anyone knows how to uncorrupt it pls help me 

I have problem to calculate the max value for 3d  phase potret for each period. Thank You

 deplot3d-animated_SIA.mw

I wanted to solve a pde of two variables in spherical coordinates with a boundary condition at a specific radius. I am doing something wrong because the pdsolve just evaluates for several minutes and does not actually give anything.

Could someone have a look and let me know what I am doing wrong.

restart

``

with(Physics[Vectors])

Setup(mathematicalnotation = true)

[mathematicalnotation = true]

(1)

eq3 := Laplacian(Phi_out(r, theta)) = 0

((r^2*(diff(diff(Phi_out(r, theta), r), r))+2*r*(diff(Phi_out(r, theta), r))+diff(diff(Phi_out(r, theta), theta), theta))*sin(theta)+(diff(Phi_out(r, theta), theta))*cos(theta))/(r^2*sin(theta)) = 0

(2)

bc1 := eval(Phi_out(r, theta)-Omega*mu*(-1+cos(2*theta))/(2*r), r = R) = 0

Phi_out(R, theta)-(1/2)*Omega*mu*(-1+cos(2*theta))/R = 0

(3)

``

pdsolve([eq3, bc1])

NULL

Download laplacian.mw

how to make a phaseportrait curves with animation? so i can see how the curve going on. Thank you

caring_phase_pemanenan_predator_dgn_parametersesuai_jurnal.mw

First 7 8 9 10 11 12 13 Last Page 9 of 40