solving Z + 2 simultaneous nonlinear equations numerically (Newton) with sum
1 次查看(过去 30 天)
显示 更早的评论
Hello ,
I am trying to solve Z + 2 simultaneous nonlinear System but i have problems with that because of the sum . I do not know how to deal with that in Matlab
I have 3 Equations with 3 Unknowns the equations as follows
The Unknowns are
, and
Thank you very much for any Help
0 个评论
回答(1 个)
Amanpreetsingh Arora
2020-11-10
You can solve the system of equations using "fsolve". Implement a function that takes the Z+2 dimensional unknowns as input and returns Z+2 dimensional vector with the values of LHS of the Z+2 equations. Then pass this function with an initial guess to "fsolve". The documentation for "fsolve" is as follows.
3 个评论
Amanpreetsingh Arora
2020-11-11
How many equations and variables do you have? Your original post mentions Z+2 but the function only has 3 equations and 3 unknowns.
As per your original post, your function input "x" needs to be Z+2 dimensional. For example, you can represent your unknowns as follows.
x(1) =
x(2) =
x(3:end) = vector
which can be mapped to
F(1:Z) = The first equation (which is collection of Z equations)
F(Z+1) = 2nd eqn, F(Z+2) = 3rd eqn.
For summation, just keep adding values to F(Z+1) and F(Z+2) in the loop, as follows.
% Inside the loop
F(Z+1)=F(Z+1) + <summation term>;
F(Z+2)=F(Z+2) + <summation term>;
You don't need symsum for this.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!