Hello again everyone, I'm actually working on modelling hydraulic systems, and I had to create my own custom simscape block with this code:
It's quite similar to the hydraulic restive pipe in the foundation library, the main difference is that it uses a relation of type: p = K * q^2 .
In order to test the block, I made this simple model:
with a pressure source at 25 bars (as an example). When running the simulation, I have the common error: Initial conditions failed to converged .. Equations (including nonlinear equations) of one or more components may be dependent or inconsistent with almost all of the components being involved. If I replace it with the foundation's hydraulic restive tube, there's not any problem. After trying to understand where the mistake come from, I have noticed (by tinkering the equations) that the fact that the relationship between p and q is not linear ( p = r * q) but quadratic (p = r' * q^2) is the origin of the issue.
Any idea of why ? And if you fave any idea of solution, I'm all opened !
Don't hesitate to ask,
Thanks in advance
Best Answer