液压系统
flowRate1B = (Subscript[p, 1][t] - Subscript[p, B][t])((π Subscript[d, p]^4)/128 μ Subscript[L, B]);
flowRateB2 = (Subscript[p, B][t] - Subscript[p, 2][t])((π Subscript[d, p]^4)/128 μ Subscript[L, 1]);
flowRateB3 = (Subscript[p, B][t] - Subscript[p, 3][t])((π Subscript[d, p]^4)/128 μ Subscript[L, 2]);flowRateConstraint = (flowRate1B == flowRateB2 + flowRateB3);
pressureEqns = {Subscript[p, 1][t] == ρ g Subscript[h, 1][t], Subscript[p, 2][t] == ρ g Subscript[h, 2][t], Subscript[p, 3][t] == ρ g Subscript[h, 3][t]};massConservation = {Subscript[a, 1] Subscript[h, 1]'[t] == -flowRate1B, Subscript[a, 2] Subscript[h, 2]'[t] == flowRateB2, Subscript[a, 3] Subscript[h, 3]'[t] == flowRateB3 - Subscript[a, 3] Subscript[h, 3][t] / 10};params = {Subscript[a, 1] -> 1, Subscript[a, 2] -> 1, Subscript[a, 3] -> 1, Subscript[L, B] -> 0.1, Subscript[L, 1] -> 0.1, Subscript[L, 2] -> 0.2, Subscript[d, p] -> 0.2, ρ -> .2, μ -> 2 10 ^ -3, g -> 9.81};ics = {Subscript[h, 1][0] == 1, Subscript[h, 2][0] == 0, Subscript[h, 3][0] == 0};tankSol = NDSolve[{pressureEqns, massConservation, flowRateConstraint, ics} /. params, {Subscript[h, 1], Subscript[h, 2], Subscript[h, 3]}, {t, 0, 90}];Plot[Evaluate[{Subscript[h, 1][t], Subscript[h, 2][t], Subscript[h, 3][t]} /. tankSol], {t, 0, 90}, PlotRange -> All, ImageSize -> 300, PlotStyle -> {Red, Blue, Magenta}, PlotLegends -> LineLegend[Automatic, {"Tank 1", "Tank 2", "Tank 3"}, LegendFunction -> "Panel", LegendMargins -> 10]]