Maple 2022 Questions and Posts

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

It seems like my maple document has been corrupted. When I tri to open the document I'm met with an error message "There were problems during the loading process. Your worksheet may be incomplete."

I have spent a great amount of time in this document, so if there was a way to recover it, that would be fantastic.

Thanks!

Download prac_exam_ece4179.mw

I am trying to separate a value by using solve common but could get the answer. Is there any way to get required expression

Simplification_Help.mw

Is there a way to directly code a complex conjugate such as z with overbar without using the verbose conjugate(z)?

I have solved a simple expression with different built-in methods.... I received differents answers ...What is the exact way to get the same answers by all methods

help_roots.mw.

I was wondering whether it is possible to execute Python code into Maple. As an example, I give a fairly simple code:

Concentration_calculation(C_0, Q, V_r, m_b, rho, R, Gamma_i, delta_t=1):
t = np.arange(0, 360*60, delta_t)
C_i = [C_0]
for i in range(len(t)-1):
dC = -(Q/V_r)*(1-math.exp(-3*m_b*math.sqrt(Gamma_i/(rho*t[i+1]))/(math.sqrt(math.pi)*Q*R)))*C_i[i]
C_i.append(C_i[i] + dC*delta_t)
return t, C_i

Any help in tis respect would be highly appreciated.

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. 

4 5 6 7 8 9 10 Last Page 6 of 37