# Run only the algebraic part of the solver

**URL:** <https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803>\
**Category:** Modelling & Simulations\
**Tags:** question, ode, modelingtoolkit, dae\
**Created:** [May 7, 2025, 3:04pm UTC](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803 "2025-05-07T15:04:11Z")\
**Posts on this page:** 8\
**Page:** 2

<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:** [May 13, 2025, 4:14am UTC](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803/21 "2025-05-13T04:14:39Z")

</div>

> [@Bart\_van\_de\_Lint](#):
>
> I can try to use the linear system in MPC, and hope for the best.

When you use a model for MPC you do not perform an ordinary open-loop simulation, the controller is free to select the input trajectory during that open-loop simulation in order to optimize the response, if the objective is such that the operating point stays close to the linearization point, you might be fine.

> To close the loop I could try to add a simple PID controller to the system?

Anything that prevents exponential divergence from the linearization point would be at least helpful.

A different but somewhat related topic you might find interesting, [When are two systems similar?](https://juliacontrol.github.io/RobustAndOptimalControl.jl/dev/similarity/#When-are-two-systems-similar?) It’s not immediately applicable in your case since the original system is nonlinear, but it suggests that open-loop and closed-loop comparisons may be very different.

---

<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:** [May 13, 2025, 1:10pm UTC](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803/22 "2025-05-13T13:10:31Z")

</div>

I came to think of this, if you are interested in linearization around a periodic trajectory, you might find

> **[Stabilization of periodic systems · PeriodicSystems.jl](https://andreasvarga.github.io/PeriodicSystems.jl/dev/psstab.html)**
>
> Documentation for PeriodicSystems.jl.

interesting. They allow you to, e.g., compute periodic stabilizing LQ controllers etc. This might be an attractive complement to standard gain scheduling.

---

<div class="post-metadata">

**Author:** ![Bart\_van\_de\_Lint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bart_van_de_lint/32/212161_2.png) [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Post date:** [May 13, 2025, 1:20pm UTC](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803/23 "2025-05-13T13:20:32Z")

</div>

Thanks again for interesting links. Could definitely be useful for kite control.

---

<div class="post-metadata">

**Author:** ![Bart\_van\_de\_Lint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bart_van_de_lint/32/212161_2.png) [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Post date:** [May 18, 2025, 8:52pm UTC](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803/24 "2025-05-18T20:52:16Z")

</div>

When linearizing the model, should this be done around a steady state operating point? Because starting with zero inputs and no deviation from the operating point, the state in the linear model keeps constant.

---

<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:** [May 19, 2025, 8:54am UTC](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803/25 "2025-05-19T08:54:56Z")

</div>

It depends on what you want to use the model for in the end. The output of any linear model is always zero if both the state and the input is zero.

---

<div class="post-metadata">

**Author:** ![Bart\_van\_de\_Lint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bart_van_de_lint/32/212161_2.png) [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Post date:** [May 19, 2025, 9:20am UTC](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803/26 "2025-05-19T09:20:54Z")

</div>

I was able to make a much better comparison now. The linear and nonlinear system have similar responses, but they are not very close either. I added a P controller from heading outputs to steering inputs, and a jump in the setpoint at t=20.

 ![lintest](https://global.discourse-cdn.com/julialang/original/3X/a/5/a50574ca34bda79d769e2deece5b33815c3c1b6e.png)

---

<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:** [May 19, 2025, 1:06pm UTC](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803/27 "2025-05-19T13:06:54Z")

</div>

The fact that the Winch force behaves so different in the beginning is a bit concerning, does the model have any discontinuities that make the linear model very different from the nonlinear?

---

<div class="post-metadata">

**Author:** ![Bart\_van\_de\_Lint](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bart_van_de_lint/32/212161_2.png) [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Post date:** [May 20, 2025, 11:39am UTC](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803/28 "2025-05-20T11:39:55Z")

</div>

There are discontinuities in the nonlinear model (if the springs get compressed), but I don’t expect that to happen in this example. But I can check what happens if I remove the discontinuities.

But I think this difference is mostly because I wasn’t able to get the nonlinear system in a fully steady state.

[Previous page](https://discourse.julialang.org/t/run-only-the-algebraic-part-of-the-solver/128803.md?page=1)
