0440949 Andreas van Cranenburgh A qualitative model of phase transitions when heating and cooling a substance This model simulates the heating or cooling of a substances by means of some (un)heat source. The temperature scale reflects the phases of the substance: - Gas - Boiling/condensing - Liquid - Melting/freezing - Solid As in reality (at least for pure substances) the transition temperatures are points, whereas the rest are intervals. The entities in the model are a substance consisting of a solid, liquid and gas, each of which has an amount associated with it. I have produced three versions of increasing sophistication: - the first and simplest has two model fragments for the phase transitions and a single fragment for heat to temperature conversion, ie., the temperature is always increasing, which is a simplification of reality. - in the second model heat is only converted in temperature in each of the stable phases, and at the end of each transition. This model works well. - the last model is an attempt to model conservation of matter. The method I have tried is to let the individual amounts of the solid, liquid and gas be inferred from the temperature, with the constraint that during a transition the amount of solid+liquid, or liquid+gas equals the total amount of substance, and in the stable phases the amount in that phase is equal to the total amount. Unfortunately this model seems to get stuck in an infinite loop! This might be a bug in Garp (cycle detection), or it might be some obvious mistake I overlooked. Using the two working models, two scenarios can be simulated: heating & freezing.