Re: Electrical Power Systems
- To: mathgroup at smc.vnet.net
- Subject: [mg64040] Re: [mg64018] Electrical Power Systems
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Sat, 28 Jan 2006 02:24:08 -0500 (EST)
- References: <200601271013.FAA19058@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
mibelair at hotmail.com wrote: > Dear group, > I am running Mathematica 5.2 and I would like to find a package to > operate with exponential expresions and numerical values for Electrical > Power Systems. > > For example, > 220 E^(Pi/2)+220 E^(5 Pi/6) yields 380 E^(2 Pi/3) This is not really correct. First, you want complex exponentials. Then you are making a numeric approximation but writing it as an exact result. Here is an approach that is along the lines you seek. polarForm[z_] := Module[{abs,arg}, abs = ComplexExpand[Abs[z],TargetFunctions->{Abs,Arg}]; arg = ComplexExpand[Arg[z],TargetFunctions->{Abs,Arg}]; abs * Exp[I*arg] ] In[11]:= InputForm[polarForm[220*E^(I*Pi/2)+220*E^(5*I*Pi/6)]] Out[11]//InputForm= 220*Sqrt[3]*E^(((2*I)/3)*Pi) If you really want an integer approximation to the magnitude coefficient you can play around with rationalizing a numeric approximation, as below. In[17]:= Rationalize[SetPrecision[220*Sqrt[3],2],0] Out[17]= 381 Daniel Lichtblau Wolfram Research
- References:
- Electrical Power Systems
- From: mibelair@hotmail.com
- Electrical Power Systems