Im trying to solve set of N - symbolic equations. The equations are non-linear and the variables are defined as symbolic:
x= sym('x', [1 n]) %% x1,x2 ... xn
the problem is that for each N, the N equations looks different, so I used "for" loops. At the end, i got 1xN array with the equations, called "eqn".
I read about using "fsolve" but I found 2 major problems. first, using fsolve requires x(i) instead of the symbolic xi. second, The equations must be written in advance in the form of
Because of the use of loops, I cannot know in advance how my equations will look like.
for example- this is the set for N=2:
[ 1/x2 - 1/x1 + 170 == 0, 170 - 1/x2 - 1/(x1 + x2) == 0]
and for N=3:
[ 1/(x2 + x3) - 1/x1 + 1/x2 + 170 == 0, 1/x3 - 1/x2 - 1/(x1 + x2) + 170 == 0, 170 - 1/(x2 + x3) - 1/x3 - 1/(x1 + x2 + x3) == 0]
thanks a lot!