Prev: Imrect rotate
Next: Database fastinsert slow
From: Alan Weiss on 2 Dec 2009 11:36 Hi, as stated in the documentation, fsolve handles only real numbers. If you want to use complex numbers, separate the numbers into real and imaginary parts so that fsolve sees only real numbers. Alan Weiss MATLAB mathematical toolbox documentation ALESSANDRO wrote: > Hi all, > > I have a problem with my funcion, when I put the imaginary part in n1. have a look ! > > function F=sistema_individual_62hb_(x) > > vb=230; %VOLTAJE BATERIA > n1=200+96.8644209*j; %potencia consumo 1 en watt > ng=100; %potencia generator en watt > > > F=[ x(1)-x(2)-x(3) > vb-x(4) > x(4)-x(5) > > ng-x(4)*conj(x(2)) > n1-x(5)*conj(x(1)) ]; > > So, when I enter this: > > > xx = fsolve(@sistema_individual_62hb_SEGUNDO,[1 1 1 230 230]) > > I1=xx(1) > Ig=xx(2) > Ib=xx(3) > > Vg=xx(4) > V1=xx(5) > > NG=Vg*conj(Ig) > N1=V1*conj(I1) > NB=230*conj(Ib) > ------------------ > I have strange unexpected roots, and they vary when I change starting points. The strangest (for me!) is that if I remove the imaginary part of n1=200+96.8644209*j; from the function definition above, roots become expected and they don't depend on a large number of starting points ( as I expect). > > I have this error message:Optimizer appears to be converging to a point which is not a root. > Norm of relative change in X is less than max(options.TolX^2,eps) but > sum-of-squares of function values is greater than or equal to sqrt(options.TolFun) > Try again with a new starting guess. > > May you guys help me ? > Is fsolve the best way to solve non linear equations with complex numbers ? > > thank you very much !!!!
|
Pages: 1 Prev: Imrect rotate Next: Database fastinsert slow |