Hi Parthsarthi,
I understand that you want to generalize a system of equations with different orders in a matrix to find the roots using an iterative Newton-Ralphson method. Based on the shared information, I see that you want to first calculate the Jacobian of the generalized matrix and then use the result to iteratively solve for roots.
Bases on the shared information, I assume all coefficients to be 1 and each "x_i" (respectively "y_i") represents a different variable. Since the coefficients are same, a solution to "F11" is same as solution to "F1n" (similar case holds for "F2i").
You can create the Jacobian as follows in MATLAB:
syms x y
F1 = x - y - 1;
F2 = x^2 + y^2 - 1;
eqn = [F1; F2];
J = jacobian(eqn, [x, y])
J =
For more information on "solving equations using symbolic math" in MATLAB, refer to the following MathWorks documentation:
If you intend to create a column vector of "F1i" and a separate column vector for "F2i" with varying "i", use the following MATLAB script:
n = 10;
xi = sym('x', [1 10])
yi = sym('y', [1 10])
F1i = xi - yi - 1;
F2i = xi.^2 + yi.^2 - 1;
J1i = jacobian(F1i, [xi, yi])
J2i = jacobian(F2i, [xi, yi])
xi =
yi =
J1i =
J2i =
Hope this helps.
Regards,
Nipun