Separating a time function

• To: mathgroup at smc.vnet.net
• Subject: [mg130660] Separating a time function
• Date: Tue, 30 Apr 2013 04:19:45 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-outx@smc.vnet.net
• Delivered-to: mathgroup-newsendx@smc.vnet.net

```Solving some wave propagation problems I get a separable solution

F(space,time) = f(space)*g(time)

The solution F is symbolic, and intermixes f and g. To separate the time
dependence out I wrote the SeparateFunctionOfTime module listed below.
The test script following the module tries 6 combinations. It works fine
when g is real, but in the last test it returns Sqrt[2]*Abs[Sin[t]]*(4*I + 3*Cot[t])
instead of (3 Cos[t]+4 I*Sin[t])]. How can I get Simplify (or FullSimplify)
inside SeparateFunctionOfTime to get rid of that Abs?

(Test performed with version 5.2 on a Mac Pro.  Have not tried it
yet under v 9.0 on my laptop)

\$CharacterEncoding="Unicode";
SeparateFunctionOfTime[f_,t_]:=Module[{g1,g2,g},
g1=Simplify[D[f,t]/f];
g2=Simplify[Integrate[g1,t]];
g=  Simplify[Exp[g2]]; g=FullSimplify[g,t\[Element]Reals];
Return[g]];

ClearAll[f,x,y,t,a0,a1,a2,b0,b1,b2,c,c0,c1,c2];
f=Expand[(a0+a1*x+a2*x^2)*(b0+b1*t+b2*t^2+t^3*Sign[t])];
Print["sep time function=",SeparateFunctionOfTime[f,t]//InputForm];
f=Expand[(a0*x^2+a1*x*y+a2*y^2)*(b0+b1*t+b2*t^2*Exp[t])];
Print["sep time function=",SeparateFunctionOfTime[f,t]//InputForm];
f=Expand[(a0*x^2+a1*x*y+a2*y^2)*(b0+b1*t+b2*Log[t])];
Print["sep time function=",SeparateFunctionOfTime[f,t]//InputForm];
f=Expand[a0*Exp[c*x*y]*(c0+c1*Cos[omega*t]+c2*Sin[omega*t])];
Print["sep time function=",SeparateFunctionOfTime[f,t]//InputForm];
f=Expand[(a0+a1*x+a2*x^2)*(3 Cos[t]+4 I*Sin[t])];
Print["sep time function=",SeparateFunctionOfTime[f,t]//InputForm];

sep time function=b0 + t*(b1 + b2*t) + t^3*Sign[t]
sep time function=b0 + t*(b1 + b2*E^t*t)
sep time function=b0 + b1*t + b2*Log[t]
sep time function=c0 + c1*Cos[omega*t] + c2*Sin[omega*t]
sep time function=Sqrt[2]*Abs[Sin[t]]*(4*I + 3*Cot[t])

```

• Prev by Date: Does Wolfram Alpha Pro support all of the functionality of Mathematica
• Next by Date: Problems with Importing and JLink
• Previous by thread: Does Wolfram Alpha Pro support all of the functionality of Mathematica