railFE package
Submodules
railFE.MatrixAssemblyOperations module
MatrixAssemblyOperations
- Usage:
This script can be used to assemble a global stiffness matrix by summing up the terms from one array onto the second at specific array coordinates.
- @author:
CyprienHoelzl
- railFE.MatrixAssemblyOperations.addAtIdx(mat1, mat2, xypos)
Add two arrays of different sizes in place, offset by xy coordinates
- Parameters
- mat1numpy array
array1 of size (a,b)
- mat2numpy array
array2 of size (n,m) to be added to mat1
- xypostuple
tuple ([x,x2,x3…xn],[y1,y2,y3,..ym]) containing coordinates in mat1 for elements in mat2
- Returns
- mat1array
summed arrays
- railFE.MatrixAssemblyOperations.addAtPos(mat1, mat2, xypos)
Add two arrays of different sizes in place, offset by xy coordinates
- Parameters
- mat1numpy array
base array
- mat2numpy array
secondary array added to mat1
- xypostuple
tuple (x,y) containing coordinates
- Returns
- mat1numpy array
array1 + (array2 added at position (x,y) in array1)
railFE.Newmark_NL module
Solve time integration of system
- Usage:
See examples
- @author:
CyprienHoelzl
- class railFE.Newmark_NL.TimeIntegrationNM(Overallsystem, u_0, speed=18, t_end=1, dt=0.0001)
Bases:
objectMethods
Solve the time integration with Newmark Solver
shift(xx)Shift xx on changing timoshenko element
- newmark_slv()
Solve the time integration with Newmark Solver
- Returns
- bool: return True if successfull, else return False
- shift(xx)
Shift xx on changing timoshenko element
- Parameters
- xxInitial Vector
- Returns
- xxShifted Vector
- railFE.Newmark_NL.addAtIdx(mat1, mat2, xypos)
Add two arrays of different sizes in location, where the offset is defined by xy coordinates.
- Parameters
- mat1base array.
- mat2array to be summed to mat1.
- xypostuple ([x,x2,x3…],[y1,y2,y3,..]) containing coordinates in mat1.
- Returns
- mat1added arrays.
- railFE.Newmark_NL.newmark_nl(MODEL)
Non Linear Newmark algorithm for time integration of a dynamic system. Standard algorithm as described by: https://ethz.ch/content/dam/ethz/special-interest/baug/ibk/structural-mechanics-dam/education/femII/presentation_05_dynamics_v1_EC.pdf
- Parameters
- MODELState Space Model
- Returns
- MODELState Space Model
railFE.SystemAssembly module
Matrix Assembly of System
- Usage:
This script can be used to assemble local track system matrices, and join them into a assemble a global stiffness matrix by summing up the terms from one array onto the second at specific array coordinates.
- @author:
CyprienHoelzl
- class railFE.SystemAssembly.LocalAssembly(OverallSystem, modal_analysis=True, modal_bays=5)
Bases:
objectMethods
assembleLocalMatrices(xi, segment, K_c, Yi, ...)Assemble the local matrices
Assembling System Matrix for 4DOF Timoshenko elements and 4DOF elastically supported Timoshenko element
Assembling System Matrix for 4DOF Timoshenko elements with point support
assembleLocalMatricesStatic(xi, segment, ...)Assemble the local matrices for the static case
interpolation_matrix
- assembleLocalMatrices(xi, segment, K_c, Yi, w_irr)
Assemble the local matrices
The local system connect the vehicle to the track with a non-linear Hertzian spring The force from the contact on the system’s DOFs:
f_c = -[-1, N, 1].T*f_c = -[-1, N, 1].T*K_c*delta**1.5
where delta = w_G,r + w_loc + w_irr - w_w
- K_c here assumed constant
w_G,r=N(x_w)*q_tr and w_loc=q_l refer to global and local rail displacement respectively, w_w is the wheel displacement w_irr are wheel-rail body contact irregularities
- Vectorial form:
f_c = -[-1, N, 1].T*f_c = -K_c*delta**0.5*[-1, N, 1].T*[1, N, 1, -1]*[w_w,q_tr,q_L,w_irr].T
- Separating irregularities:
f_c = K_c*delta**0.5*[1, -N, -1].T*[-1, N, 1]*[w_w,q_tr,q_L].T + K_c*delta**0.5*[1, -N, -1].T*w_irr f_c = K_c*delta**0.5*E*q_sys + f_irr [K_sys - K_c*delta**0.5]*q_sys
where delta evaluated during convergence process. and E is a function of N(xi_wheel)
- Parameters
- xifloat
perc position on element (0-1).
- segmentdictionary
repeated_segments.
- K_cfloat
Herzian spring stiffness.
- YiTYPE
DESCRIPTION.
- w_irrarray
Force due to irregularities on wheel or track.
- Returns
- K_loc_modarray
Herzian spring stiffness.
- f_loc_modarray
Force due to rail/wheel irregularities.
- f_int_modarray
Force due to rail deformation.
- assembleLocalMatricesEB3el()
Assembling System Matrix for 4DOF Timoshenko elements and 4DOF elastically supported Timoshenko element
The model starts with sleeper 0 and end with sleeper {}’.format(str(self.n_sleepers-1)))
Numbering convention: w_i_1, t_i_1, w_i_s, w_i_2, t_i_2, w_i_3, t_i_3
- Parameters
- wis the vertical displacement,
- tis the rotation theta,
- iis the number of bay element,
- node _1 and _2are on the left/right sleeper_i side respectively,
- node _sis the sleeper node,
- node _3is the mid span node.
- assembleLocalMatricesPT4el()
Assembling System Matrix for 4DOF Timoshenko elements with point support
The model starts with sleeper 0 and end with sleeper {}’.format(str(self.n_sleepers-1)))
Numbering convention: w_rail_i_1, t_rail_i_1, w_rail_i_2, t_rail_i_2, w_rail_i_s, w_rail_i_3, t_rail_i_3, w_rail_i_4, t_rail_i_4
- Parameters
- w: is the vertical displacement,
- t: is the rotation theta,
- i: is the number of bay element,
- node _1 and _3: are on the left/right sleeper_i side respectively,
- node _2: is the rail node connected to the track,
- node _s: is the sleeper node,
- node _4: is the mid span node.
- assembleLocalMatricesStatic(xi, segment, K_c, w_irr)
Assemble the local matrices for the static case
The local system connect the vehicle to the track with a linear Hertzian spring
- Parameters
- xifloat
perc position on element (0-1).
- segmentdictionary
repeated_segments.
- K_cfloat
Herzian spring stiffness.
- w_irrarray
Force due to irregularities on wheel or track.
- Returns
- K_loc_mod_staticarray
Herzian spring stiffness.
- f_loc_mod_staticarray
Force due to rail/wheel irregularities.
- interpolation_matrix(xi, node_type='TIM4')
- class railFE.SystemAssembly.OverallSystem(support_type, n_sleepers=81, modal_analysis=True, function_track_roughness=None, function_wheel_roughness=None, **kwargs)
Bases:
objectThe Overall System is assembled with this class The following system of equations defines the system dynamics:
M_sys*q_sys’’+C_sys*q_sys’+K_sys*q_sys = f = f_c + f_ext K_loc*w_loc = f_c
Methods
Apply external excitation
assemble_state_space(observed_dofs)Generate State Space representation of system
Track Irregularities
Wheel Irregularities, factor of Pi*D
Recursive node definition
timeToGlobalPos(t_glob, speed)From time and speed, calculate rolled distance on track (pos_glob)
timeToLocalReference(t_glob, speed)From time and speed, calculate position in local reference (segment + xi)
updateSystem(ti, Yi, speed)Update system for non-linear terms
w_irr_t
w_irr_w
- ExternalExcitation()
Apply external excitation
- Returns
- f_sysarray
system force vector.
- assemble_state_space(observed_dofs)
Generate State Space representation of system
- Parameters
- observed_dofsarray
index of observed DOFs.
- Returns
- syscontrol system
State space system from control library.
- function_track_roughness_default(ti)
- Track Irregularities
By default a unit impulse at 0.25s
- Parameters
- tifloat
time in seconds.
- Returns
- w_irrtrack irregularity.
- function_wheel_roughness_default(ti)
- Wheel Irregularities, factor of Pi*D
By default no wheel roughness
- Parameters
- tifloat
time of simulation.
- Returns
- w_irr0.
- iterated_nodes()
Recursive node definition
- Returns
- repeated_segments_coordinatesdict
coordinates of nodes.
- repeated_segmentsdict
description of nodes.
- timeToGlobalPos(t_glob, speed)
From time and speed, calculate rolled distance on track (pos_glob)
- Parameters
- t_globfloat
time in seconds.
- speedfloat
speed in meter/second.
- Returns
- pos_globfloat
rolled distance in meters.
- timeToLocalReference(t_glob, speed)
From time and speed, calculate position in local reference (segment + xi)
- Parameters
- t_globfloat
time in seconds.
- speedfloat
speed in meter/second.
- Returns
- xifloat
position on segment.
- segmentdictionary
segment attribute dictionary.
- updateSystem(ti, Yi, speed)
Update system for non-linear terms
- Parameters
- tifloat
timestamp of simulation.
- YiTYPE
DESCRIPTION.
- speedfloat
speed.
- Returns
- None.
- w_irr_t(ti)
- w_irr_w(ti)
- railFE.SystemAssembly.assemble_state_space(K, M, C, f, observed_dofs)
Generate State Space representation of system
- For a system of type:
Mx’’+Cx’+Kx = f
- Transform to the representation:
Ay+Bu=q Cy+Du=q
- Parameters
- K2d array
Sitffness matrix.
- M2d array
Mass matrix.
- C2d array
Damping matrix.
- f2d array
Force array.
- observed_dofsarray
index of observed DOFs.
- Returns
- syscontrol system
State space system from control library.
- railFE.SystemAssembly.system_matrix(support_type='eb', **kwargs)
Create system matrix
- Parameters
- support_typestring, optional
‘pt’ or ‘eb’ for punctual or distributed support. The default is ‘eb’.
- **kwargsoverall system kwargs.
- Returns
- OverallSystTYPE
DESCRIPTION.
- Marray
Mass Matrix.
- Karray
Stiffness Matrix.
- Carray
Damping Matrix.
- farray
Force vector.
- dof_rail_mid_spanarray
indexes of rail midspan coordinates.
- dof_rail_supportarray
indexes of rail support coordinates.
- dof_sleeperarray
indexes of sleeper coordinates.
- dofs_railarray
indexes of rails coordinates.
- dofs_sleeperarray
indexes of sleepers coordinates.
railFE.TimoshenkoBeamModel module
Rail beam formulation
For the rail formulation a timoshenko 4, 4DOF element is used with nodal displacement vector u^{(e)} = {w_1, heta_1,w_2, heta_2}
- Extentions:
A TIM7 FE element could also be used, and would fullfill C(1).
Currently this package is insufficiently documented
- Usage:
See examples
- @author:
CyprienHoelzl
- railFE.TimoshenkoBeamModel.IsIterable(obj)
- class railFE.TimoshenkoBeamModel.Timoshenko4(railproperties, elementlength, modal_analysis=True, modal_n_modes=10)
Bases:
object- Implementation of the Timoshenko4 beam using the formulation in:
https://www.sciencedirect.com/science/article/pii/0045794993902437 https://link.springer.com/content/pdf/10.1007/s00466-009-0431-2.pdf http://people.duke.edu/~hpgavin/cee541/StructuralElements.pdf
Static analysis of Timoshenko beam resting on elastic half-plane based on the coupling of locking-free finite elements and boundary integral proposed by Nerio Tullini · Antonio Tralli
Methods
C_loc_dyn
CalcP
DetLambda
F_res
GetNaturalFrequencies
K_loc_dyn
Lambda
M_cross_dyn
M_loc_dyn
N_t1
N_t2
N_w1
N_w2
NormalizeP
Nt_t1
Nt_t2
Nt_w1
Nt_w2
Psi_Modal
T
W
dampingMatrix
massMatrix
point_load_flexibility_TIM4
preprocess
subdividespace
- C_loc_dyn()
- CalcP(omega)
- DetLambda(omega)
- F_res(xi)
- GetNaturalFrequencies(n=5)
- K_loc_dyn()
- Lambda(omega)
- M_cross_dyn()
- M_loc_dyn()
- N_t1(xi)
- N_t2(xi)
- N_w1(xi)
- N_w2(xi)
- NormalizeP(P, omega)
- Nt_t1(xi)
- Nt_t2(xi)
- Nt_w1(xi)
- Nt_w2(xi)
- Psi_Modal(xi)
- T(xi, P, omega)
- W(xi, P, omega)
- dampingMatrix()
- massMatrix()
- point_load_flexibility_TIM4(xi)
- preprocess(f, xmin, xmax, step, args=())
- stiffnessMatrix()
- subdividespace(f, xmin, xmax, step, args=())
- class railFE.TimoshenkoBeamModel.Timoshenko4eb(railproperties, padproperties, elementlength, modal_analysis=True, modal_n_modes=10)
Bases:
object- # Implementation of the Timoshenko4 beam on an elastic bedding.
Static analysis of Timoshenko beam resting on elastic half-plane based on the coupling of locking-free finite elements and boundary integral
Methods
B_EFb2
B_EFb_t
B_EFb_w
B_EFsh2
B_EFsh_t
B_EFsh_w
C_loc_dyn
CalcP
DetLambda
F_res
GetNaturalFrequencies
K_loc_dyn
Lambda
M_cross_dyn
M_loc_dyn
Moment
N_EF2
N_EF_w
N_EFb2
N_EFb_w
N_s
N_t1
N_t2
N_w1
N_w2
NormalizeP
Psi_Modal
Shear
T
W
calc_alpha_beta
dampingMatrixTEEF
displacement_field_TIM4eb
interpfunction_coeffs
massMatrixTEEF
particular_solution_sleeper
point_load_flexibility_TIM4
preprocess
rotation_field_TIM4eb
stiffnessMatrixTEEF
subdividespace
theta
w
- B_EFb2(x_i, idx1, idx2)
- B_EFb_t(x_i, idx)
- B_EFb_w(x_i, idx)
- B_EFsh2(x_i, idx1, idx2)
- B_EFsh_t(x_i, idx)
- B_EFsh_w(x_i, idx)
- C_loc_dyn()
- CalcP(omega)
- DetLambda(omega)
- F_res(xi)
- GetNaturalFrequencies(n=5)
- K_loc_dyn()
- Lambda(omega)
- M_cross_dyn()
- M_loc_dyn()
- Moment(xi, coeffs)
- N_EF2(x_i, idx1, idx2)
- N_EF_w(x_i, idx)
- N_EFb2(x_i, idx1, idx2)
- N_EFb_w(x_i, idx)
- N_s(xi)
- N_t1(xi)
- N_t2(xi)
- N_w1(xi)
- N_w2(xi)
- NormalizeP(P, omega)
- Psi_Modal(xi)
- Shear(xi, coeffs)
- T(xi, P, omega)
- W(xi, P, omega)
- calc_alpha_beta()
- dampingMatrixTEEF()
- displacement_field_TIM4eb(xi, coeffs)
- interpfunction_coeffs()
- kc_contribution_bedding()
- massMatrixTEEF()
- particular_solution_sleeper()
- point_load_flexibility_TIM4(xi)
- preprocess(f, xmin, xmax, step, args=())
- rotation_field_TIM4eb(xi, coeffs)
- stiffnessMatrixTEEF()
- subdividespace(f, xmin, xmax, step, args=())
- theta(xi, idx)
- w(xi, idx)
railFE.TrackModelAssembly module
Track Model assembly
- Usage:
Assemble the track matrices
- @author:
CyprienHoelzl
- class railFE.TrackModelAssembly.Ballast(K=40000000, C=47000)
Bases:
object
- class railFE.TrackModelAssembly.Pad(K=200000000, C=28000)
Bases:
objectMethods
distributed_params(L_s)Recompute to distributed parameters:
- distributed_params(L_s)
- Recompute to distributed parameters:
stiffness/damping per meter of track.
- Parameters
- L_sfloat
length of segment in meters.
- Returns
- None.
- class railFE.TrackModelAssembly.SleeperB70
Bases:
object
- class railFE.TrackModelAssembly.SleeperB90
Bases:
object
- class railFE.TrackModelAssembly.TrackAssembly(support_type='eb', n_sleepers=81, sleeper_spacing=0.6, support_length=0.16, **kwargs)
Bases:
objectMethods
Assembling System Matrix for 4DOF Timoshenko elements and 4DOF elastically supported Timoshenko element')
Assembling System Matrix for 4DOF Timoshenko elements with point support
- assembleTrackMatricesEB3el()
Assembling System Matrix for 4DOF Timoshenko elements and 4DOF elastically supported Timoshenko element’)
The model starts with sleeper 0 and end with sleeper {}’.format(str(self.n_sleepers-1)))
Numbering convention: w_i_1, t_i_1, w_i_s, w_i_2, t_i_2, w_i_3, t_i_3 Where:
w : is the vertical displacement, t : is the rotation theta, i : is the number of bay element, node _1 and _2 : are on the left/right sleeper_i side respectively, node _s : is the sleeper node, node _3 : is the mid span node.
- assembleTrackMatricesPT4el()
Assembling System Matrix for 4DOF Timoshenko elements with point support
The model starts with sleeper 0 and end with sleeper {}’.format(str(self.n_sleepers-1)))
Numbering convention: w_rail_i_1, t_rail_i_1, w_rail_i_2, t_rail_i_2, w_rail_i_s, w_rail_i_3, t_rail_i_3, w_rail_i_4, t_rail_i_4 Where:
w : is the vertical displacement, t : is the rotation theta, i : is the number of bay element, node _1 and _3 : are on the left/right sleeper_i side respectively, node _2 : is the rail node connected to the track, node _s : is the sleeper node, node _4 : is the mid span node.
- class railFE.TrackModelAssembly.UIC60properties
Bases:
objectMethods
Intertias of rail
Psi(L)Defined as: Psi = 12EI/GAkL^2
- I_rotated()
Intertias of rail
- Returns
- I_uufloat
inertia in uu.
- I_vvfloat
inertia in vv.
- I_uvflaot
inertia in uv.
- Psi(L)
Defined as: Psi = 12EI/GAkL^2
- Parameters
- Llength of element.
- Returns
- psipsi.
railFE.UnitConversions module
Unit Conversions
- Usage:
The functions in this script can be used to convert from different angular coordinate systems.
- @author:
CyprienHoelzl
- railFE.UnitConversions.P2R(radii, angles)
Polar to rectangular
- Parameters
- radiiradius.
- anglesangle in rad.
- Returns
- rectangular coordinates (a+b*j)
- railFE.UnitConversions.R2P(x)
Rectangular to polar
- Parameters
- xrectangular coordinates (a+b*j)
- Returns
- radiiradius
- anglesangles
railFE.VehicleModelAssembly module
Vehicle Assembly
- Usage:
This script can be used to for the vehicle Assembly, The default parameters are based on an EC EW4 Panorama waggon
- @author:
Cyprien Hoelzl
- class railFE.VehicleModelAssembly.Axle(m_axle=592.15, k_prim_spring=1200000.0, d_prim_damper=0)
Bases:
object
- class railFE.VehicleModelAssembly.Bogie(m_bogie=996.0, k_sec_susp=122750.0, d_sec_susp=1325000.0)
Bases:
object
- class railFE.VehicleModelAssembly.CarBody(m_car=4625.0)
Bases:
object
- class railFE.VehicleModelAssembly.VehicleAssembly(axle=None, bogie=None, carbody=None)
Bases:
objectMethods
Quarter car vehicle assembly when including only car and axle parameters
Quarter car vehicle assembly when including body, bogie and axle
- assembleVehicleMatrices()
- Quarter car vehicle assembly when including only car and axle parameters
Assemble the M, K, C matrices
Save the DOF names
# ________ # |________| body # z primary suspension # O axle
- Returns
- None.
- assembleVehicleMatrices2()
- Quarter car vehicle assembly when including body, bogie and axle
Assemble the M, K, C matrices
Save the DOF names
# ________ # |________| body # z secondary suspension # |___| bogie # z primary suspension # O axle
- Returns
- None.
Module contents
Rail Vehicle Dynamics simulation software.