How to solve 2n+2 nonlinear equations in MATLAB?

Here I want to solve these nonlinear equations. n is known and it is defined by function variable.
function[I]=solveequations[n]
where I0 I1 ... In are known, and A0 A1 ... An and x0 x1 ... xn are variables.
So how to calculate these 2n+2 nonlinear equations in MATLAB?
Thanks!

回答 (1 件)

Titus Edelhofer
Titus Edelhofer 2015 年 4 月 21 日

1 投票

Hi Simon,
you might try to use fminsearch. For simplicity I assume A and x to count from 1 instead of 0. First write the objective function
function y = goal(X, I)
n = length(x) / 2;
A = X(1:n);
x = X(n+1:end);
f = zeros(n,1);
for i=1:n
f(i) = sum(A .* x.^(i-1) - I(i));
end
y = sum(abs(y));
and then call fminsearch with
x = fminsearch(@(x) goal(x, I), x0);
where I is the vector of given I's and x0 some start vector like [A1, A2, ... An, x1, ..., xn]. As I said, probably you should rewrite first for A1...An instead of A0...An etc. to make life easier.
Titus

カテゴリ

ヘルプ センター および File ExchangeSystems of Nonlinear Equations についてさらに検索

製品

質問済み:

2015 年 4 月 20 日

回答済み:

2015 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by