0

I'm trying to solve a system of equations to find a point where a line originating from a known point intersects with a known function:

m*x_3 - y_3 = m*x_2 - y_2

Where it also holds that for the given function f:

y_3 = f(x_3)

It's certainly a system of two equations with two unknowns, and I think we can assume f is invertible (if needed), but I can't seem to figure a way to code as a simple Ax = b or x = A\b. Curious how I might try to approach this.

I've considered setting it up as:

g = @(x) m*x - f(x) - m*x_2 + y_2 and using an iterating zero solver such that g(x_3) = 0 but I'm trying to find a workaround to make it as efficient as possible.

Sam
  • 1
  • 1
  • 2
    If f is non linear, then you can't use linear system theory to solve the system. You do not have an equation in the form `Ax=b`. A fixed point method, and even better [newton's method](https://en.wikipedia.org/wiki/Newton%27s_method) would be the first things i would try. Newton's method is easy to code, and from my experience it converges fast enough. – MIKE PAPADAKIS Apr 03 '23 at 16:49
  • Thanks. I figured that was the case but wanted to make sure of it. – Sam Apr 03 '23 at 21:51

0 Answers0