Hello all
I have a nonlinear system of equations F1(p,q) = 0, F2(p,q) = 0, with F1 and F2 represented in MATLAB as symbolic expressions. I want to solve these equations using fsolve.
Now the problem is that fsolve() wants the variables to solve for to be in a vector X = [x(1) x(2) ... x(n)],so I should transform p and q into x(1) and x(2) and this transformation is giving me the problem.
As a simple example, suppose my system to be solved is defined by:
syms p q
F = [sin(p)*sin(q); p^2+q^2-1]
how can I transform these equations to something like: F = [sin(x(1)).*sin(x(2)); x(1).^2 + x(2).^2-1]
Note: this is a small example of the problem. The real program has 81 equation in 81 unknowns . So I cannot do this transformation manually and I need something intelligent to do this.
How can I do this transformation Or maybe there's a better approach to deal with the problem (say, directly in the symbolic domain?)I tried solve for my 81 equations but it takes infinite time.
Any help will be appreciated ... thank you!