Is this way of solving equations correct mathematically?
1 view (last 30 days)
Show older comments
We changed the system of equations that we were solving using fsolve to get better results by changing a parametre to a variable and adding an equation for the same. However, I am not confident on the way we are doing it. Hence, I am presenting a short example (since writing the exact equations might be confusing). It would be great to get suggestions if this way writing the equations is correct:
Original system: assume a and b are parameters,
3x-z = a;
2x+5y = b;
y = z;
The change in the system
3x-z = a;
2x+5y = b;
y = z;
2x+5z = b
1 Comment
John D'Errico
on 10 Nov 2019
So what are the equations you are using in the second case? What you have written is identical to the first, having replaced z with y in one equation.
Are you thinking that since you have reduced the problem to one of 2 equations in 2 unknowns it is better? (Yes, by reducing the search space, of course this must be an improvement.)
But if you have 4 equations in the second case, that is a bad idea.
Regardless, the system you have posed is trivial, and should never be solved using fsolve anyway, since it is LINEAR! As well, fsolve cannot have unknown parameters. So a and b must be KNOWN parameters.
Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!