" fsolve" to solve a nonlinear system with two unknowns - wrong results!
Show older comments
Hello,
I am trying to solve a system of nonlinear equations with two unknowns. I am using "fsolve" to do so (and I know what results/answers I should get). However, the values I get are wrong! The code containing the function of nonlinear equations is added below(pfun). Am I doing something wrong in passing parameters, etc? In the command line I first give an initial guess by entering: x0 = [0,0] and then I enter: S = fsolve(@pfun, x0) then I get wrong values in S. Why is that so?
Here is the code in the function:
function F = pfun(x)
w = 31;
n = 10;
m = 6;
F = [2.*(1-2.*x(1)).*(1-x(1).^(m+1))./ (1-2.*x(1)).* (1-x(1).^(m+1)) + w.*(1-x(1)).*(1-(2.*x(1)).^ (m+1)) - x(2); 1-(1-x(2).^(n-1))-x(1)];
I highly appreciate your help. Thank you.
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics 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!