Saarland University
Lehrstuhl für Automatisierungstechnik

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to model such a filter?
daniel@ka
post 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 relationship
y(t) = 1/T* integral over x(tau) dtau from t-T to t
Actually it should yield moving average of x function.

One way I can think of is to transform it manually into
y'(t) = x(t) - x(t-T)

All variables in modelica are function of times, but I think
there is no way to express x(t-T).

Regards, daniel


I found the rigth solution wink.gif
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;
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
daniel@ka
post 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 relationship
y(t) = 1/T* integral over x(tau) dtau from t-T to t
Actually it should yield moving average of x function.

One way I can think of is to transform it manually into
y'(t) = x(t) - x(t-T)

All variables in modelica are function of times, but I think
there is no way to express x(t-T).

Regards, daniel
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 19th July 2019 - 06:31 PM