Jump to content

Mike T

  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Mike T's Achievements


Newbie (1/14)



  1. I realized that toscalars() wants a capsule and not a condition as an input, so I I tried this instead. $minutes = capsule(now()) $tau_scalar = $tau.toscalars($minutes) $signal.exponentialfilter($tau_scalar,1min) Now I get an error at exponentialfilter() about it not wanting scalar types. I tried separating the first two lines from above into its own formula to ensure it's actually doing something, and it threw another error at me: Formula Failed x Formula produces bad response type. Signal, Condition, and Scalar are allowed, but was Group:Scalar (POST /api/formulas/items 400 Bad Request) I'll admit - that's a new error for me.
  2. Somebody at Seeq let me know about the new exponentialfilter() function that came out in R50, which does what I was asking about above. I started playing with it today, but am having some issues with it because tau has to be a scalar. In my process, tau changes with production rate, so this is an issue. Is there a simple way of getting around this? I'm experimenting with the toscalars() function, but I'm actually getting errors saying it won't consume a Signal, although the help file appears to show toscalars being applied to signals. My thought was to create 1 minute capsules using the periods function, and doing something like this: $minutes = periods(1min) $tau_scalar = $tau.toscalars($minutes) $signal.exponentialfilter($tau_scalar,1min) Obviously, I'd love it if the function would accept signals for tau, but can anybody think of a way around it in the meantime?
  3. For my particular process, tau is around 1.5 hours most of the time. So in a CSTR, using five minute intervals at normal rates would result in the reactor turning over 2.7% of itself every five minutes (1 - exp(-5/180)). In general, when transitioning the process from one state or grade to another, we would say that after three residence times you are essentially "lined out" (1-exp(-3) =95% turnover). So for a mockup, I might show maybe eight residence times in total: three before the change for initialization, and five after.
  4. 1) That's right. You either just make the first value of the moving average the current value of the parameter, or make sure you pull several residence times of data before the period of interest to allow the EWMA to approach the correct value. 2) There are small changes in gamma. If production rate changes, tau (residence time) will change, so the amount of the vessel you have turned over has changed. You can think of this parameter as simply telling you what % of the reactor has turned over during that time period.
  5. Is there a way to calculate an arithmetic series in formula? You would need to be able to perform a calculation and add it to a prior value of the signal you are writing the formula for, and I'm not sure of how to do something like that. The example I need help with is calculating an exponentially weighted moving average (EWMA). This is a technique used to monitor reaction parameters in a continuously stirred tank reactor where values that are new are weighted much more than values that are several residence times past. The calculation can be performed in a spreadsheet fairly easily in discrete steps. For the example below, assume a five minute period works well for my process. Gamma (exponential weighting factor) = 1 - exp(Δt/tau) Where Δt/tau is the number of residence times that have passed over the period of interest EWMAn = Gamma*Pn + (1 - Gamma)*EWMAn-1 Where P is the current value of the parameter you calculating the EWMA of. The n subscript refers to the current time, and n-1 is the prior value of the EWMA (five minutes earlier, in my case). I have gotten as far as calculating the Gamma in Seeq by creating 5 minute capsules and calculating the number of residence times that have passed during that capsule. So far I'm stumped as to how to perform the final calculation considering you both need to initialize the EWMA with a value (done in excel by ensuring you pull several residence times of data before the period of interest), and add the new value to the former value of the EWMA. Does anybody know how to implement a calculation like this?
  • Create New...