itsme

734 Reputation

14 Badges

15 years, 35 days

MaplePrimes Activity


These are questions asked by itsme

how can i get an 'implicit=false' form (no RootOf) of my eigenvalues from the Eigenvectors() command? Should one expect the behavior be the same in Eigenvectors() and Eigenvalues()?

thanks

 

restart:

 

 

M:=Matrix(3, 3, [[-2*lambda-kappa__c, -2*sqrt(2)*g, 0], [(1/2)*g*N*sqrt(2), -lambda-(1/2)*kappa__c-gamma__phi, -sqrt(2)*g], [0, g*N*sqrt(2), -2*gamma__phi]])

Matrix(3, 3, {(1, 1) = -2*lambda-`#msub(mi("κ",fontstyle = "normal"),mi("c"))`, (1, 2) = -2*sqrt(2)*g, (1, 3) = 0, (2, 1) = (1/2)*g*N*sqrt(2), (2, 2) = -lambda-(1/2)*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`-`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`, (2, 3) = -sqrt(2)*g, (3, 1) = 0, (3, 2) = g*N*sqrt(2), (3, 3) = -2*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`})

(1)

LinearAlgebra:-Eigenvalues(M); #this is what i want but from Eigenvectors()

Vector(3, {(1) = -lambda-(1/2)*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`-`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`, (2) = -lambda-(1/2)*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`-`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`+(1/2)*sqrt(-16*N*g^2+4*lambda^2+4*lambda*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`-8*lambda*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`+`#msub(mi("κ",fontstyle = "normal"),mi("c"))`^2-4*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`+4*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`^2), (3) = -lambda-(1/2)*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`-`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`-(1/2)*sqrt(-16*N*g^2+4*lambda^2+4*lambda*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`-8*lambda*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`+`#msub(mi("κ",fontstyle = "normal"),mi("c"))`^2-4*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`+4*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`^2)})

(2)

LinearAlgebra:-Eigenvalues(M, implicit=true); #RootOf notation; not what i want, but option works here

Vector(3, {(1) = -lambda-(1/2)*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`-`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`, (2) = RootOf(_Z^2+(2*lambda+`#msub(mi("κ",fontstyle = "normal"),mi("c"))`+2*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`)*_Z+4*N*g^2+4*lambda*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`+2*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`, index = 1), (3) = RootOf(_Z^2+(2*lambda+`#msub(mi("κ",fontstyle = "normal"),mi("c"))`+2*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`)*_Z+4*N*g^2+4*lambda*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`+2*`#msub(mi("γ",fontstyle = "normal"),mi("φ",fontstyle = "normal"))`*`#msub(mi("κ",fontstyle = "normal"),mi("c"))`, index = 2)})

(3)

evals, evecs:=LinearAlgebra:-Eigenvectors(M); #RootOf everywhere;

evals, evecs := Vector(3, {(1) = RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 1), (2) = RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 2), (3) = -lambda-(1/2)*`κ__c`-`γ__φ`}), Matrix(3, 3, {(1, 1) = 8*g^2/(RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 1)+2*lambda+`κ__c`)^2, (1, 2) = 8*g^2/(RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 2)+2*lambda+`κ__c`)^2, (1, 3) = 2/N, (2, 1) = -2*sqrt(2)*g/(RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 1)+2*lambda+`κ__c`), (2, 2) = -2*sqrt(2)*g/(RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 2)+2*lambda+`κ__c`), (2, 3) = -(1/4)*sqrt(2)*(2*lambda+`κ__c`-2*`γ__φ`)/(g*N), (3, 1) = 1, (3, 2) = 1, (3, 3) = 1})

(4)

 

 

evals, evecs:=LinearAlgebra:-Eigenvectors(M, implicit=false); #still RootOf everywhere;

evals, evecs := Vector(3, {(1) = RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 1), (2) = RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 2), (3) = -lambda-(1/2)*`κ__c`-`γ__φ`}), Matrix(3, 3, {(1, 1) = 8*g^2/(RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 1)+2*lambda+`κ__c`)^2, (1, 2) = 8*g^2/(RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 2)+2*lambda+`κ__c`)^2, (1, 3) = 2/N, (2, 1) = -2*sqrt(2)*g/(RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 1)+2*lambda+`κ__c`), (2, 2) = -2*sqrt(2)*g/(RootOf(_Z^2+(2*lambda+`κ__c`+2*`γ__φ`)*_Z+4*g^2*N+4*`γ__φ`*lambda+2*`γ__φ`*`κ__c`, index = 2)+2*lambda+`κ__c`), (2, 3) = -(1/4)*sqrt(2)*(2*lambda+`κ__c`-2*`γ__φ`)/(g*N), (3, 1) = 1, (3, 2) = 1, (3, 3) = 1})

(5)

 

 


 

Download evals.mw

 

 

 

 

Not sure if i'm missing something, but this does not seem to work how i would expect.

Trying to understand why the [1,1] element is simplifed to -3, as well as the [3,3] element to -2. 

Any ideas?

thanks!
 

restart:

MM:=Matrix(convert("{{1/2 (-2 \[Kappa] - 4 \[Lambda]), -2 Sqrt[2] g, 0}, {g/Sqrt[
  2], -\[CapitalGamma] - \[Kappa]/2 - \[Lambda], -Sqrt[2] g}, {0,
  Sqrt[2] g, -2 \[CapitalGamma]}}", FromMma));

"[[[-1/2 2(Kappa)-1/2 4(Lambda),-2 sqrt(2) g,0],[(g)/(sqrt(2)),-CapitalGamma-1/2 Kappa-Lambda,-sqrt(2) g],[0,sqrt(2) g,-2(CapitalGamma)]]]"

(1)

simplify(MM); #why is the first element simplified this way?

Matrix(3, 3, {(1, 1) = -3, (1, 2) = -2*sqrt(2)*g, (1, 3) = 0, (2, 1) = (1/2)*sqrt(2)*g, (2, 2) = -CapitalGamma-(1/2)*Kappa-Lambda, (2, 3) = -sqrt(2)*g, (3, 1) = 0, (3, 2) = sqrt(2)*g, (3, 3) = -2})

(2)

 


 

Download translate_from_mma.mw

i've come across a confusing behavior where the same command (a copy/paste of another command) is giving an output in a a different form.

Attaching a screen shot that shows this. Eq 6.8 is executed just after 6.7.

(i know the command is weird, i.e. subs(beta=beta, ..), etc.. this is part of some larger code base and i just put this in when trying to undertand what's going on).

I would hope for the same command to spit out the same output in this case. (nothing else gets assigned/called in betwen).

any idea what's going on?

 

i'm on maple 2018.2 on linux.

thanks

 

 

does anyone khow to force maple to automatically simplify expressions that look like this:

restart:

cc:=arctan(sin(phi)/cos(phi))-arccos(cos(phi))      
simplify(cc) assuming phi::real; #should be zero

i've played with convert/expand/simplify and in certain cases of course i can force maple to do this... (kind of manually).. but was hoping this could be more automatic.

thanks!

 

or am I missing something?

Consider:

A:=Matrix(2, 2, [1, 4, 5, 1]);
x0:=Vector([2,1]); #initial condition

sol := DETools:-matrixDE(A, t);

M:=(Matrix(convert(sol[1], listlist)));  #convert to modern day Matrix from array that is returned by matrixDE

#the solutoion according to the documentation:

x:=M.x0;

#should match x0 at t=0, but does not:

subs(t=0, x);

 

#using this instead seems to work. But the docs claim this is method is meant to work for constant coeffs.

sol := DETools:-matrixDE(A, t, method=matrixexp);

 

Am i missing something? or is matrixDE not to be trusted (especially in cases where method is not provided)?

as a side note, the documentation is very out of date; claims matrixDE returns Matrix and vector, but these are just the old array types; means LinearAlgebra operations do not work.

 

 

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