Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
for_next

Posts: 64
Registered: 10/12/07
Positive real root
Posted: Apr 16, 2009 2:46 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.