OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
butterworth.F File Reference
#include "implicit_f.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine butterworth (dt, freq, x2, x1, x, fx2, fx1, fx)

Function/Subroutine Documentation

◆ butterworth()

subroutine butterworth ( intent(in) dt,
intent(in) freq,
intent(in) x2,
intent(in) x1,
intent(in) x,
intent(in) fx2,
intent(in) fx1,
intent(out) fx )

Definition at line 30 of file butterworth.F.

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
#define my_real
Definition cppsort.cpp:32