# Examples for port-Hamiltonian modelling and control of physical systems?

**URL:** <https://discourse.julialang.org/t/examples-for-port-hamiltonian-modelling-and-control-of-physical-systems/103787>\
**Category:** Modelling & Simulations\
**Tags:** question, control, modelingtoolkit\
**Created:** [September 12, 2023, 3:55pm UTC](https://discourse.julialang.org/t/examples-for-port-hamiltonian-modelling-and-control-of-physical-systems/103787 "2023-09-12T15:55:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [September 12, 2023, 3:55pm UTC](https://discourse.julialang.org/t/examples-for-port-hamiltonian-modelling-and-control-of-physical-systems/103787/1 "2023-09-12T15:55:50Z")

</div>

Are there any examples in Julia how to model and control port-Hamiltonian systems?  
See: [https://www.math.rug.nl/arjan/DownloadLectures/Benelux08.pdf](https://www.math.rug.nl/arjan/DownloadLectures/Benelux08.pdf)

Can it be done with ModelingToolkit, or are there better ways?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [September 12, 2023, 5:29pm UTC](https://discourse.julialang.org/t/examples-for-port-hamiltonian-modelling-and-control-of-physical-systems/103787/2 "2023-09-12T17:29:19Z")

</div>

It can be done with ModelingToolkit, and there could be good tooling around it, but I just haven’t done much with Port-Hamiltonians myself and so we don’t have any examples around it. It would be a nice GSoC project though.

---

<div class="post-metadata">

**Author:** ![stephans3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephans3/32/34552_2.png) [@stephans3](https://discourse.julialang.org/u/stephans3)\
**Post date:** [September 14, 2023, 8:54am UTC](https://discourse.julialang.org/t/examples-for-port-hamiltonian-modelling-and-control-of-physical-systems/103787/3 "2023-09-14T08:54:30Z")

</div>

Are you looking for something like this:  
[https://github.com/Algopaul/PortHamiltonianBenchmarkSystems.jl/](https://github.com/Algopaul/PortHamiltonianBenchmarkSystems.jl/)

Or that:  
[https://github.com/flavioluiz/PortHamiltonian.jl/](https://github.com/flavioluiz/PortHamiltonian.jl/)

[http://flavioluiz.github.io/port-hamiltonian/](http://flavioluiz.github.io/port-hamiltonian/)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [September 14, 2023, 5:52pm UTC](https://discourse.julialang.org/t/examples-for-port-hamiltonian-modelling-and-control-of-physical-systems/103787/4 "2023-09-14T17:52:47Z")

</div>

Great! Thanks a lot!
