Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #14362
| From | carlos.felippa%colorado.edu@gtempaccount.com |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Separating a time function |
| Date | 2013-04-30 08:18 +0000 |
| Message-ID | <klnuo4$g3m$1@smc.vnet.net> (permalink) |
| Organization | Time-Warner Telecom |
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])
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Separating a time function carlos.felippa%colorado.edu@gtempaccount.com - 2013-04-30 08:18 +0000
csiph-web