Biomodèles/Biomodels
SCILAB 3.0 PAS A PAS
SCILAB 3.0 STEP-TO-STEP

Jacques-Deric Rouault

Laboratoire de Neurobiologie de l'Apprentissage, de la Mémoire et de la Communication. CNRS UMR 8620, Bat. 446, Université Paris-Sud, F91400 Orsay

Orscilab
ORSCILAB

16 LES FRACTIONS RATIONNELLES
16 RATIONALS
16.3 Fonctions / Functions
Version 2.1.2 du 4 Février 2005 / Version 2.1.2, February 4th 2005
Biomodèles/Biomodels N°1 pp 0x-0y Décembre 2004 December 2004

Retour à la Table générale / Return to the General table
Index général / General index
Passage à la section suivante 16.4 / Next section 16.4

a
denom (Fraction rationnelle, Rational)
numer (Fraction rationnelle, Rational)
b
simp_mode (Fraction rationnelle, Rational)
c
simp (Fraction rationnelle, Rational)
d
invr (Fraction rationnelle, Rational)
e
horner (Fraction rationnelle, Rational)

Les fonctions denom et numer extraient les polynômes du dénominateur et de numérateur d'une  fraction rationnelle.
The functions denom and numer extract the polynoms of the numerator and the denominator of a rational.

// PROGRAMME SPAS160301 denom numer
p1 = poly ([1, 2, 3], "x","coeff") ;
p2 = poly ([1, 3, 5], "x","coeff") ;
r = p1/p2;
q1 = numer (r),
q2 = denom (r),

Ch16Sc03-Fig01

La simplification des fractions rationnels est controlée par la fonction simp_mode.  A l'état Vrai=True (par défaut), la simplification est automatique après chaque appel à une fonction opérant sur les fractions rationnelles.
The simplification of rationals is controle by the function simp_mode. At the state True (default), the simplification is automatic after each call to a fonctions operating on rationals.

// PROGRAMME SPAS160302 simp_mode
simp_mode (),

Ch16Sc03-Fig02

// PROGRAMME SPAS160303 simp_mode
simp_mode(%T);
b1 = simp_mode (),
p1 = poly ([1, 2, 3], "x","roots") ;
p2 = poly ([1, 3, 5], "x","roots") ;
r1 = p1/p2,
simp_mode(%F);
b2 = simp_mode (),
r2= p1/p2,

Ch16Sc03-Fig03

La fonction simp force la simplification d'une fraction rationnelle si simp_mode est à True/Vrai.
The function simp forces the simplification of a rational if simp_mode is at True..

// PROGRAMME SPAS160304 simp
simp_mode(%F);
b1 = simp_mode (),
p1 = poly ([1, 2, 3], "x","roots") ;
p2 = poly ([1, 3, 5], "x","roots") ;
r1 = p1/p2;
r2 = simp(r1),
simp_mode(%T);
b2 = simp_mode (),
r3 = simp(r1),

Ch16Sc03-Fig04

La fonction invr retourne l'inverse d'une fraction rationnelle.
The function invr returns the inverse of a rational.

// PROGRAMME SPAS160305 invr
p1 = poly ([1, 2, 3], "x","coefs") ;
p2 = poly ([1, 3, 5], "x","coefs") ;
r1 = p1/p2;
r2 = invr (r1),

Ch16Sc03-Fig05

La fonction horner calcule la valeur d'une fraction rationnelle pour une valeur de l'indéterminée.
The function horner computes the value of a rational for a value of the unknown.

// PROGRAMME SPAS160306 horner
p1 = poly ([1, 2, 3], "x","coefs") ;
p2 = poly ([1, 3, 5], "x","coefs") ;
r = p1/p2;
v = horner (r,2),

Ch16Sc03-Fig06

Retour à la Table générale / Return to the General table
Index général / General index
Passage à la section suivante 16.4 / Next section 16.4