Symbolic computation of nonlinear system of equations

3 views (last 30 days)
Bobo on 13 Sep 2016
Commented: Bobo on 20 Sep 2016
I have a nonlinear system of equations, and i would like to formulate the jacobian matrix in matlab symbolic tool box and then use the matlabfunction to convert the jacobian matrix to numerical matlab. The nonlinear equations are
from these equations a total of
defines the nonlinear equations. My matlab code gives error when I try to define the indexes j,k,and i. Below is my code
clear all;
close all;
syms x k y beta theta chi i j
Walter Roberson
Walter Roberson on 15 Sep 2016
I see that you edited something, but as I read over your post, I cannot find anything that has changed. Your equations still appear to be incorrect, especially with respect to how i is used. You still have not given any information about how the +/- is to be incorporated. You still have not clarified whether the two Sj you posted are intended to both equate to 0, or whether there are mathematical reasons in your problem where the two Sj will be equivalent to each other and only one of the two will be needed. You still have not indicated what you want to solve for.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 13 Sep 2016
The variable in symsum() cannot be used to index anything. You need to construct the vector of individual values and then sum() them.
For any individual k, how do you decide whether to add or subtract the 1/5* term? Or do you do both, thereby constructing 2^20 entries for Sj (all the possible combinations of plus and minus) ?
Your equations are for Sj but they do not involve j at any point: instead they use the undefined i .
I notice that both of your equations define Sj . Is the implication that the two Sj must equal each other?
Bobo on 20 Sep 2016
Thank you very much Walter. I questioned the validity of the above stated equations in my Matlab class and it turns out you were right.
The instructor of the course confirmed later after I complained about both your initial comments and that of John D'Errico's.
However,I am very grateful for the solutions you have provided. I am currently using it as reference in my Symbolic Maths Class.
Thank you very much

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!