Root finding

Carrico, Paul paul.carrico at esterline.com
Wed Jan 26 15:00:32 CET 2011


Dear all,
 
is it a stupid question in asking why the condition herebellow leads to
an error ?
 
Nota :  
- I just want to keep the integer values resulting from the root finding
... 
- (if + r_) leads to en error while the formula works T2_ = T0_ / (1 +
0.5*(gamma_ - 1)*r_(1)^2) ??


Another (stupid) question : 
-  is it possible to perform a root finding with real exponents instead
of integer ones ? if so how ?
- the exponents typically look like [ 0.5*(gamma_ + 1) / (gamma_ - 1) ]:

 
Thanks everybody for (previous and futur) advices
 
Paul
 
######################################################################"
x = poly(0,"x");
p = 1 + coef_1*x + coef_2*x^2 + coef_4*x^4 + coef_6*x^6 ;
r_ = roots(p);

if ( r_(1) < 1) then
    Mach2 = r_(1);
    Mach3 = r_(2);
else
    Mach2 = r_(2);
    Mach3 = r_(1);
end
 
// Before the sonic col
P2_ = P0_ / (1 + 0.2*r_(1)^2)^3.5;
T2_ = T0_ / (1 + 0.5*(gamma_ - 1)*Mach2^2);

// After the sonic col
P3_ = P0_ / (1 + 0.2*r_(2)^2)^3.5;
T3_ = T0_ / (1 + 0.5*(gamma_ - 1)*Mach3^2);

--------------------------------------------------------------------------------


Le présent mail et ses pièces jointes sont confidentiels et destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de votre système. Toute divulgation, copie ou distribution de cet e-mail est strictement interdite.

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please contact the sender and delete the email from your system. If you are not the named addressee you should not disseminate, distribute or copy this email.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110126/e3fcf555/attachment.htm>


More information about the users mailing list