Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Positive real root
Posted:
Apr 16, 2009 2:46 PM


I have vector with complex and real roots  P. I have to write code to find only positive real root(in this calculation its only one). This is my code: R1=1.230; X1=1.500; Xm=53.700; R2=0.787; X2=2.490; Vn=220; Tn=36.340;T=10; Pn=5.500; I1n=11.500; I0n=19.5; f=30; fn=50; P=4; sn=0.036; ns=1500; P1n=6451.5;E1n=209; m=T/Tn; alfa=f/fn; ws=157; nn=1446; wn=151.348; J=0.017; a=0.0327; b=3.112; k=1.400; Pag=Tn*ws; Pmag=P1nPag(3*R1*I1n^2+0.005*Pn); B=3*R1*I0n^2; C=((R1+R2)*Pag^2)/(3*E1n^2); D=Pmag;
a0=1; a1=2*b/(1b); a2=(b/(b1))^2+(2*B*(ba)C*m^2*(b1)^2)/(D*alfa^k*(b1)^2); a3=(2*C*m^2*b)/(D*alfa^k*(b1)); a4=(C*m^2*b)/(D*alfa^k*(b1)^2);
Pol=[a0 0 a1 0 a2 0 a3 0 a4]; P= roots(Pol)
Here the positive real root is 0.2968. But I don't know how to do this by code ( not to see all roots and to say  This is real positive root). Please help me.



