recourse identification

Upload: aaron-fulton

Post on 14-Apr-2018

241 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 recourse Identification

    1/9

    h = m i n ( h m a x , 0 . 8 * h * ( t a u / d e l t a ) ^ p o w )

    e n d

    e n d

    i f ( t < t f i n a l )

    d i s p ( ' S i n g u l a r i t y l i k e l y a t t = ' n u m 2 s t r ( t ) ] )

    e n d

    R e f e r e n c e s

    1 ] T . G l a d .

    O v n i n g s e x e m p e l i R e g l e r t e o r i . T e c h n i c a l r e p o r t , D e p t . o f E l e c t r i c a l E n g i n e e r i n g ,

    L i n k o p i n g U n i v e r s i t y , S - 5 8 1 8 3 L i n k o p i n g , S w e d e n , J u n e 1 9 8 9 .

    2 ] J . G u c k e n h e i m e r a n d P . H o l m e s . N o n l i n e a r O s c i l l a t i o n s , D y n a m i c a l S y s t e m s , a n d B i -

    f u r c a t i o n o f V e c t o r F i e l d s , v o l u m e 4 2 o f A p p l i e d M a t h e m a t i c a l S c i e n c e s . S p r i n g e r , 1 9 8 3 .

    3 ] E . H a i r e r , S . P . N r s e t t , a n d G . W a n n e r . S o l v i n g O r d i n a r y D i e r e n t i a l E q u a t i o n s I .

    N o n s t i P r o b l e m s , v o l u m e 8 o f C o m p u t a t i o n a l M a t h e m a t i c s . S p r i n g e r , 1 9 8 7 .

    4 ] T h e M a t h W o r k s I n c . P R O - M A T L A B U s e r ' s G u i d e , J a n u a r y 1 9 9 0 .

    5 ] J . M . T . T h o m p s o n a n d H . B . S t e w a r t . N o n l i n e a r D y n a m i c s a n d C h a o s . W i l e y , 1 9 8 6 .

    6 ] F . V e r h u l s t . N o n l i n e a r D i e r e n t i a l E q u a t i o n s a n d D y n a m i c a l S y s t e m s . U n i v e r s i t e x t .

    S p r i n g e r , 1 9 9 0 .

    7 ] S . W i g g i n s . I n t r o d u c t i o n t o A p p l i e d N o n l i n e a r D y n a m i c a l S y s t e m s a n d C h a o s , v o l u m e 2

    o f T e x t s i n A p p l i e d M a t h e m a t i c s . S p r i n g e r , 1 9 9 0 .

    9

  • 7/27/2019 recourse Identification

    2/9

    % I n i t i a l i z a t i o n

    t = t 0

    h m a x = ( t f i n a l - t ) / 5

    h m i n = ( t f i n a l - t ) / 2 0 0 0 0

    h = ( t f i n a l - t ) / 1 0 0

    y = y 0 ( : )

    f = y * z e r o s ( 1 , 6 )

    t o u t = t

    y o u t = y . '

    t a u = t o l * m a x ( n o r m ( y , ' i n f ' ) , 1 )

    i f t r a c e

    c l c , t , h , y

    e n d

    % T h e m a i n l o o p

    w h i l e ( t < t f i n a l ) & ( h > = h m i n )

    i f t + h > t f i n a l , h = t f i n a l - t e n d

    % C o m p u t e t h e s l o p e s

    t e m p = - f e v a l ( F u n F c n , t , y )

    % A d d e d a m i n u s s i g n b e f o r e " f e v a l " i n t h e o d e 4 5 c o d e . K . F o r s m a n

    f ( : , 1 ) = t e m p ( : )

    f o r j = 1 : 5

    t e m p = - f e v a l ( F u n F c n , t + a l p h a ( j ) * h , y + h * f * b e t a ( : , j ) )

    % A d d e d a m i n u s s i g n b e f o r e " f e v a l " i n t h e o d e 4 5 c o d e . K . F o r s m a n

    f ( : , j + 1 ) = t e m p ( : )

    e n d

    % E s t i m a t e t h e e r r o r a n d t h e a c c e p t a b l e e r r o r

    d e l t a = n o r m ( h * f * g a m m a ( : , 2 ) , ' i n f ' )

    t a u = t o l * m a x ( n o r m ( y , ' i n f ' ) , 1 . 0 )

    % U p d a t e t h e s o l u t i o n o n l y i f t h e e r r o r i s a c c e p t a b l e

    i f d e l t a < = t a u

    t = t + h

    y = y + h * f * g a m m a ( : , 1 )

    t o u t = t o u t t ]

    y o u t = y o u t y . ' ]

    e n d

    i f t r a c e

    h o m e , t , h , y

    e n d

    % U p d a t e t h e s t e p s i z e

    i f d e l t a ~ = 0 . 0

    8

  • 7/27/2019 recourse Identification

    3/9

    y f l a g 1 = b > a x ( 3 ) y f l a g 2 = b < a x ( 4 )

    y f l a g = y f l a g 1 & y f l a g 2

    f f l a g = 1

    w h i l e x f l a g | y f l a g ,

    i f ~ x f l a g , T = i n p u t ( ' N e w v a l u e o f T : ' ) e n d

    i f x f l a g ,

    i f y f l a g , x 1 0 = a x 2 0 = b f f l a g = m = = 1

    e l s e i f ~ y f l a g 2 , n = l e n g t h ( x ( : , 1 ) )

    x 1 0 = x ( n , 1 ) x 2 0 = x ( n , 2 )

    e l s e i f ~ y f l a g 1 , f f l a g = ~ f f l a g e n d

    i f f f l a g , t , x ] = o d e 4 5 ( F , 0 , T , x 1 0 x 2 0 ] , t o l )

    e l s e

    t , x ] = f e v a l ( ' o d e 4 5 b w ' , F , 0 , T , x 1 0 x 2 0 ] , t o l ) e n d

    p l o t ( x ( : , 1 ) , x ( : , 2 ) )

    e n d

    a , b , m ] = g i n p u t ( 1 )

    x f l a g = ( a > a x ( 1 ) ) & ( a < a x ( 2 ) )

    y f l a g 1 = b > a x ( 3 ) y f l a g 2 = b < a x ( 4 )

    y f l a g = y f l a g 1 & y f l a g 2

    e n d

    h o l d o f f

    f u n c t i o n t o u t , y o u t ] = o d e 4 5 b w ( F u n F c n , t 0 , t f i n a l , y 0 , t o l , t r a c e )

    % O D E 4 5 B W t o u t , y o u t ] = o d e 4 5 b w ( F u n F c n , t 0 , t f i n a l , y 0 , t o l , t r a c e )

    %

    % A s O D E 4 5 b u t i n t e g r a t e s b a c k w a r d s .

    % T r i v i a l m o d i f i c a t i o n b y K . F o r s m a n .

    % C . B . M o l e r , 3 - 2 5 - 8 7 .

    % C o p y r i g h t ( c ) 1 9 8 7 b y t h e M a t h W o r k s , I n c .

    % A l l r i g h t s r e s e r v e d .

    % T h e F e h l b e r g c o e f f i c i e n t s :

    a l p h a = 1 / 4 3 / 8 1 2 / 1 3 1 1 / 2 ] '

    b e t a = 1 0 0 0 0 0 ] / 4

    3 9 0 0 0 0 ] / 3 2

    1 9 3 2 - 7 2 0 0 7 2 9 6 0 0 0 ] / 2 1 9 7

    8 3 4 1 - 3 2 8 3 2 2 9 4 4 0 - 8 4 5 0 0 ] / 4 1 0 4

    - 6 0 8 0 4 1 0 4 0 - 2 8 3 5 2 9 2 9 5 - 5 6 4 3 0 ] / 2 0 5 2 0 ] '

    g a m m a = 9 0 2 8 8 0 0 3 9 5 3 6 6 4 3 8 5 5 7 3 5 - 1 3 7 1 2 4 9 2 7 7 0 2 0 ] / 7 6 1 8 0 5 0

    - 2 0 9 0 0 2 2 5 2 8 2 1 9 7 0 - 1 5 0 4 8 - 2 7 3 6 0 ] / 7 5 2 4 0 0 ] '

    p o w = 1 / 5

    i f n a r g i n < 6 , t r a c e = 0 e n d

    i f n a r g i n < 5 , t o l = 1 . e - 6 e n d

    7

  • 7/27/2019 recourse Identification

    4/9

    T h e m - l e s a r e u n d e r t h e d i r e c t o r y ~ / p u b / s r c / m a t l a b / . T h i s r e p o r t i s a v a i l a b l e a s a

    c o m p r e s s e d p s - l e n a m e d ~ / p u b / r e p o r t s / L i T H - I S Y - I - 1 3 2 9 . p s . Z

    F o r p e o p l e a t t h e c o n t r o l g r o u p i n L i n k o p i n g t h e t w o m - l e s a r e u n d e r t h e d i r e c t o r y

    / u s r / l o c a l / m a t l a b / l o c a l /

    f u n c t i o n g o d e ( F , a x , T , t o l )

    % G O D E g o d e ( F , a x , T , t o l )

    %

    % G r a p h i c a l ' i n t e r f a c e ' t o o d e 4 5 f o r t w o - d i m e n s i o n a l e q u a t i o n s .

    % C l i c k t h e m o u s e o n i n i t i a l v a l u e w i s h e d f o r .

    %

    % A l l o w s f o r s i m u l a t i o n s b o t h i n f o r w a r d a n d b a c k w a r d t i m e :

    % F o r w a r d t i m e - l e f t b u t t o n , b a c k w a r d t i m e - m i d d l e b u t t o n

    %

    % C l i c k i n g t h e m o u s e o u t s i d e t h e s p e c i f i e d y - a x i s i n t e r v a l

    % b u t i n s i d e t h e x - a x i s i n t e r v a l m e a n s e i t h e r

    % 1 ) " u s e t h e p r e v i o u s i n i t i a l v a l u e a n d t o g g l e t i m e d i r e c t i o n "

    % ( c l i c k b e l o w t h e y - i n t e r v a l )

    % o r

    % 2 ) " u s e t h e p r e v i o u s f i n a l v a l u e a s n e w i n i t i a l v a l u e ( s a m e t i m e

    % d i r e c t i o n ) "

    % ( c l i c k a b o v e t h e y - i n t e r v a l )

    %

    % C l i c k i n g o u t s i d e t h e x - a x i s i n t e r v a l p r o m p t s f o r a n e w

    % v a l u e o f T a n d t h e n p r o c e e d s .

    %

    % F = n a m e o f m - f i l e d e s c r i b i n g t h e D E ( s e e O D E 4 5 )

    % a x = a x i s - v e c t o r

    % I f a x i s a s c a l a r t h e a x e s w i l l b e - a x a x - a x a x ]

    % T = l e n g t h o f e a c h s i m u l a t i o n ( d e f a u l t : 5 )

    % t o l = t o l e r a n c e ( d e f a u l t : 1 e - 6 )

    %

    % S t o p b y c l i c k i n g t h e m o u s e o u t s i d e b o t h t h e y - a n d x - a x i s i n t e r v a l .

    % K . F o r s m a n 1 9 9 1 - 0 4 - 0 3

    i f n a r g i n < 4 , t o l = 1 e - 6 e n d

    i f n a r g i n = = 2 , T = 5 e n d

    i f l e n g t h ( a x ) = = 1 , a x = - a x a x - a x a x ] e n d

    i f l e n g t h ( a x ) ~ = 4 , e r r o r ( ' I n v a l i d a x i s c h o i c e . ' ) e n d

    h o l d o f f

    a x i s ( a x )

    p l o t ( a x ( 1 ) , a x ( 3 ) ) % F o r a w i n d o w t o a p p e a r

    h o l d o n

    a , b , m ] = g i n p u t ( 1 )

    x f l a g = ( a > a x ( 1 ) ) & ( a < a x ( 2 ) )

    6

  • 7/27/2019 recourse Identification

    5/9

    -5

    -4

    -3

    -2

    -1

    0

    1

    2

    3

    4

    5

    -4 -2 0 2 4

    F i g u r e 3 : P h a s e p l a n e f o r t h e v a n d e r P o l e q u a t i o n .

    E x a m p l e 3 . 3 T h e f a m o u s v a n d e r P o l e q u a t i o n ( s e e e . g . 2 , 5 , 6 , 7 ] ) i s

    y ; a ( 1 ; y

    2

    ) y + y = 0 ( 4 )

    T h e m - l e d e f v d p d e n e s t h i s e q u a t i o n i n n o r m a l f o r m ( c a l l e d s t a t e s p a c e f o r m i n c o n t r o l

    t h e o r y ) . I n t h e s i m u l a t i o n a w a s c h o s e n e q u a l t o 1 .

    f u n c t i o n x p r i m e = d e f v d p ( t , x )

    a = 1

    x p r i m e ( 1 ) = x ( 2 )

    x p r i m e ( 2 ) = a * ( 1 - x ( 1 ) * x ( 1 ) ) * x ( 2 ) - x ( 1 )

    x p r i m e = x p r i m e '

    T h e c o m m a n d g o d e ( ' d e f v d p ' , 5 ) w a s u s e d t o p l o t t h e p h a s e p l a n e i n g u r e 3 . 2

    4 T h e M - l e s : a v a i l a b i l i t y a n d l i s t i n g

    H e r e f o l l o w s a c o m p l e t e l i s t i n g o f t h e t w o m - l e s i n v o l v e d : g o d e . m a n d o d e 4 5 b w . m . T h e

    l a t t e r i s a t r i v i a l m o d i c a t i o n o f t h e o r i g i n a l f u n c t i o n o d e 4 5 w h i c h i s c a l l e d f r o m w i t h i n

    g o d e . T h e l e o d e 4 5 b w . m h a s t o b e i n y o u r s e a r c h p a t h i f y o u w a n t t o b e a b l e t o s i m u l a t e

    b a c k w a r d s i n t i m e u s i n g g o d e

    T h e t w o l e s a r e a v a i l a b l e b y a n o n y m o u s f t p o n t h e a d d r e s s

    1 3 0 . 2 3 6 . 2 4 . 1 ( j o a k i m . i s y . l i u . s e )

    5

  • 7/27/2019 recourse Identification

    6/9

    -2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    -2 -1.5 -1 -0.5 0 0.5 1 1.5 2

    F i g u r e 1 : P h a s e p l a n e f o r t h e d i e r e n t i a l e q u a t i o n ( 2 ) .

    -2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    -3 -2 -1 0 1 2 3

    F i g u r e 2 : P h a s e p l a n e f o r t h e d i e r e n t i a l e q u a t i o n ( 3 ) .

    4

  • 7/27/2019 recourse Identification

    7/9

    3 E x a m p l e s

    I n t h i s s e c t i o n I g i v e s o m e e x a m p l e s o f h o w t o u s e g o d e

    E x a m p l e 3 . 1 T h e f o l l o w i n g s e s s i o n p r o d u c e d t h e p l o t d i s p l a y e d i n g u r e 1 .

    > > a x i s ( ' s q u a r e ' )

    > > g o d e ( ' d e f 1 1 _ 1 ' , - 2 2 - 2 2 ] )

    S i n g u l a r i t y l i k e l y a t t = 1 . 7 1 7

    S i n g u l a r i t y l i k e l y a t t = 2 . 8 0 5

    > >

    H e r e , t h e l e d e f 1 1 _ 1 c o n t a i n s t h e f o l l o w i n g c o d e :

    f u n c t i o n x p r i m e = d e f 1 1 _ 1 ( t , x )

    x p r i m e ( 1 ) = x ( 2 )

    x p r i m e ( 2 ) = ( 0 . 1 - 1 0 * x ( 2 ) * x ( 2 ) / 3 ) * x ( 2 ) - x ( 1 ) - x ( 1 ) * x ( 1 )

    x p r i m e = x p r i m e '

    w h i c h c o r r e s p o n d s t o t h e d i e r e n t i a l e q u a t i o n

    y ; ( 0 1 ; 1 0 y

    2

    = 3 ) y + y + y

    2

    = 0 ( 2 )

    T h i s e x a m p l e i s e x e r c i s e 1 1 . 1 i n 1 ] . 2

    E x a m p l e 3 . 2 T h e c o m m a n d > > g o d e ( ' d e f 3 _ 3 ' , - 3 3 - 2 2 ] ) s i m u l a t e s t h e d i e r e n -

    t i a l e q u a t i o n d e n e d b y t h e l e d e f 3 _ 3

    f u n c t i o n x p r i m e = d e f 3 _ 3 ( t , x )

    x p r i m e ( 1 ) = - x ( 1 ) + x ( 2 ) * x ( 2 )

    x p r i m e ( 2 ) = - x ( 2 ) * x ( 2 ) * x ( 2 ) + x ( 1 ) * x ( 1 )

    x p r i m e = x p r i m e '

    T h a t i s

    x = ; x + y

    2

    y = ; y

    3

    + x

    2

    ( 3 )

    T h i s e x a m p l e i s i d e n t i c a l w i t h e x a m p l e 3 . 3 i n V e r h u l s t 6 ] , w h i c h i s , i n c i d e n t a l l y , m i s p r i n t e d

    i n t h e b o o k .

    C l o s e t o t h e o r i g i n , t h e s i m u l a t i o n t i m e T h a s t o b e l a r g e r t h a n 5 . S e e g u r e 2 . 2

    3

  • 7/27/2019 recourse Identification

    8/9

    w h i c h c o r r e s p o n d s t o t h e s y s t e m

    x

    1

    x

    2

    =

    x

    2

    ; x

    2

    2

    ; x

    1

    ( 1 )

    I f n = 2 a b o v e , a n u m e r i c a l s o l u t i o n m a y b e p l o t t e d i n p h a s e s p a c e . P h a s e p l a n e a n a l y s i s

    i s a n i m p o r t a n t t o o l i n t h e s t u d y o f n o n l i n e a r O D E : s , a n d a l m o s t a l l t e x t b o o k s d e v o t e l a r g e

    s e c t i o n s t o i t 2 , 6 , 7 ] .

    T h i s r e p o r t d e s c r i b e s a s i m p l e f u n c t i o n t h a t a l l o w s t h e u s e r t o o p e r a t e o d e 4 5 g r a p h i c a l l y

    f o r s e c o n d o r d e r O D E : s . A f t e r t h e u s e r h a s c h o s e n t h e i n i t i a l v a l u e f o r a g r a p h i c a l l y b y

    c l i c k i n g w i t h t h e m o u s e , t h e e q u a t i o n i n q u e s t i o n i s s i m u l a t e d f o r a c e r t a i n t i m e i n t e r v a l

    a n d t h e s o l u t i o n i s p l o t t e d . T h e f u n c t i o n i s c a l l e d g o d e ( g r a p h i c a l O D E - s o l v e r ) .

    2 T h e G r a p h i c a l I n t e r f a c e

    T h e f u n c t i o n g o d e i s a \ g r a p h i c a l i n t e r f a c e " t o o d e . I t i s i n t e n d e d t o b e a t o o l f o r i n t e r -

    a c t i v e l y c o n s t r u c t i n g p h a s e p l a n e s i n a s i m p l e m a n n e r . H e r e f o l l o w s a d e s c r i p t i o n o f t h e

    f u n c t i o n :

    S y n t a x : g o d e ( F , a x , T , t o l )

    I n p u t a r g u m e n t s :

    F n a m e o f m - l e d e s c r i b i n g t h e D E

    a x a x i s - v e c t o r ( I f a x i s a s c a l a r t h e a x e s w i l l b e - a x a x - a x a x ] )

    T l e n g t h o f e a c h s i m u l a t i o n ( d e f a u l t : 5 )

    t o l t o l e r a n c e ( d e f a u l t : 1 e - 6 )

    g o d e s t a r t s b y d i s p l a y i n g a n e m p t y p l a n e a s s p e c i e d b y t h e a r g u m e n t a x . I t w a i t s f o r

    t h e u s e r t o c l i c k t h e m o u s e o n a p o i n t i n t h e p h a s e p l a n e - t h e g i v e n p o i n t w i l l b e t a k e n a s

    t h e i n t i a l v a l u e i n t h e s i m u l a t i o n .

    g o d e s u p p o r t s b o t h f o r w a r d a n d b a c k w a r d t i m e s i m u l a t i o n s : f o r w a r d t i m e - u s e l e f t

    b u t t o n , b a c k w a r d t i m e - u s e m i d d l e b u t t o n

    C l i c k i n g t h e m o u s e o u t s i d e t h e s p e c i e d y - a x i s i n t e r v a l b u t i n s i d e t h e x - a x i s i n t e r v a l

    m e a n s e i t h e r

    1 . " u s e t h e p r e v i o u s i n i t i a l v a l u e a n d t o g g l e t i m e d i r e c t i o n " ( c l i c k b e l o w t h e y - i n t e r v a l ) o r

    2 . " u s e t h e p r e v i o u s n a l v a l u e a s n e w i n i t i a l v a l u e ( s a m e t i m e d i r e c t i o n ) " ( c l i c k a b o v e

    t h e y - i n t e r v a l )

    C l i c k i n g o u t s i d e t h e x - a x i s i n t e r v a l p r o m p t s f o r a n e w v a l u e o f T a n d t h e n p r o c e e d s .

    S t o p b y c l i c k i n g t h e m o u s e o u t s i d e b o t h t h e y - a n d x - a x i s i n t e r v a l .

    g o d e g i v e s n o o u t p u t ( o t h e r t h a n t h e p l o t s ) .

    T h e a d v a n t a g e w i t h b o t h f o r w a r d a n d b a c k w a r d t i m e s i m u l a t i o n i s t h a t t h e u s e r m a y

    c h o o s e a n a r b i t r a r y p o i n t i n p h a s e s p a c e a n d t h e n p l o t t h e t r a j e c t o r y p a s s i n g t h r o u g h t h a t

    p o i n t , i n s t e a d o f j u s t t h e t r a j e c t o r y e m a n a t i n g f r o m t h e p o i n t .

    2

  • 7/27/2019 recourse Identification

    9/9

    A M A T L A B F u n c t i o n f o r P l o t t i n g P h a s e P l a n e s

    I n t e r a c t i v e l y

    K r i s t e r F o r s m a n , D e p t . o f E l e c t r i c a l E n g i n e e r i n g

    L i n k o p i n g U n i v e r s i t y , S - 5 8 1 8 3 L i n k o p i n g , S w e d e n

    E m a i l : k r i s t e r @ i s y . l i u . s e

    1 9 9 2 - 0 2 - 1 3

    A b s t r a c t

    A M A T L A B - f u n c t i o n s e r v i n g a s a s o r t o f g r a p h i c a l i n t e r f a c e t o t h e M A T L A B O D E - s o l v e r o d e 4 5

    i s p r e s e n t e d . T h e m a i n u s e o f i t i s t o f a c i l i t a t e p h a s e p l a n e a n a l y s i s o f n o n l i n e a r 2 - D s y s t e m s v i a

    s i m u l a t i o n . T h e n u m e r i c a l i n t e g r a t i o n o f t h e s y s t e m i s m o u s e - o p e r a t e d v i a t h e g i n p u t - f u n c t i o n .

    A f t e r e a c h c h o i c e o f i n i t i a l v a l u e a s i m u l a t i o n i s m a d e a n d p l o t t e d i n t h e p h a s e p l a n e .

    1 T h e O D E - s o l v e r s i n M A T L A B

    C o n s i d e r t h e n o n l i n e a r d i e r e n t i a l e q u a t i o n

    x = f ( t x ) x ( 0 ) = x

    0

    w h e r e x 2 I R

    n

    a n d f I R

    n + 1

    ! I R

    n

    . M A T L A B 4 ] v e r s i o n 3 . 5 i p r o v i d e s t w o n u m e r i c a l

    O D E s o l v e r s f o r s u c h n o n l i n e a r s y s t e m s : o d e 2 3 a n d o d e 4 5 . B o t h u s e R u n g e - K u t t a f o r m u l a s

    o f d i e r e n t o r d e r . F o r a c o m p r e h e n s i v e a c c o u n t o f n u m e r i c a l m e t h o d s f o r s o l v i n g O D E : s ,

    c o n s u l t H a i r e r e t a l . 3 ] . T h e s y n t a x o f o d e 2 3 a n d o d e 4 5 i s , s o m e w h a t s i m p l i e d ,

    t , x ] = o d e 4 5 ( ' x p r i m e ' , t 0 , t f , x 0 )

    w h e r e x p r i m e i s a n m - l e c o n t a i n i n g t h e r i g h t h a n d s i d e o f t h e d i e r e n t i a l e q u a t i o n , t 0 t h e

    i n i t i a l t i m e , t f t h e n a l t i m e a n d x 0 t h e i n i t i a l v a l u e . A n e x a m p l e o f a x p r i m e m - l e i s :

    f u n c t i o n x p r i m e = e x 1 ( t , x )

    x p r i m e ( 1 ) = x ( 2 )

    x p r i m e ( 2 ) = - x ( 2 ) ^ 2 - x ( 1 )

    x p r i m e = x p r i m e '

    1