In SymPy if you want numerical solutions you should use nsolve
:
In [97]: nsolve((eq1,eq2,eq3), (a, f, phi), [1, 1, 1])
Out[97]:
⎡-0.5538674055548 ⎤
⎢ ⎥
⎢0.837453526933376⎥
⎢ ⎥
⎣6.95538865037068 ⎦
Here I've used an initial guess of [1, 1, 1]
. I'm sure you can find more solutions if you use other initial guesses (the system has an infinite number of solutions).
Note that if you substitute these approximate solutions into the equations you will get False. That's because the lhs and the rhs as approximate numbers are unequal:
In [101]: eq1
Out[101]: a⋅sin(11.42806⋅π⋅f + φ) - 0.347064 = 0
In [102]: (sol,) = nsolve((eq1,eq2,eq3), (a, f, phi), [1, 1, 1], dict=True)
In [103]: sol
Out[103]: {a: -0.5538674055548, f: 0.837453526933376, φ: 6.95538865037068}
In [104]: eq1.subs(sol)
Out[104]: False
In [105]: eq1.lhs.subs(sol)
Out[105]: -0.347064 - 0.5538674055548⋅sin(6.95538865037068 + 9.57046915300624⋅π)
In [106]: eq1.lhs.subs(sol).evalf()
Out[106]: -1.29025679909939e-15
Since that isn't equal to the rhs (which is zero) substituting into the Eq
will give False
but we can see that it is on the order of rounding error.
You can get more digits of accuracy using the prec
argument to nsolve
:
In [107]: (sol,) = nsolve((eq1,eq2,eq3), (a, f, phi), [1, 1, 1], dict=True, prec=50)
In [108]: sol
Out[108]:
{a: -0.55386740555480009188439615822304411607289430639164, f: 0.83745352693337644862065403386504543698722276260565, φ: 6.9553886
503706758809942541544797040214354242211993}
In [109]: eq1.lhs.subs(sol).evalf()
Out[109]: -3.27785083138700e-51