If you don't tell solve() that beta_2 is a parameter, it assumes that it is a constant. It then returns no solutions because it solves eq1 and eq2 each for phi_2 and sees that they look different, because they are only equal for certain values of beta_2 (at least, I'm fairly sure this is what is happening).
You can get the solutions by telling solve that beta_2 is a parameter In [14]: solve([eq1, eq2], [phi_2, beta_2]) Out[14]: [(0.0, 1.0), (1.0, 0.0)] Aaron Meurer On Wed, Sep 16, 2015 at 6:12 AM, Uwe Fechner <[email protected]> wrote: > Hello, > > I try to calculate the tangent of a circle. This is a quite simple system of > equations (one is quadratic), > but sympy fails (empty solution set). Any idea why? > > from __future__ import division > from sympy import * > from sympy.solvers import solve > > init_printing(use_latex = True) > r, phi_0, phi_1, phi_2, beta_0, beta_1, beta_2= symbols('r phi_0, phi_1, > phi_2, \ > beta_0, beta_1, beta_2') > > if True: > if True: > phi_0 = 0 > beta_0 = 0 > phi_1 = 1. > beta_1 = 1. > r=1. > eq1 = Eq((phi_2 - phi_1) * (phi_2 - phi_1) + (beta_2 - beta_1) * (beta_2 > - beta_1) - r*r) > eq2 = Eq((phi_2 - phi_0) * (phi_2 - phi_1) + (beta_2 - beta_0) * (beta_2 > - beta_1)) > result = solve([eq1, eq2], phi_2) > print result > > The result is an empty list. Any idea, how to fix this? > Expected result: phi_2 = 1. > > Any hints appreciated! > > U. Fechner, TU Delft > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/09115c90-e2b9-40e4-93e1-42e9696adc22%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6JvxY6wcsOo1m_J%2B3gLZitj-t8hYqLkw%3DDnjKq-y9X0Sw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
