OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
butterworth.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| butterworth ../engine/source/tools/univ/butterworth.F
25!||--- called by ------------------------------------------------------
26!|| e_period ../engine/source/general_controls/damping/static.F
27!|| sensor_contact ../engine/source/tools/sensor/sensor_contact.F
28!|| sensor_vel ../engine/source/tools/sensor/sensor_vel.F
29!||====================================================================
30 SUBROUTINE butterworth (DT,FREQ,X2,X1,X,FX2,FX1,FX)
31C-----------------------------------------------
32C I m p l i c i t T y p e s
33C-----------------------------------------------
34#include "implicit_f.inc"
35C-----------------------------------------------
36C D u m m y A r g u m e n t s
37C-----------------------------------------------
38 my_real, INTENT (IN) ::
39 . dt,freq,x2,x1,x,fx2,fx1
40 my_real, INTENT (OUT) ::
41 . fx
42C-----------------------------------------------
43C L o c a l V a r i a b l e s
44C-----------------------------------------------
45 INTEGER I
47 . dt2,wd,wa,wa2,a0,a1,a2,b1,b2,c1
48C=======================================================================
49C INPUT variables:
50C DT - actual timestep
51C FREQ - filtering frequency
52C X - current unfiltered variable
53C X1 - unfiltered variable (timestep -1)
54C X2 - unfiltered variable (timestep -2)
55C FX1 - filtered variable (timestep -1)
56C FX2 - filtered variable (timestep -2)
57C-----------------------------------------------------------------------
58C OUTPUT variables:
59C FX - current filtered variable
60C=======================================================================
61 dt2 = dt / two
62 pi = atan2(zero,-one)
63 wd = sqr2*pi*freq*5.0/3.0
64 wa = sin(wd*dt2) / cos(wd*dt2)
65 wa2 = wa*wa
66 c1 = one + sqr2*wa + wa2
67 a0 = wa2 / c1
68 a1 = two * a0
69 a2 = a0
70 b1 = -two*(wa2 - one) / c1
71 b2 = (-one + sqr2*wa - wa2) / c1
72 fx = a0*x + a1*x1 + a2*x2 + b1*fx1 + b2*fx2
73C---
74 RETURN
75 END SUBROUTINE butterworth
subroutine butterworth(dt, freq, x2, x1, x, fx2, fx1, fx)
Definition butterworth.F:31
#define my_real
Definition cppsort.cpp:32