Macaulay2 » Documentation
Packages » Oscillators :: oscJacobian
next | previous | forward | backward | up | index | toc

oscJacobian -- create the Jacobian for the oscillator system associated to a graph

Description

The matrix is a symmetric $n \times n$ matrix (with determinant zero).

i1 : G = graph({0,1,2,3}, {{0,1},{1,2},{2,3},{0,3}})

o1 = Graph{0 => {1, 3}}
           1 => {0, 2}
           2 => {1, 3}
           3 => {0, 2}

o1 : Graph
i2 : oscRing(G, CoefficientRing => CC)

o2 = CC  [x ..y ]
       53  0   3

o2 : PolynomialRing
i3 : S = oo

o3 = S

o3 : PolynomialRing
i4 : I = oscSystem(G,S)

                                                                            
o4 = ideal (x y  + x y  - x y  - x y , - x y  + x y  + x y  - x y , - x y  +
             1 0    3 0    0 1    0 3     1 0    0 1    2 1    1 2     2 1  
     ------------------------------------------------------------------------
                                                       2    2       2    2  
     x y  + x y  - x y , - x y  - x y  + x y  + x y , x  + y  - 1, x  + y  -
      1 2    3 2    2 3     3 0    3 2    0 3    2 3   0    0       1    1  
     ------------------------------------------------------------------------
         2    2       2    2
     1, x  + y  - 1, x  + y  - 1)
         2    2       3    3

o4 : Ideal of S
i5 : Jac = oscJacobian(G,S)

o5 = | -x_0x_1-x_0x_3-y_0y_1-y_0y_3 x_0x_1+y_0y_1               
     | x_0x_1+y_0y_1                -x_0x_1-x_1x_2-y_0y_1-y_1y_2
     | 0                            x_1x_2+y_1y_2               
     | x_0x_3+y_0y_3                0                           
     ------------------------------------------------------------------------
     0                            x_0x_3+y_0y_3                |
     x_1x_2+y_1y_2                0                            |
     -x_1x_2-x_2x_3-y_1y_2-y_2y_3 x_2x_3+y_2y_3                |
     x_2x_3+y_2y_3                -x_0x_3-x_2x_3-y_0y_3-y_2y_3 |

             4      4
o5 : Matrix S  <-- S
i6 : assert(det Jac == 0)
i7 : assert(Jac - transpose Jac == 0)

We can find the eigenvalues of the Jacobian at approximate points, and see if they are stable (all eigenvalues negative, except for the one required 0), unstable (a positive eigenvalue), or semistable (no positive eigenvalues, up to a certain tolerance).

i8 : realsols = findRealSolutions I
warning: some solutions are not regular: {8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 33, 40, 41, 42, 43, 44}

o8 = {{-1, 1, 1, 1, 0, 0, 0, 0}, {1, 1, -1, 1, 0, 0, 0, 0}, {1, -1, 1, 1, 0,
     ------------------------------------------------------------------------
     0, 0, 0}, {1, 1, 1, -1, 0, 0, 0, 0}, {-1, 1, 1, 1, 0, 0, 0, 0}, {1, 1,
     ------------------------------------------------------------------------
     -1, -1, 0, 0, 0, 0}, {-1, 1, -1, -1, 0, 0, 0, 0}, {1, -1, -1, -1, 0, 0,
     ------------------------------------------------------------------------
     0, 0}, {1, -1, -1, -1, 0, 0, 0, 0}, {-1, -1, -1, 1, 0, 0, 0, 0}, {-1,
     ------------------------------------------------------------------------
     -1, 1, -1, 0, 0, 0, 0}, {-1, 1, -1, -1, 0, 0, 0, 0}, {1, 1, -1, 1, 0, 0,
     ------------------------------------------------------------------------
     0, 0}, {1, 1, 1, -1, 0, 0, 0, 0}, {-1, -1, 1, 1, 0, 0, 0, 0}, {-1, 1,
     ------------------------------------------------------------------------
     -1, -1, 0, 0, 0, 0}, {1, -1, -1, -1, 0, 0, 0, 0}, {-1, -1, 1, -1, 0, 0,
     ------------------------------------------------------------------------
     0, 0}, {-1, 1, 1, 1, 0, 0, 0, 0}, {1, -1, 1, 1, 0, 0, 0, 0}, {-1, 1, 1,
     ------------------------------------------------------------------------
     -1, 0, 0, 0, 0}, {-1, -1, 1, -1, 0, 0, 0, 0}, {-1, -1, -1, 1, 0, 0, 0,
     ------------------------------------------------------------------------
     0}}

o8 : List
i9 : jacs = for pt in realsols list sub(Jac, matrix{pt})

o9 = {| 2  -1 0  -1 |, | -2 1  0  1  |, | 0  -1 0  1  |, | 0  1  0  -1 |, |
      | -1 0  1  0  |  | 1  0  -1 0  |  | -1 2  -1 0  |  | 1  -2 1  0  |  |
      | 0  1  -2 1  |  | 0  -1 2  -1 |  | 0  -1 0  1  |  | 0  1  0  -1 |  |
      | -1 0  1  0  |  | 1  0  -1 0  |  | 1  0  1  -2 |  | -1 0  -1 2  |  |
     ------------------------------------------------------------------------
     2  -1 0  -1 |, | 0  1  0  -1 |, | 0  -1 0  1  |, | 2  -1 0  -1 |, | 2 
     -1 0  1  0  |  | 1  0  -1 0  |  | -1 2  -1 0  |  | -1 0  1  0  |  | -1
     0  1  -2 1  |  | 0  -1 0  1  |  | 0  -1 0  1  |  | 0  1  -2 1  |  | 0 
     -1 0  1  0  |  | -1 0  1  0  |  | 1  0  1  -2 |  | -1 0  1  0  |  | -1
     ------------------------------------------------------------------------
     -1 0  -1 |, | 0  1  0  -1 |, | -2 1  0  1  |, | 0  -1 0  1  |, | -2 1 
     0  1  0  |  | 1  -2 1  0  |  | 1  0  -1 0  |  | -1 2  -1 0  |  | 1  0 
     1  -2 1  |  | 0  1  0  -1 |  | 0  -1 2  -1 |  | 0  -1 0  1  |  | 0  -1
     0  1  0  |  | -1 0  -1 2  |  | 1  0  -1 0  |  | 1  0  1  -2 |  | 1  0 
     ------------------------------------------------------------------------
     0  1  |, | 0  1  0  -1 |, | 0  1  0  -1 |, | 0  -1 0  1  |, | 2  -1 0 
     -1 0  |  | 1  -2 1  0  |  | 1  0  -1 0  |  | -1 2  -1 0  |  | -1 0  1 
     2  -1 |  | 0  1  0  -1 |  | 0  -1 0  1  |  | 0  -1 0  1  |  | 0  1  -2
     -1 0  |  | -1 0  -1 2  |  | -1 0  1  0  |  | 1  0  1  -2 |  | -1 0  1 
     ------------------------------------------------------------------------
     -1 |, | -2 1  0  1  |, | 2  -1 0  -1 |, | 0  -1 0  1  |, | 0  -1 0  1 
     0  |  | 1  0  -1 0  |  | -1 0  1  0  |  | -1 2  -1 0  |  | -1 0  1  0 
     1  |  | 0  -1 2  -1 |  | 0  1  -2 1  |  | 0  -1 0  1  |  | 0  1  0  -1
     0  |  | 1  0  -1 0  |  | -1 0  1  0  |  | 1  0  1  -2 |  | 1  0  -1 0 
     ------------------------------------------------------------------------
     |, | -2 1  0  1  |, | 0  1  0  -1 |}
     |  | 1  0  -1 0  |  | 1  -2 1  0  |
     |  | 0  -1 2  -1 |  | 0  1  0  -1 |
     |  | 1  0  -1 0  |  | -1 0  -1 2  |

o9 : List
i10 : jacs/eigenvalues

o10 = {{2.82843     }, {-2.82843    }, {2.82843     }, {-2.82843    },
       {-1.64374e-16}  {1.64374e-16 }  {-2.82843    }  {2.82843     } 
       {-2.82843    }  {2.82843     }  {-1.11022e-16}  {1.11022e-16 } 
       {6.16298e-33 }  {-6.16298e-33}  {5.03205e-33 }  {-5.03205e-33} 
      -----------------------------------------------------------------------
      {2.82843     }, {2          }, {-2.82843   }, {2.82843     },
      {-4.20713e-16}  {-6.4281e-17}  {3.93452e-16}  {-4.20713e-16} 
      {-2.82843    }  {-2         }  {2.82843    }  {-2.82843    } 
      {0           }  {0          }  {0          }  {0           } 
      -----------------------------------------------------------------------
      {2.82843     }, {-2.82843    }, {-2.82843    }, {2.82843     },
      {-1.64374e-16}  {2.82843     }  {1.64374e-16 }  {-2.82843    } 
      {-2.82843    }  {1.11022e-16 }  {2.82843     }  {-1.11022e-16} 
      {6.16298e-33 }  {-5.03205e-33}  {-6.16298e-33}  {5.03205e-33 } 
      -----------------------------------------------------------------------
      {-2.82843    }, {2.82843     }, {2          }, {-2.82843   },
      {-3.11445e-17}  {-2.82843    }  {-6.4281e-17}  {2.82843    } 
      {2.82843     }  {-3.92523e-17}  {-2         }  {3.92523e-17} 
      {-2.46519e-32}  {0           }  {0          }  {0          } 
      -----------------------------------------------------------------------
      {2.82843    }, {-2.82843   }, {2.82843    }, {-2.82843   },
      {3.11445e-17}  {4.20713e-16}  {3.11445e-17}  {2.82843    } 
      {-2.82843   }  {2.82843    }  {-2.82843   }  {3.92523e-17} 
      {2.46519e-32}  {0          }  {2.46519e-32}  {0          } 
      -----------------------------------------------------------------------
      {2          }, {-2.82843    }, {2.82843     }}
      {-6.4281e-17}  {-3.11445e-17}  {-2.82843    }
      {-2         }  {2.82843     }  {-3.92523e-17}
      {0          }  {-2.46519e-32}  {0           }

o10 : List
i11 : jacs/eigenvalues/identifyStability

o11 = {Unstable, Unstable, Unstable, Unstable, Unstable, Unstable, Unstable,
      -----------------------------------------------------------------------
      Unstable, Unstable, Unstable, Unstable, Unstable, Unstable, Unstable,
      -----------------------------------------------------------------------
      Unstable, Unstable, Unstable, Unstable, Unstable, Unstable, Unstable,
      -----------------------------------------------------------------------
      Unstable, Unstable}

o11 : List

See also

Ways to use oscJacobian:

  • oscJacobian(Graph)
  • oscJacobian(Graph,Ring)
  • oscJacobian(Ideal)

For the programmer

The object oscJacobian is a method function with options.


The source of this document is in Oscillators/Documentation.m2:318:0.