# How to use Lyapunov function in Julia

**URL:** <https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195>\
**Category:** General Usage\
**Created:** [June 10, 2017, 6:24am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195 "2017-06-10T06:24:26Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashim-haque](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ashim-haque](https://discourse.julialang.org/u/ashim-haque)\
**Post date:** [June 10, 2017, 6:24am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/1 "2017-06-10T06:24:26Z")

</div>

Please can anyone guide me how to use the Lyapunov function in julia?

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [June 10, 2017, 6:24am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/2 "2017-06-10T06:24:59Z")

</div>

Which Lyapunov function are you referring to?

---

<div class="post-metadata">

**Author:** ![ashim-haque](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ashim-haque](https://discourse.julialang.org/u/ashim-haque)\
**Post date:** [June 10, 2017, 7:00am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/3 "2017-06-10T07:00:15Z")

</div>

Thank you so much for your quick response. The community is strong here.  
The one that we use in Matlab as

`>>lyap(a)`

where, ‘a’ variable is a matrix.

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [June 10, 2017, 7:35am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/4 "2017-06-10T07:35:11Z")

</div>

Are you talking about

```julia
help?> lyap
search: lyap polygamma displayable

  lyap(A, C)

  Computes the solution X to the continuous Lyapunov equation AX + XA' + C =
  0, where no eigenvalue of A has a zero real part and no two eigenvalues are
  negative complex conjugates of each other.

```

?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [June 10, 2017, 7:36am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/5 "2017-06-10T07:36:09Z")

</div>

There is no single-argument version in the [Matlab documentation](https://www.mathworks.com/help/control/ref/lyap.html), so it is hard to guess what you need. Also, note that Lyapunov functions and Lyapunov equations are different concepts.

The community is indeed strong here, but putting some effort into asking questions also helps.

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [June 10, 2017, 12:46pm UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/6 "2017-06-10T12:46:35Z")

</div>

There is a discussion here:  
[https://github.com/JuliaLang/julia/issues/5814](https://github.com/JuliaLang/julia/issues/5814)

I found this using Google, having never heard of the Lyapunov function in this context. (There are other things called Lyapunov functions and it would have been useful for you to actually explain what you needed.) Did you actually try Google?

---

<div class="post-metadata">

**Author:** ![ashim-haque](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ashim-haque](https://discourse.julialang.org/u/ashim-haque)\
**Post date:** [June 11, 2017, 7:25am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/7 "2017-06-11T07:25:59Z")

</div>

I have been using julia for 03 days only. I don’t understand many many things. Google was not helpful. I need to learn from experienced julia programmers like you. I also believe that, communicating with people in the community helps you learn and in the process you make good friends.

---

<div class="post-metadata">

**Author:** ![ashim-haque](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ashim-haque](https://discourse.julialang.org/u/ashim-haque)\
**Post date:** [June 11, 2017, 7:37am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/8 "2017-06-11T07:37:22Z")

</div>

Actually I am really really new to julia. And I am new to coding as well. I am sorry brother. I will try harder next time.

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [June 11, 2017, 11:28am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/9 "2017-06-11T11:28:04Z")

</div>

Welcome to Julia! Do feel free to ask any questions you have. You will get a better response if your questions are as specific as possible.

---

<div class="post-metadata">

**Author:** ![ashim-haque](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ashim-haque](https://discourse.julialang.org/u/ashim-haque)\
**Post date:** [July 4, 2017, 7:53am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/10 "2017-07-04T07:53:25Z")

</div>

Thank you so much. I would ask you for another help, if you don’t mind. Since, I am new to programming and julia as well can you please guide me to a group or web page where I can learn by solving some exercise and examples. Like a step by step learning group or a community? Thank you again.

---

<div class="post-metadata">

**Author:** ![KajWiik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kajwiik/32/199_2.png) [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Post date:** [July 4, 2017, 8:23am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/11 "2017-07-04T08:23:30Z")

</div>

I have been reading this wikibook:  
[https://en.m.wikibooks.org/wiki/Introducing\_Julia](https://en.m.wikibooks.org/wiki/Introducing_Julia)

Of course, the documentation is also very good:  
[https://docs.julialang.org/en/latest/](https://docs.julialang.org/en/latest/)

Welcome!

---

<div class="post-metadata">

**Author:** ![ashim-haque](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@ashim-haque](https://discourse.julialang.org/u/ashim-haque)\
**Post date:** [July 20, 2017, 6:48am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/12 "2017-07-20T06:48:51Z")

</div>

Thank you so much. I will study these two books. Then lets see how far I can get.  
Thank you again for your support and advise.  
Regards,  
Hasib

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [July 20, 2017, 7:46am UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/13 "2017-07-20T07:46:41Z")

</div>

If you’re looking for utilities to analyze control systems, the package [ControlSystems.jl](https://github.com/JuliaControl/ControlSystems.jl) provides Lyapunov functions for discrete and continuous control systems.  
[dlyap](https://github.com/JuliaControl/ControlSystems.jl/blob/d3faf79dd261e8a51710d6966134ff0f0f1497cb/src/matrix_comps.jl#L66) [covar](https://github.com/JuliaControl/ControlSystems.jl/blob/d3faf79dd261e8a51710d6966134ff0f0f1497cb/src/matrix_comps.jl#L151)

---

<div class="post-metadata">

**Author:** ![ignace](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ignace/32/24275_2.png) [@ignace](https://discourse.julialang.org/u/ignace)\
**Post date:** [September 3, 2021, 12:23pm UTC](https://discourse.julialang.org/t/how-to-use-lyapunov-function-in-julia/4195/14 "2021-09-03T12:23:30Z")

</div>

I don’t know whether this may be helpful: `lyap` is part of the `LinearAlgebra` package.
