Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This was addressed in <a href="https://stackoverflow.com/questions/15517892/how-to-use-the-value-of-the-variable-in-the-previous-interval-as-an-input-to-the">a similar question</a> already.</p> <p>The key point is that equations describing physical behavior cannot refer to time steps. This is because there is no "timestep" in nature or the laws of physics and so the response of a system <strong>cannot</strong> depend on it.</p> <p>You don't really explain why you need to do what you are doing. Are you trying to extract simulation results? Are you trying to correlate to experimental data? Or, are you just trying to solve a differential equation?</p> <p>It isn't clear what you want to do. Please elaborate and we can probably give you some guidance on how to proceed in Modelica.</p> <p><strong>Update</strong></p> <p>Using values from a "previous interval" is fine. For example, if you wanted to sample your solution at regular intervals, express a "<a href="https://en.wikipedia.org/wiki/Z-transform" rel="nofollow noreferrer">z transform</a>" or implement a <a href="https://en.wikipedia.org/wiki/Kalman_filter" rel="nofollow noreferrer">Kalman Filter</a> in Modelica, you could do each of those very easily (for example, see the '<a href="http://modref.xogeny.com/" rel="nofollow noreferrer">sample</a>' keyword here). In other words, it is possible to store as many previous values as you would like.</p> <p>What you cannot do is use the timestep of the <strong>continuous</strong> solver in expressing how your system behaves. The intervals you reference must be independent from any intervals that the solver is using.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload