Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Positive real root
Replies: 8   Last Post: Nov 16, 2013 3:44 PM

 Messages: [ Previous | Next ]
 for_next Posts: 64 Registered: 10/12/07
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=P1n-Pag-(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/(1-b);
a2=(b/(b-1))^2+(2*B*(b-a)-C*m^2*(b-1)^2)/(D*alfa^k*(b-1)^2);
a3=(2*C*m^2*b)/(D*alfa^k*(b-1));
a4=-(C*m^2*b)/(D*alfa^k*(b-1)^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.

Date Subject Author
4/16/09 for_next
4/16/09 Roger Stafford
4/16/09 Roger Stafford
4/16/09 Curious
4/16/09 for_next
4/16/09 Curious
4/16/09 for_next
6/9/10 v
11/16/13 DeeDeeDee