zenterix

390 Reputation

4 Badges

2 years, 332 days

MaplePrimes Activity


These are questions asked by zenterix

restart

with(LinearAlgebra)

A := `<,>`(`<|>`(-2*`&omega;__0`^2, `&omega;__0`^2), `<|>`(`&omega;__0`^2, -`&omega;__0`^2))

Matrix(%id = 36893488151921005020)

(1)

AA := subs(`&omega;__0` = 3, A)

Matrix(%id = 36893488151921002244)

(2)

evalf([Eigenvectors(AA)])

[Vector[column](%id = 36893488151920990196), Matrix(%id = 36893488151920990316)]

(3)

NULL

Below is an eigenvector equation for AA for the eigenvalue -3.4376...

 

S := AA+3.43769410*IdentityMatrix(2)

Matrix(%id = 36893488151920987180)

(4)

When I solve the system below, I expect to get the vector `<,>`(.6180, 1)

Vector[column](%id = 36893488151920981284)

(5)

, just like the result of the Eigenvectors command used above.

 

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

Vector[column](%id = 36893488151920975988)

(6)

Instead I get the zero vector.

 

In addition, when I compute the reduced row echelon form, I expect to have one of the rows be zero since matrix S has rank 1.

 

Rank(S)

1

(7)

ReducedRowEchelonForm(S)

Matrix(%id = 36893488151959135044)

(8)

NULL

Therefore, I guess my question is maybe about calculations and not about Maple. That being said, I did the calculations manually, then I asked chatgpt, which agreed with me.

 

Why are the calculations not coinciding with Maple?

 

I can do the calculations "manually" with Maple:

 

solve(-14.5623059000000*x+9*y = 0)

{x = x, y = 1.618033989*x}

(9)

solve(9*x-5.56230590000000*y = 0)

{x = x, y = 1.618033988*x}

(10)

 

Now, if I try to solve them simultaneously, it seems I have the same issue as with LinearSolve

NULL

solve({9*x-5.56230590000000*y = 0, -14.5623059000000*x+9*y = 0})

{x = 0., y = 0.}

(11)

I tried something else that worked, but the questions above still remain.

 

We start with A again

 

A = Matrix(%id = 36893488151921005020)NULL

In my problem I have the variable

 

`&omega;__a` := (1/2)*`&omega;__0`*(sqrt(5)-1) = (1/2)*omega__0*(5^(1/2)-1)NULL

NULL

and it turns out that -`#msub(mi("omega",fontstyle = "normal"),mi("a"))`^2 is an eigenvalue of A.

In particular, for `&omega;__0` = 3 we get the values I showed previously.

 

For example, here is the eigenvalue we were looking at beforeevalf(subs(`&omega;__0` = 3, -`&omega;__a`^2))

-3.437694099

(12)

Okay so the eigenvector equation without subbing in a value for `&omega;__0` is (A+I*`&omega;__a`^2)*v = 0.

 

Here is what the matrix on the left looks like

NULL

A+`&omega;__a`^2*IdentityMatrix(2)

Matrix(%id = 36893488151964015780)

(13)

 

And here we solve for the eigenvectors

sol := LinearSolve(A+`&omega;__a`^2*IdentityMatrix(2), `<,>`(0, 0))

Vector[column](%id = 36893488151964001572)

(14)

evalf(subs(_t2[1] = 1, sol))

Vector[column](%id = 36893488151964010244)

(15)

Which is the expected result.

 

So, Maple can solve the eigenvector equation in this more general case but not if I specify `&omega;__0` before asking it to solve.NULL

Download evcalc.mw

The document below is long because I go through the context of my question step-by-step. 

The context is solving a first-order system of differential equations where we have complex eigenvalues.

But essentially, my question has to do with the end of this reasoning. I find four solutions x1, x2, x3, and x4, and I would like to check whether they are indeed solutions by subbing them into the original system x'=Ax.

When we make such a substitution, we get an equation of the form yl=yr, where yl and yr are 4x1 vectors. If the equality is true then we can say we have a solution.

My question is about how to check for this equality. I amusing Maple's "Equals" but this doesn't seem to work for all four solutions.

with(LinearAlgebra)

NULL

I explain the entire reasoning that leads to the final vectors that I compare

NULL

The following matrix has complex eigenvalues 3+`&+-`(4*I), each with multiplicity 2.

 

A := `<,>`(`<|>`(3, -4, 1, 0), `<|>`(4, 3, 0, 1), `<|>`(0, 0, 3, -4), `<|>`(0, 0, 4, 3))

Matrix(%id = 36893488151974184588)

(1)

NULL

Consider the eigenvalue `&lambda;__1` = 3-4*I. The associated eigenvectors are

evec := LinearSolve(A-(3-4*I)*IdentityMatrix(4), `<,>`(0, 0, 0, 0), free = c)

Vector[column](%id = 36893488151974164828)

(2)

We see this gives us only one linearly independent eigenvector.

 

We can find another one by forming a rank 2 generalized eigenvector from one of the eigenvectors above.

 

The pair of such eigenvectors is a chain of generalized eigenvectors of length 2 and they satisfy

 

(A-I*`&lambda;__1`)*w__2 = w__1*(A-I*`&lambda;__1`)*w__1 and w__1*(A-I*`&lambda;__1`)*w__1 = 0

NULL

These equations come from trying the solution w__1*e^(`&lambda;__1`*t) and (t*w__1+w__2)*exp(`&lambda;__1`*t), where w__1 is an eigenvector for `&lambda;__1`.

The equations above lead to

 

(A-I*`&lambda;__1`)^2*w__2 = 0

 

which we can solve for the generalized eigenvector w__2 as follows

NULL

`w__2,gen` := LinearSolve((A-(3-4*I)*IdentityMatrix(4))^2, `<,>`(0, 0, 0, 0), free = c)

Vector[column](%id = 36893488151974138212)

(3)

One such generalized eigenvector is

 

w__2 := subs({c[2] = I, c[4] = I}, `w__2,gen`)

Vector[column](%id = 36893488151982985812)

(4)

which gives us

 

w__1 := (A-(3-4*I)*IdentityMatrix(4)).w__2

Vector[column](%id = 36893488151982979180)

(5)

which is indeed an eigenvector for `&lambda;__1`.

Thus, we have the two complex solutions

 

s__1 := w__1*exp((3-4*I)*t)

Vector[column](%id = 36893488151982971708)

(6)

s__2 := (t*w__1+w__2)*exp((3-4*I)*t)

Vector[column](%id = 36893488151982963516)

(7)

But we want real solutions.

NULL

x__1 := `assuming`([Re(s__1)], [t > 0])

Vector[column](%id = 36893488151974145788)

(8)

x__2 := `assuming`([Im(s__1)], [t > 0])

Vector[column](%id = 36893488151982991948)

(9)

x__3 := `assuming`([Re(s__2)], [t > 0])

Vector[column](%id = 36893488151982977980)

(10)

x__4 := `assuming`([Im(s__2)], [t > 0])

Vector[column](%id = 36893488151982967252)

(11)

Let's check that each of the vectors above (the real and imaginary parts of our complex solutions) are real solutions.

 

I would like to substitute, say, x__1 into the first order system of differential equations diff(x, x) = Ax.

 

At first I tried simply

NULL

subs({x = x__1}, diff(x, t) = A.x)

0 = Matrix(%id = 36893488151974184588).Vector[column](%id = 36893488151982948468)

(12)

This doesn't work because the diff(x, t) command evaluates to zero before we do the desired substitution.

 

Then I tried

 

subs({x = x__1}, 'diff(x, t)' = A.x)

diff(Vector[column](%id = 36893488151982948468), t) = Matrix(%id = 36893488151974184588).Vector[column](%id = 36893488151982948468)

(13)

 

   

result := eval(subs({x = x__1}, 'diff(x, t)' = A.x))

Vector[column](%id = 36893488151991655348) = Vector[column](%id = 36893488151982967612)

(14)

NULL

NULL

By inspection, it seems the two sides are equal and so x__1 indeed satisfies the system.

 

But how do I get maple to tell me this?

 

evalb(result)

false

(15)

Equal(rhs(result), lhs(result))

true

(16)

Okay, but does this use of Equals always work?

 

sols := [x__1, x__2, x__3, x__4]; for i to 4 do result := eval(subs({x = sols[i]}, 'diff(x, t)' = A.x)); print(simplify(result))*print(Equal(rhs(result), lhs(result))) end do

true

(17)

 

Apparently not.``

 

What is going on here?

It sure looks like the righthand and lefthand sides of each expression are the same.

Download evs_equal.mw

I am creating a Maple Document, and I would like to separate the document into sections.

One way that looks like what I could use is what I see in parts of the documentation, as below

So here the document looks like an outline.

How is this actually done?

Are there other ways of doing something like this?

Why does the code below work when I use a standalone "assume" statement but not "assuming"?

That is, why don't the first two attempts at calculating the limit use the assumption contained in those statements, ie why don't those statements return infinity and not a signum like the last attempt at the limit?

`&omega;__b` := proc (alpha) options operator, arrow; `&omega;__0`*sqrt(1+alpha+sqrt(alpha+alpha^2)) end proc

proc (alpha) options operator, arrow; omega__0*sqrt(1+alpha+sqrt(alpha+alpha^2)) end proc

(1)

`assuming`([limit(`&omega;__b`(alpha), alpha = infinity)], [`&omega;__0`::positive]) = signum(omega__0)*infinityNULL

`assuming`([limit(`&omega;__b`(alpha), alpha = infinity)], [`&omega;__0` > 0]) = signum(omega__0)*infinityNULL

NULL

assume(`&omega;__0` > 0)

limit(`&omega;__b`(alpha), alpha = infinity) = infinityNULL

NULL

Download assuming.mw

I'd like to simplify the simple expression below by dividing numerator and denominator by m_1 to obtain an expression only containing alpha.

Maple doesn't not generate the desired result.

Is there a way to do this?

expr := sqrt(-(-m__1-m__2+sqrt(m__2*(m__1+m__2)))*`&omega;__0`^2/m__1)

(-(-m__1-m__2+(m__2*(m__1+m__2))^(1/2))*omega__0^2/m__1)^(1/2)

(1)

simplify(expr, {m__2/m__1 = alpha})

(omega__0^2*(alpha*m__1+m__1-(m__1^2*alpha*(alpha+1))^(1/2))/m__1)^(1/2)

(2)

NULL


Download simplify_side.mw

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