Welcome Guest ( Log In | Register ) How to model such a filter? Options daniel@ka Apr 11 2009, 07:18 PM Post #1 Member  Group: Members Posts: 23 Joined: 3-June 08 Member No.: 11,399 QUOTE(daniel@ka @ Apr 11 2009, 06:38 PM) Hi forum,I am looking for a way to model a mathematical relationshipy(t) = 1/T* integral over x(tau) dtau from t-T to tActually it should yield moving average of x function.One way I can think of is to transform it manually intoy'(t) = x(t) - x(t-T)All variables in modelica are function of times, but I thinkthere is no way to express x(t-T).Regards, danielI found the rigth solution The solution is to use delay function! model MA input Real x; output Real y; parameter Real T = 1; parameter Real y0 = 1; equation der(y) = x - delay(x,T); initial equation y = y0; end MA;   daniel@ka Apr 11 2009, 06:38 PM Post #2 Member  Group: Members Posts: 23 Joined: 3-June 08 Member No.: 11,399 Hi forum,I am looking for a way to model a mathematical relationshipy(t) = 1/T* integral over x(tau) dtau from t-T to tActually it should yield moving average of x function.One way I can think of is to transform it manually intoy'(t) = x(t) - x(t-T)All variables in modelica are function of times, but I thinkthere is no way to express x(t-T).Regards, daniel   1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: Lo-Fi Version Time is now: 23rd September 2019 - 01:51 PM