-1

Let's suppose that I have two transcendental functions f(x, y) = 0 and g(a, b) = 0.

a and b depend on y, so if I could solve the first equation analytically for y, y = f(x), I could have the second function depending only on x and thus solving it numerically.

I prefer to use python, but if matlab is able to handle this is ok for me.

Is there a way to solve analytically trascendent functions for a variable with python/matlab? Taylor is fine too, as long as I can choose the order of approximation.

Frank
  • 81
  • 1
  • 9
  • not python related, and more in general off topic on Stack Overflow – fferri May 13 '17 at 16:37
  • In general, no. In many specific cases, yes. Can you share the function / family of functions you are considering? – Hugh Bothwell May 13 '17 at 17:41
  • @fferri yes I had thought about that, but this is actually a problem hard to solve without a calculator. Moreover, in the end, I will have to write the algorithm down; so for me it's also a programming problem. You've got a point anyway. – Frank May 13 '17 at 18:48
  • @HughBothwell `k*tan(y) + j*tan(arcsin(sin(y)/x)) = const.` and I need to have `y = f(x)` – Frank May 13 '17 at 18:50
  • I feel that for this kind of problem you may have better luck on http://math.stackexchange.com/ (you can talk about programming too) – fferri May 14 '17 at 08:45

1 Answers1

1

I tried running this through Sympy like so:

import sympy

j, k, m, x, y = sympy.symbols("j k m x y")
eq = sympy.Eq(k * sympy.tan(y) + j * sympy.tan(sympy.asin(sympy.sin(y) / x)), m)
eq.simplify()

which turned your equation into

Eq(m, j*sin(y)/(x*sqrt(1 - sin(y)**2/x**2)) + k*tan(y))

which, after a bit more poking, gives us

k * tan(y) + j * sin(y) / sqrt(x**2 - sin(y)**2) == m

We can find an expression for x(y) like

sympy.solve(eq, x)

which returns

[-sqrt(j**2*sin(y)**2/(k*tan(y) - m)**2 + sin(y)**2),
 sqrt(j**2*sin(y)**2/(k*tan(y) - m)**2 + sin(y)**2)]

but an analytic solution for y(x) fails.

Hugh Bothwell
  • 55,315
  • 8
  • 84
  • 99