using values from previous step

General discussions about how to formulate a script for FlexPDE.

using values from previous step

Postby jabberwocky on Sun May 21, 2017 3:15 am

How can I use value from previous step?
I am modeling phase transition and I want to turn on one parameter only in the moment of transition - my idea is to check if phase transition occurred in this step and if yes, turn on upulse function (or do something similar) - BTW, is it possible, or is it waste of time because it will cause discontinuity?
Posts: 9
Joined: Fri Mar 08, 2013 2:22 pm

Re: using values from previous step

Postby moderator on Tue May 23, 2017 6:56 pm

You can get the value of a variable at one of the previous three time steps using the # sign : <variable>#<number>
If your variable is U, then U#1 will reference the value at the previous time step. U#3 will reference the value from three steps previous.

In general, we discourage the use of previous values of variables to turn of or off other parameters since it is not very physical in nature. We prefer finding a equation model that represents the process rather than an arbitrary test of a previous value.

If you are modeling phase transition, you certainly should look at our example "Applications | Chemistry | Melting.pde".
Posts: 686
Joined: Tue Jan 11, 2011 1:45 pm

Return to FlexPDE Discussion

Who is online

Users browsing this forum: No registered users and 3 guests