Why does the solutions of nonlinear system are not correctly computed

1 view (last 30 days)
I hv the following system of nonlinear equations for computing switching angles of a multilevel inverter, taken as an example from my pwr elctnx book
function F = test(x)
F=[cos(5*x(1)) + cos(5*x(2))+cos(5*x(3)) + cos(5*x(4))+ cos(5*x(5))
cos(7*x(1)) + cos(7*x(2))+cos(7*x(3)) + cos(7*x(4)) + cos(7*x(5))
cos(11*x(1)) + cos(11*x(2))+cos(11*x(3)) + cos(11*x(4))+cos(11*x(5))
cos(13*x(1)) + cos(13*x(2))+cos(13*x(3)) + cos(13*x(4))+ cos(13*x(5))
cos(x(1)) + cos(x(2))+cos(x(3)) + cos(x(4))+ cos(x(5))-4];
I have used the matlab function FSOLVE with OPTIMSET to sovle this system for x1,x2,x3,x4 and x5 and on ocassions hv increased parameters like 'MaxFunEval' and MaxIter but the matlab answers are different from those given in the book ie x1=6.57;x2=18.94;x3=27.18;x4=45.15;x5=62.24;(in Degrees). plzzz anybody help me with this. I need it urgently

Accepted Answer

Matt J
Matt J on 6 May 2014
It looks like there must exist a solution with all x(1)=x(2)=x(3)=x(4)=x(5), due to the symmetry of your F. Therefore, the solution in your book is either just one of many, or you have incorrectly implemented your F(x). What is the final value of F(x) that fsolve returns?
  4 Comments
Matt J
Matt J on 6 May 2014
Edited: Matt J on 6 May 2014
Can't you just try a better initial guess like the warnings tell you, e.g.,
x0=[7, 20 , 25, 42, 60];
options=optimset('Display','iter','TolFun',1e-11);
[x,fval] = fsolve(@Ffun,x0,options)
x =
6.5698 18.9402 27.1833 45.1358 62.2425
fval =
1.0e-14 *
0.0555
0.0694
-0.1110
0.0390
0

Sign in to comment.

More Answers (1)

Asif Khan
Asif Khan on 2 Dec 2014
You were right Matt :) . There can be several solutions to this problem

Tags

Community Treasure Hunt

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

Start Hunting!