How can state functions be used to determine changes in a system?