Reputation: 120
Let's say we have this ODE :
The solution of this equation normally is
Which is what sympy will give me obviously, though I need the solution in this form instead :
With the constants being A and .
The goal of this is to study the dephasing of the system in question.
Upvotes: 1
Views: 90
Reputation: 91500
In this case, C1 = -A*sin(phi)
and C2 = A*cos(phi)
(you can work this out by looking at the identity cos(x + y) = -sin(x)*sin(y) + cos(x)*cos(y)
).
So to do the simplification, replace the constants:
In [19]: A, C1, C2, phi = symbols('A C1 C2 phi')
In [20]: dsolve(9.6*f(t) + 8.0*f(t).diff(t, t), f(t))
Out[20]:
⎛√30⋅t⎞ ⎛√30⋅t⎞
f(t) = C₁⋅sin⎜─────⎟ + C₂⋅cos⎜─────⎟
⎝ 5 ⎠ ⎝ 5 ⎠
In [21]: dsolve(9.6*f(t) + 8.0*f(t).diff(t, t), f(t)).subs({C1: -A*sin(phi), C2: A*cos(phi)})
Out[21]:
⎛√30⋅t⎞ ⎛√30⋅t⎞
f(t) = - A⋅sin(φ)⋅sin⎜─────⎟ + A⋅cos(φ)⋅cos⎜─────⎟
⎝ 5 ⎠ ⎝ 5 ⎠
In [22]: trigsimp(dsolve(9.6*f(t) + 8.0*f(t).diff(t, t), f(t)).subs({C1: -A*sin(phi), C2: A*cos(phi)}))
Out[22]:
⎛ √30⋅t⎞
f(t) = A⋅cos⎜φ + ─────⎟
⎝ 5 ⎠
Upvotes: 1
Reputation: 93
In the end, solving
,
if and
are known is just a geometric problem. Start with
.
I suggest asking this question in https://mathoverflow.net/. If you ask, please link the question here. I am curious about the answer.
Upvotes: 0