Re: Simplify[ {Re[Sqrt[-1 + eta^2]], Im[Sqrt[-1 + eta^2]]}, eta<1]
- To: mathgroup at smc.vnet.net
- Subject: [mg50641] Re: [mg50617] Simplify[ {Re[Sqrt[-1 + eta^2]], Im[Sqrt[-1 + eta^2]]}, eta<1]
- From: Andrzej Kozlowski <andrzej at akikoz.net>
- Date: Wed, 15 Sep 2004 01:49:52 -0400 (EDT)
- References: <200409130619.CAA14342@smc.vnet.net> <8C2E6168-0558-11D9-A0AA-000A95B4967A@akikoz.net> <00bc01c49991$4d2d5260$4f604ed5@lap5100> <656B2636-0588-11D9-A0AA-000A95B4967A@akikoz.net> <014601c499a8$afc7aa30$4f604ed5@lap5100>
- Sender: owner-wri-mathgroup at wolfram.com
After Adam Strzebonski's response the right apprach seems to be: dum = -((z*(-((-1 + E^((2*t*Sqrt[w^2*(-1 + z^2)])/w^2))*w* z) + (1 + E^((2*t*Sqrt[w^2*(-1 + z^2)])/w^2))* Sqrt[w^2*(-1 + z^2)]))/ (E^((t*(w*z + Sqrt[w^2*(-1 + z^2)]))/w^2)*R*w* Sqrt[w^2*(-1 + z^2)])); Refine[ComplexExpand[Re[dum]], {w > 0, z > 1}] -(z^2/(E^((t*(z*w + Sqrt[z^2 - 1]*w))/w^2)* (R*w*Sqrt[z^2 - 1]))) + (E^((2*t*Sqrt[z^2 - 1])/w - (t*(z*w + Sqrt[z^2 - 1]*w))/ w^2)*z^2)/(R*w*Sqrt[z^2 - 1]) - z/(E^((t*(z*w + Sqrt[z^2 - 1]*w))/w^2)*(R*w)) - (E^((2*t*Sqrt[z^2 - 1])/w - (t*(z*w + Sqrt[z^2 - 1]*w))/ w^2)*z)/(R*w) Refine[ComplexExpand[Re[dum]], {w > 0, -1 < z < 1}] Out[53]= -(((1 - z^2)^(3/2)*Cos[(2*t*Sqrt[1 - z^2])/w]* Sin[(t*Sqrt[1 - z^2])/w]*z^2)/(E^((t*z)/w)* (R*w*(z^2 - 1)^2))) + ((1 - z^2)^(3/2)*Sin[(t*Sqrt[1 - z^2])/w]*z^2)/ (E^((t*z)/w)*(R*w*(z^2 - 1)^2)) + ((1 - z^2)^(3/2)*Cos[(t*Sqrt[1 - z^2])/w]* Sin[(2*t*Sqrt[1 - z^2])/w]*z^2)/ (E^((t*z)/w)*(R*w*(z^2 - 1)^2)) - (Cos[(t*Sqrt[1 - z^2])/w]*z)/(E^((t*z)/w)*(R*w)) - (Cos[(t*Sqrt[1 - z^2])/w]*Cos[(2*t*Sqrt[1 - z^2])/w]*z)/ (E^((t*z)/w)*(R*w)) - (Sin[(t*Sqrt[1 - z^2])/w]* Sin[(2*t*Sqrt[1 - z^2])/w]*z)/(E^((t*z)/w)*(R*w)) Of course this will only work in Mathematica 5.0. However, in Mathematica 5.0 on Mac OS X Simplify also works, giving Simplify[ComplexExpand[Re[dum]], {w > 0, z > 1}] -((1/(R*w*(z^2 - 1)))*((2*z*(Cosh[(t*Sqrt[z^2 - 1])/w] + Sinh[(t*Sqrt[z^2 - 1])/w])* ((z^2 - 1)*Cosh[(t*Sqrt[z^2 - 1])/w] - z*Sqrt[z^2 - 1]*Sinh[(t*Sqrt[z^2 - 1])/w]))/ E^((t*(z + Sqrt[z^2 - 1]))/w))) Simplify[ComplexExpand[Re[dum]], {w > 0, -1 < z < 1}] -((2*z*((z^2 - 1)*Cos[(t*Sqrt[1 - z^2])/w] + z*Sqrt[1 - z^2]*Sin[(t*Sqrt[1 - z^2])/w]))/ (E^((t*z)/w)*(R*w*(z^2 - 1)))) Andrzej Andrzej Kozlowski Chiba, Japan http://www.akikoz.net/~andrzej/ http://www.mimuw.edu.pl/~akoz/ On 14 Sep 2004, at 00:44, Peter S Aptaker wrote: > *This message was transferred with a trial version of CommuniGate(tm) > Pro* > As I said at the end of the last e-mail , my real aim is to simplify > this > well known solution to a second order ODE for -1<z <1 and z >1 and w>0 > . (z > is the damping ratio and w the natural frequency). The aim is to > demonstrate > Mathemica with a familiar trivial problem! > > dum= -((z*(-((-1 + E^((2*t*Sqrt[w^2*(-1 + z^2)])/w^2))*w*z) + (1 + > E^((2*t*Sqrt[w^2*(-1 + z^2)])/w^2))* > Sqrt[w^2*(-1 + z^2)]))/(E^((t*(w*z + Sqrt[w^2*(-1 + > z^2)]))/w^2)*R*w*Sqrt[w^2*(-1 + z^2)])) > > Noting Andrzej'ssuggestion I shall take > > dum2=ComplexExpand[Re[dum]]; > > The following take forever > > Simplify[Re[dum2],w>0,z>1] > > Simplify[Re[dum2],w>0,-1<z<1] > > > > ----- Original Message ----- > From: "Andrzej Kozlowski" <andrzej at akikoz.net> To: mathgroup at smc.vnet.net > To: "Peter S Aptaker" <psa at laplacian.co.uk> > Cc: "Adam Strzebonski" <adams at wolfram.com>; "MathGroup" > <mathgroup at smc.vnet.net>; "Jon McLoone" <jonm at wolfram.co.uk> > Sent: Monday, September 13, 2004 2:25 PM > Subject: [mg50641] Re: [mg50617] Simplify[ {Re[Sqrt[-1 + eta^2]], Im[Sqrt[-1 + > eta^2]]}, eta<1] > > >> *This message was transferred with a trial version of CommuniGate(tm) >> Pro* >> This is indeed most peculiar and looks like a bug. However as a >> workaround I suggest adding ComplexExpand as follows: >> >> >> FullSimplify[ComplexExpand[Im[Sqrt[-1 + eta^2]]], >> -1 < eta < 1] >> >> >> Sqrt[1 - eta^2] >> >> This also works in version 4.2. >> >> Andrzej >> >> On 13 Sep 2004, at 21:56, Peter S Aptaker wrote: >> >>> Sadly it does not work in M4.2 which I tend to use "for varous >>> reasons" >>> >>> >>> Back to M5 for now: >>> >>> Simplify[{Re[Sqrt[-1+eta^2]],Im[Sqrt[-1+eta^2]]},-1<eta<1] is fine >>> >>> Unfortunately: >>> >>> >>> Simplify[Im[Sqrt[-1 + eta^2]],-1<eta<1] >>> >>> and >>> >>> Simplify[{Im[Sqrt[-1+eta^2]],Im[Sqrt[-1+eta^2]]},-1<eta<1] >>> >>> both leave the Im[] >>> >>> Thanks >>> Peter >>> ----- Original Message ----- >>> From: "Andrzej Kozlowski" <andrzej at akikoz.net> To: mathgroup at smc.vnet.net >>> To: "peteraptaker" <psa at laplacian.co.uk> >>> Cc: <mathgroup at smc.vnet.net> >>> Sent: Monday, September 13, 2004 8:43 AM >>> Subject: [mg50641] Re: [mg50617] Simplify[ {Re[Sqrt[-1 + eta^2]], Im[Sqrt[-1 + >>> eta^2]]}, eta<1] >>> >>>> *This message was transferred with a trial version of >>> CommuniGate(tm) Pro* >>>> On 13 Sep 2004, at 15:19, peteraptaker wrote: >>>> >>>>> *This message was transferred with a trial version of >>> CommuniGate(tm) >>>>> Pro* >>>>> Have I missed something - my apologies if this is answered in a FAQ >>>>> I want to make the simple Re and Im parts simplify properly? >>>>> >>>>> test = >>>>> {Re[Sqrt[-1 + eta^2]], Im[Sqrt[-1 + eta^2]]} >>>>> >>>>> FullSimplify[test, eta > 1] >>>>> gives*{Sqrt[-1 + eta^2], 0} >>>>> >>>>> But >>>>> FullSimplify[test, eta < 1] >>>>> gives >>>>> {Re[Sqrt[-1 + eta^2]], Im[Sqrt[-1 + eta^2]]} >>>>> >>>>> Needs["Algebra`ReIm`"] does not seem to help >>>>> >>>>> Real numbers demonstrate what should happen: >>>>> test) /. {{eta -> 0.1}, {eta -> 2}} >>>>> {{0., 0.99498743710662}, {Sqrt[3], 0}} >>>>> >>>>> >>>> >>>> There is nothing really strange here, Mathematica simply can't give >>> a >>>> single simple expression that would cover all the cases that arise. >>> So >>>> you have to split it yourself, for example: >>>> >>>> >>>> FullSimplify[test, eta < -1] >>>> >>>> >>>> {Sqrt[eta^2 - 1], 0} >>>> >>>> FullSimplify[test, eta == -1] >>>> >>>> {0, 0} >>>> >>>> >>>> FullSimplify[test, -1 < eta < 1] >>>> >>>> {0, Sqrt[1 - eta^2]} >>>> >>>> >>>> FullSimplify[test, eta == 1] >>>> >>>> >>>> {0, 0} >>>> >>>> >>>> FullSimplify[test, 1 <= eta] >>>> >>>> >>>> {Sqrt[eta^2 - 1], 0} >>>> >>>> >>>> or, you can combine everything into just two cases: >>>> >>>> FullSimplify[test, eta $B":(B Reals && Abs[eta] < 1] >>>> >>>> {Re[Sqrt[eta^2 - 1]], Im[Sqrt[eta^2 - 1]]} >>>> >>>> >>>> FullSimplify[test, eta $B":(B Reals && Abs[eta] >= 1] >>>> >>>> {Sqrt[eta^2 - 1], 0} >>>> >>>> In fact you do not really need FullSimplify, simple Simplify will do >>>> just as well. >>>> >>>> >>>> Andrzej Kozlowski >>>> Chiba, Japan >>>> http://www.akikoz.net/~andrzej/ >>>> http://www.mimuw.edu.pl/~akoz/ >>>> >>>> >> >> > > >
- References:
- Simplify[ {Re[Sqrt[-1 + eta^2]], Im[Sqrt[-1 + eta^2]]}, eta<1]
- From: psa@laplacian.co.uk (peteraptaker)
- Simplify[ {Re[Sqrt[-1 + eta^2]], Im[Sqrt[-1 + eta^2]]}, eta<1]