Filter löschen
Filter löschen

How to solve a system of non linear equations with non-constant parameters?

1 Ansicht (letzte 30 Tage)
saar
saar am 27 Feb. 2014
Beantwortet: Star Strider am 27 Feb. 2014
I have a system of 2 non_linear (quadratic) equations:
x^2 - 2*a*x + a^2 + y^2 - 2*b*y + b^2 = r^2
x^2 - 2*c*x + c^2 + y^2 - 2*d*y + d^2 = r^2
where x,y are unknowns , and a,b,c,d,r are parameters that change in every iteration inside a loop.
I've tried to use the 'solve()' method , but I get an answer that is a function of the parameters and I need the real number solution.

Antworten (1)

Star Strider
Star Strider am 27 Feb. 2014
Use matlabFunction to create executable expressions:
syms a b c d r x y
[x, y] = solve(x^2 - 2*a*x + a^2 + y^2 - 2*b*y + b^2 == r^2, x^2 - 2*c*x + c^2 + y^2 - 2*d*y + d^2 == r^2);
x = simplify(collect(x));
y = simplify(collect(y));
xmf = matlabFunction(x)
ymf = matlabFunction(y)
Then use xmf and ymf (rename them if you want) in your loop.

Kategorien

Mehr zu Systems of Nonlinear Equations finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by