forked from JCERSM/DR-PDEE-Julia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypesdef.jl
143 lines (125 loc) · 5.97 KB
/
typesdef.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# This file defines composite types
# By Yang Jiashu @ Tongji University
# Email: [email protected]
# define a composite type for the Bouc-Wen model (in function: boucwen)
# #######################################################################
struct BWPar
# structural matrices
#----------------------------------
M::Matrix{Float64} # mass matrix
C::Matrix{Float64} # damping matrix
k0::Vector{Float64} # initial lateral stiffness vector
df::Vector{Float64} # right hand term of the equation of motion (expect for excitation)
n_DoFs::Int64 # number of degrees of freedom
# parameters of Bouc-Wen model
#----------------------------------
alpha::Float64
A::Float64
n::Float64
beta::Float64
gamma::Float64
d_nu::Float64
d_eta::Float64
p::Float64
q::Float64
d_psi::Float64
lambda::Float64
zeta_s::Float64
psi::Float64
# intermediate variables
#----------------------------------
x1::Vector{Float64}
x2::Vector{Float64}
x3::Vector{Float64}
x4::Vector{Float64}
dx1::Vector{Float64}
dx2::Vector{Float64}
nu::Vector{Float64}
eta::Vector{Float64}
zeta1::Vector{Float64}
zeta2::Vector{Float64}
zu::Vector{Float64}
h::Vector{Float64}
G0::Vector{Float64}
G::Vector{Float64}
Minv::Matrix{Float64} # inverse of the mass matrix
end
# define a composite type including pre-allocated intermediate variables in
# the determination of the intrinsic drift coefficient. (in function: idcfit!)
# #######################################################################
struct idcTemp
pts :: Matrix{Float64}
fs :: Vector{Float64}
idc_ts :: Matrix{Float64}
end
# define a composite type including necessary information in
# the determination of the intrinsic drift coefficient. (in function: idcfit!)
# #######################################################################
struct idcInput
disp_samp :: Matrix{Float64} # displacement response (each column associating with a sample)
velo_samp :: Matrix{Float64} # velocity response (each column associating with a sample)
nforce_samp :: Matrix{Float64} # force response (each column associating with a sample)
knots :: Matrix{Float64} # points at which the intrinsic drift coefficients is to be fitted
n_samp :: Int64 # number of representative samples
nt :: Int64 # number of time steps
end
# define a composite type including necessary information and pre-allocated intermediate
# variables in LOWESS. (in functions: idcfit! & idclowess)
# #######################################################################
struct lowessPar
# number of mesh grids
n_knots :: Int64
# output: intrinsic drift coefficients
idc :: Vector{Float64}
# intermediate variables (Vector)
weights :: Vector{Float64}
stdvs :: MVector{2,Float64}
locvals :: Vector{Float64}
re_coeff:: MVector{3,Float64}
# intermediate variables (Matrix)
locpts :: Matrix{Float64}
lb_tmp :: MVector{3,Float64}
pts_n :: Matrix{Float64}
knots_n :: Matrix{Float64}
end
# define a composite type including necessary information and pre-allocated intermediate
# variables for path integral method. (in functions: gegdeesolver! & pathintegral!)
# #######################################################################
struct PISPar
n_xfine :: Int64 # number of grids along x-direction (refined mesh)
n_vfine :: Int64 # number of girds along v-direction (refined mesh)
dxl_fine :: Float64 # mesh size along x-direction
dvl_fine :: Float64 # mesh size along v-direction
xl_fine :: Vector{Float64} # range of grids along x-direction (refined mesh)
vl_fine :: Vector{Float64} # range of grids along v-direction (refined mesh)
xm_fine :: Matrix{Float64} # matrix of fine girds coordinates along x-direction
vm_fine :: Matrix{Float64} # matrix of fine girds coordinates along v-direction
xlex :: Vector{Float64} # extended mesh grids along the X-direction for interpolation
pchipfvals :: Vector{Float64} # extended function values along the X-direction for interpolation
xmh :: Matrix{Float64} # mesh grids for PDF(xi-vj*dt, vj, th-1)
pdfmath :: Matrix{Float64} # matrix of PDF(xi-vj*dt, vj, th-1)
idcmath :: Matrix{Float64} # matrix of IDC(xi-vj*dt, vj, th-1)
tpdmat :: Matrix{Float64} # matrix of transition probability density (TPD)
mean_tpd_xi :: Vector{Float64}
end
# define a composite type to transfer all information of intrinsic drift coefficient
# for solving the GE-GDEE/DR-PDEE. (in functions: gegdeesolver! & pathintegral!)
# #######################################################################
struct idcInfo
n_step ::Int64 # number of time steps
dt :: Float64 # time step size
D :: Float64 # intensity of gaussian white noise
n_xcrude :: Int64 # number of grids along x-direction (crude mesh)
n_vcrude :: Int64 # number of girds along v-direction (crude mesh)
xl_crude :: StepRangeLen # range of grids along x-direction (crude mesh)
vl_crude :: StepRangeLen # range of grids along v-direction (crude mesh)
end
# define a composite types including pre-allocated intermediate variables for
# for solving the GE-GDEE/DR-PDEE. (in function: gegdeesolver!)
# #######################################################################
struct gegdeeTemp
idcmat :: Matrix{Float64} # matrix of intrinsic drift coefficient
pdfmat :: Matrix{Float64} # matrix of joint probability density function
pdf_x :: Matrix{Float64} # matrix of probability density function of displacement
pdf_v :: Matrix{Float64} # matrix of probability density function of velocity
end