temperature calculation in a hydrogen refueling station model

21 次查看(过去 30 天)
I'm working on simulink: I have a flow rate with positive and negative values ​​(sinusoidal function), with which I have to calculate the pressure, temperature and other parameters of a hydrogen tank to simulate its refueling and emptying. When the flow rate is greater than zero, I continue filling the tank, with all the relevant equations in specific blocks. If, on the other hand, the flow rate is negative, thanks to the else function of a if block, I calculate all the parameters with slightly different equations, placed in other blocks. When I move from one block to another, that is, from the filling phase to the emptying phase, I have a problem with the temperature calculation. In fact, the code, when it calculates the temperature in the filling phase in different intervals, takes the previous temperature as a reference: therefore, in the first interval (refilling) the temperature is calculated correctly, while in the second filling interval (which occurs after the first emptying interval) the previous temperature taken into consideration is not the last one of the first emptying phase, but the last one of the first filling phase. This results in having a step in the final values ​​at the beginning of each filling and emptying phase. How can I eliminate this step? If you need more information just ask

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by