If I have a hydraulic system like this:
- $d(t)$ is disturbance in force
- $p(t)$ is the pressure in bar
- $y_1(t)$ is the length in meters
- $y_2(t$ is the other length in meters
Which method should I use to develop an ODE for a hydraulic system?
I have tried diffrent ways but I allways end up in wrong solution. Here is what I have been tried.
- Lagrangian mechanics - How should I apply pressure-energy $p(t)$ and disturbance-energy $d(t)$ ?
- Newtonian mechanics - How should I take regard of pressurefall and non-stiffness(as you see, the system have no spring, which means that the cylinder can go to infinity in theory. There is no limit in this system).
- Analogy with RLC circut - How should a write down a RLC circut of this system? I know that the mass would be the coil(Inductance), the resistor whould be damping and the cacaptitor whould be stiffness
$$L\ddot{y} + R\dot{y} + Cy = 0$$
Is the classic formula from:
$$L\dot{y} + Ry + C\int y = 0$$
So what do you think? Which method should I use? I'm not asking you to solve this for me. I'm only asking for guidance.

Write down the forces acting on each piston and add them up. The net force is what is accelerating your piston. This gives you second-order differential equations, which you then can translate to first-order differential equations and solve.
A few hints: