## 769 Reputation

16 years, 328 days

## simplify expression under sqrt ...

Maple

what's the easiest way to have maple simplify the expression below from 'expr1' to the form of 'desired_form'? mathematica automatically simplifies to that (subjectively of course!) much nicer looking form.

 > restart:
 >
 > expr1:=-lambda-(1/2)*kappa__c-gamma__p-(1/2)*sqrt(-16*N*g^2+4*lambda^2-8*lambda*gamma__p+4*lambda*kappa__c+4*gamma__p^2-4*gamma__p*kappa__c+kappa__c^2);
 (1)
 > desired_form:=1/2*(-2*gamma__p - kappa__c - 2 *lambda - sqrt(-16*N*g^2 + (-2 * gamma__p + kappa__c + 2 * lambda)^2));
 (2)
 > expr1- desired_form: simplify(%);
 (3)
 >

## Implicit=false in Eigenvectors() vs Eige...

Maple

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]])
 (1)
 > LinearAlgebra:-Eigenvalues(M); #this is what i want but from Eigenvectors()
 (2)
 > LinearAlgebra:-Eigenvalues(M, implicit=true); #RootOf notation; not what i want, but option works here
 (3)
 > evals, evecs:=LinearAlgebra:-Eigenvectors(M); #RootOf everywhere;
 (4)
 >
 >
 > evals, evecs:=LinearAlgebra:-Eigenvectors(M, implicit=false); #still RootOf everywhere;
 (5)
 >
 >

## convert code from mathematica to maple...

Maple

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)
 > simplify(MM); #why is the first element simplified this way?
 (2)
 >

## same command, different output form...

Maple

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

## how to get maple to automatically simpli...

Maple

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!

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