フィルターのクリア

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

1 回表示 (過去 30 日間)
saar
saar 2014 年 2 月 27 日
回答済み: Star Strider 2014 年 2 月 27 日
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.

回答 (1 件)

Star Strider
Star Strider 2014 年 2 月 27 日
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.

カテゴリ

Help Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by