MATLAB code¶
This MATLAB code is documented with Sphinx using the matlabdomain extension.
src¶
src module contains the following source code files:
- src.main()¶
main function
An electromechanically coupled beam, Dengpeng Huang @ LTD-FAU, August 2022.
Reference: Huang and Leyendecker. Computational Mechanics, 69(2022)(3):805-824.
- src.a_ini¶
set initial configuration, material parameters and boundary conditions
- src.b_dEL_AD¶
derive discrete Euler-Lagrange equations and tangents using automatic differentiation
- Parameters:
param – initial conditions, boundary conditions, material parameter
- Returns:
symbolic functions of residual and tangent
- src.c_NR¶
Newton-Raphson scheme to solve the discrete Euler-Lagrange equations
- Parameters:
param – initial conditions, boundary conditions, material parameter
fns – symbolic functions of residual and tangent
- Returns:
discrete trajectory of the beam
src/integrator¶
- src.integrator.constraints¶
constraints
- Parameters:
q – current configuraiton
q_ref – reference configuraiton
param – parameters
- Returns:
constraints
- src.integrator.elmass01¶
(consistent) mass matrix for beam element
- Parameters:
eref – eref = […, phi^A, (d1)^A, (d2)^A, (d3)^A, … ](0); A=1,2
inertia – inertia = (rho*A, M_1, M_2)
- Returns:
Me, consistent elemental mass matrix (15*2 x 15*2)
- src.integrator.exp_operator¶
exponential map
- src.integrator.ext_constraints¶
external constraints
- Parameters:
q – current configuraiton
q_ref – reference configuraiton
param – parameters
- Returns:
external constraints
- src.integrator.ext_potEn¶
external potential energy
- Parameters:
q – current configuraiton
_ref – reference configuraiton
- Returns:
external potential energy
- src.integrator.hat_vec¶
skew-symmetric matrix with axial vector a
- src.integrator.int_constraints¶
internal constraints
- Parameters:
q – current configuration
param – parameters
- Returns:
internal constraints
- src.integrator.int_potEn_bm_w¶
evaluate terms in the strain energy function
- src.integrator.int_potEn_bm¶
strain energy computed from beam kinematics
- Parameters:
eref – nodal configuraitons of beam element in reference configuraiton
eq – nodal configuraitons of beam element in current configuraiton
param – parameters
- Returns:
strain energy
- src.integrator.int_potEn_cm¶
strain energy computed from kinematics in contunuum mechanics
- Parameters:
eref – nodal configuraitons of beam element in reference configuraiton
eq – nodal configuraitons of beam element in current configuraiton
param – parameters
- Returns:
strain energy
- src.integrator.int_potEn¶
internal potential energy
- Parameters:
q – current configuraiton
q_ref – reference configuraiton
param – parameters
- Returns:
internal potential energy
- src.integrator.kinEnergy_new¶
kinetic energy
- Parameters:
q_dot – velocity
param – parameters
- Returns:
kinetic energy
- src.integrator.LagrangeEqu¶
discrete Lagrange
- Parameters:
q_n – configuraiton at step n
q_np1 – configuraiton at step n+1
q_ref – configuraiton in reference configuraiton
param – parameters
- Returns:
discrete Lagrange
- src.integrator.null_space_matrix¶
null space matrix
- Parameters:
q_bm – current configuraiton
param – parameters
- Returns:
null space matrix P
- src.integrator.RK¶
evaluate residual and tangent for step n
- Parameters:
X – configuraiton at step n+1
q_nm1 – configuraiton at step n-1
q_n – configuraiton at step n
param – parameters
fns – symbolic functions
- Returns:
residual and tangent
- src.integrator.RK0¶
evaluate residual and tangent for step 1
- Parameters:
X – configuraiton at step n+1
q_n – configuraiton at step n
param – parameters
fns – symbolic functions
- Returns:
residual and tangent
- src.integrator.update¶
nodal reparametrization
- Parameters:
dx – generalized configuration
q – redandent configuraiton
param – parameters
- Returns:
updated redandent configuraiton
- src.integrator.viscos_force_PF¶
1st Piola-Kirchhoff stress (Kelvin–Voigt viscosity model) and deformation gradient F in element j
- Parameters:
eref – nodal configuraitons of beam element in reference configuraiton
eq – nodal configuraitons of beam element in current configuraiton
e_dot – nodal velocity of beam element in current configuraiton
XY – coordinates of integration point in cross section
param – parameters
- Returns:
1st Piola-Kirchhoff stress and deformation gradient F
- src.integrator.viscos_force¶
viscosity force vector as external forces
- Parameters:
q_n – configuraiton at step n
q_np1 – configuraiton at step n+1
q_ref – reference configuraiton
param – parameters
- Returns:
viscosity force vector
src/pre_post_processing¶
- src.pre_post_processing.Energy¶
plot internal potential energy and kinetic energy
- src.pre_post_processing.Hami_Energy_red¶
reduced Kinetic energy: p*invM*p/2
- src.pre_post_processing.Hami_Energy¶
kinetic energy: p*invM*p/2
- src.pre_post_processing.Hamilton¶
plot discrete Hamiltonian
- src.pre_post_processing.Hd_red¶
plot reduced discrete Hamiltonian
- src.pre_post_processing.path_s¶
generating initial configutaiton q for straight beam with length L
- src.pre_post_processing.plot_FE_mov¶
creates a movie from Q and colors the beam if strain results are provided, saved to code folder under sim_vid
- src.pre_post_processing.plot_FE¶
plot configuration of the beam
- src.pre_post_processing.plot_theta¶
plot rotation angle of the end node
- src.pre_post_processing.plot_u¶
plot position or displacement of the end node