How to solve nonlinear equations in MATLAB?
2 views (last 30 days)
Show older comments
I have the following equations,
a+b(ic)+c(ic)^2=(1.1809)^2
a+b(id)+c(id)^2=(3.1570)^2
I need to solve the equations to find the values of a,b,c,ic,id. How can I do that? Newton raphson method is perfered.
3 Comments
John D'Errico
on 19 Sep 2022
Edited: John D'Errico
on 19 Sep 2022
That MAY be the challenge, but it is not possible to solve for 5 unknowns from only 2 equations.
You CANNOT use Newton-Raphson, as numerical methods do not apply to that class of problem.
You CAN solve for 2 of the variables, in terms of the other three variables, which must stay as parameters. Once they are known, then you can solve for the others. Pick ANY two variables to solve for.
For example, it is trivial to solve for a and b, as a function of the other unknowns, c, ic, id. This can be done using pencil and paper. Thus we see that
b(id)+c(id)^2 - (b(ic)+c(ic)^2) =(3.1570)^2 - (1.1809)^2
therefore
b = ((3.1570)^2 - (1.1809)^2 - c(id)^2 + c(ic)^2) / (id - ic)
Once you know b, then it is trivial to solve for a, as
a = - b(ic) - c(ic)^2 + (1.1809)^2
If you set three of the variables as known constants, then you might try using many tools, (even Newton-Raphson) to solve for the two remaining unknowns.
Just wanting to do something does not mean it has a solution, else I would have seen world peace long ago. Mathematics cannot perform magic.
IF I had to guess, I wonder if you actually know the coefficients a,b,c. They appear to then be two parabolic forms, in the variables ic and id.
Unfortunately, since a,b, and c are shared between the two curves, they would represent essentially parallel parabolas, which differ only in the constants on the right hand side. And this means the two curves are identical in shape, but they are just offset vertically. As such, it is not clear what you want to solve for. Perhaps you want to solve for the relationship between ic and id, such that the two curves would produce the same result. Your goal is terribly difficult to guess though.
Answers (1)
Souvik Das
on 22 Sep 2022
Follow the attached link for more information regarding solving an equation in MATLAB using Newton-Raphson method:
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!