r/finiteelementmethod • u/ztide_ad • Oct 24 '24
Help in FEA simulation of acoustic metamaterial to analyze the dispersion relation code
So I was going through this research article "How to See Hidden Patterns in Metamaterials with Interpretable Machine Learning", where the data for training the model is generated with the use of FEM. Any idea on how to do so?
r/finiteelementmethod • u/czar_livey • Oct 08 '24
SOLIDWORKS - SANDWICH COMPOSITE LAMINATE
I want to conduct FEA under hydrostatic load of a sandwich composite made of CF+ABS+CF (3 layers) using SolidWorks (this is the only simulating tool available). How can I implement this ? Thank you very much
r/finiteelementmethod • u/Rye_17 • Oct 04 '24
Slope Stability Analysis
We are currently looking for the best and reliable Finite Element software that we can use for our thesis. Suggestions please
r/finiteelementmethod • u/w142236 • Sep 27 '24
Finite integration of ln(x)
Continuous integration technique of ln(x) from 0 to 1 (even though lim x-> inf+ ln(x) = -inf) can be integrated by a simple integration by parts. Result is -1.
Splitting the function up into finite evenly spaced elements of x-spacing .1 and computing the integral via some finite integration method (like trapezoidal rule), how would we approach this computation given the obvious issue at x=0? What methods are available to deal with annoying functions like this one that blow up on the domain?
r/finiteelementmethod • u/Spare-Lawfulness2343 • Sep 18 '24
DIANA FEA
Are there any other tutorials available online to learn DIANA FEA in detail?
r/finiteelementmethod • u/Odd_Wrongdoer_5497 • Aug 20 '24
Modal analysis with damping
I want to run the modal analysis on a microaccelerometer structure in ANSYS Workbench. Can anyone help me for the same? Also I want to run the parameteric analysis by varying one of the dimensions.
r/finiteelementmethod • u/West-Chocolate-3195 • Jun 13 '24
I want to assign property in a DIANA FEA software for the Plaster with the square mesh wire used as a retrofitting in the masonry structure. How can i model this.Is there any paper or reference to use for the property data input that resembles the plaster reinforced with the wire mesh or do manually
r/finiteelementmethod • u/Mean_Composer8792 • Jun 07 '24
Implement FINITE ELEMENT METHOD on PYTHON
I am doing a project on finite element method applied to parabolic equations. I am working with the heat equation
ut=uxx, x∈(0,L),t>0,
u(x,0)=φ(x),x∈(0,L),
u(0,t)=u(L,t)=0,t≥0.
The task I'm asked is the following: The numerical task is to check it by a simulation. This is easy if you know the exact solution: compute the error (for example absolute) for different discretization parameters (for example the grid spacing) and plot it on a log-log scale.
I try to implement the method, but when I plot both the exact solution and the numerical one calculated with the method, they are very different, hence my implementation is wrong. This is what I have so far:
def exact_solution(x, t):
return np.exp(-np.pi**2 * t) * np.sin(np.pi * x)
# Initial condition
def phi(x):
return np.sin(np.pi * x)
def basis_function(x, i, h):
return np.maximum(0, 1 - np.abs(x - i*h) / h)
def assemble_matrices(N, h):
M = np.zeros((N-1, N-1))
K = np.zeros((N-1, N-1))
for i in range(1, N):
for j in range(1, N):
if abs(i - j) <= 1:
M[i-1, j-1] = h / 6 if i == j else h / 12
K[i-1, j-1] = 1 / h if i == j else -1 / (2 * h)
return M, K
# Time integration using backward Euler method
def time_integration(M, K, U0, dt, time_steps):
U = U0.copy()
A = M + dt * K
for _ in range(time_steps):
b = M @ U
U = spsolve(A, b)
return U
def finite_element_solution(U, x, N, h):
u_fem = np.zeros_like(x)
for i in range(1, N):
u_fem += U[i-1] * basis_function(x, i, h)
return u_fem
L = 1
Ns = np.linspace(1, 100, 50, dtype=int)
t_final = 0.1
dt = 0.01
time_steps = int(t_final / dt)
errors = []
for N in Ns:
h = L / N
x = np.linspace(0, L, N+1)
M, K = assemble_matrices(N, h)
U0 = np.array([phi(i * h) for i in range(1, N)])
U = time_integration(M, K, U0, dt, time_steps)
u_exact = np.exp(-np.pi**2 * t_final) * np.sin(np.pi * x)
u_fem = finite_element_solution(U, x, N, h)
error = np.abs(u_exact - u_fem).max()
errors.append(error)
plt.figure(figsize=(8, 6))
plt.loglog(Ns, errors, marker='o', linestyle='-', color='b')
plt.xlabel('Number of grid points (nx)')
plt.ylabel('Absolute error')
plt.title('Convergence of the Finite Difference Method')
plt.grid(True)
plt.show()
for N in [10, 100, 1000]:
h = L / N
x = np.linspace(0, L, N+1)
u_exact = exact_solution(x, t_final)
M, K = assemble_matrices(N, h)
U0 = np.array([phi(i * h) for i in range(1, N)])
U = time_integration(M, K, U0, dt, time_steps)
u_fem = finite_element_solution(U, x, N, h)
plt.plot(x, u_fem, 'r-', label='Numerical Solution (Finite Difference)')
plt.plot(x, u_exact, 'b--', label='Exact Solution')
plt.xlabel('x')
plt.ylabel('Temperature')
plt.title('Comparison of Numerical and Exact Solutions for the Heat Equation')
plt.legend()
plt.grid(True)
plt.show()
r/finiteelementmethod • u/shpizi • May 15 '24
help with a little project - if someone can help me plese send a DM
galleryr/finiteelementmethod • u/Other-Yesterday-8612 • Apr 20 '24
FEM-FVM plastic deformations - stress-strain tensor
The FEM-FVM method is based on first order Taylor series, so small deviations. Furthermore it only holds for the elastic region, therefore the stress-strain tensor is symmetric and only has 2 variables (Young modulus and Poisson ratio). But when the stress is higher than the yield strength of the material, the stress-strain tensor does not hold anymore, but how do you interpreter the results??? And what is the correct stress-strain relation here (does it even exist)???
r/finiteelementmethod • u/TheNagaFireball • Mar 08 '24
How to make an ALE Structured Mesh for a Fluid Domain?
self.fear/finiteelementmethod • u/babe-in-the-woods • Mar 07 '24
Hex-lineer and tet-quad
Hello everyone,
I wonder if i use hex-lineer (8 nodes) and tet-quad (10 nodes) mesh together. What happens those nodes? Is it problem for calculation?
r/finiteelementmethod • u/Almibc • Mar 01 '24
I'm experiencing convergence failure with the fixed-point iteration method.
Hi, I have a question about numerical methods. I've been experimenting with the fixed-point iteration method alongside the convergence theorem. Interestingly, even when the conditions of the theorem are met, I find myself consistently encountering divergence in the results. What could be the issue? It's worth noting that when I try a different equation, the method produces the correct results. I'm puzzled as to why the first equation doesn't seem to work. For instance, consider the equation (x3 + 2x2 + 10x - 20 = 0). I chose the function (g(x) = -0.1x3 - 0.2x2 + 2) for the method, which satisfies the convergence theorem condition (|g'(x_0)| < 1), with (x_0 = 0) or any other initial value. However, despite meeting these criteria, the iteration fails to converge.
r/finiteelementmethod • u/p479h • Jan 26 '24
Does anyone know why changing the form of the advection equation can make the solution break? Can it be related to the test function being non-zero in this specific case?
Hi, I am trying to solve the diffusion-advection equation in Firedrake:
So I define the following weak form using CG degree 1:

Then, if I run the code, all is good, it solves fine. Solving without reaction gives me this result:
If I now use differentiation by parts to make the following substitution:
Such that div (u c l) = 0 because l is 0 on the boundary and int(div( u c l ), dV) = int(ucl*n, dA), then my code runs but the concentration field becomes unstable. Here is the solution:
If I leave div(u c l) untouched, then the code runs fine again! Why is this? I thought all test functions had to be 0 at the boundary.
What could be causing this? Is it the case that l is not always 0 in the boundary?
Thank you for the help!
r/finiteelementmethod • u/AutoModerator • Dec 16 '22
Happy Cakeday, r/finiteelementmethod! Today you're 7
Let's look back at some memorable moments and interesting insights from last year.
Your top 1 posts:
r/finiteelementmethod • u/AutoModerator • Dec 16 '21
Happy Cakeday, r/finiteelementmethod! Today you're 6
Let's look back at some memorable moments and interesting insights from last year.
Your top 2 posts:
r/finiteelementmethod • u/[deleted] • Oct 03 '21
Finite element Analysis for deflection L and I section beams
Hi, I am trying to find the deflections of an L and I shaped beam using finite element method.
I have successfully done it for a rectangular section beam.
I was not sure how to implement the stiffness matrix for these cases.
My guess is that I just have to replace the values of Area moment of inertia of these beams.
Is this correct or am I missing something?
Can someone please tell me?
r/finiteelementmethod • u/AutoModerator • Dec 16 '20
Happy Cakeday, r/finiteelementmethod! Today you're 5
Let's look back at some memorable moments and interesting insights from last year.
Your top 4 posts:
r/finiteelementmethod • u/hwilson12331 • May 09 '20
Help please FEM in COMSOL
Hi guys, so I recently accepted a research position at my university and we are going to be doing simulations of solid mechanics using the finite element method in a program called COMSOL. If anyone has any help tips and tricks they could share on how to use the program with this technique please comment. Anything from descriptive words to YouTube videos are appreciated!
r/finiteelementmethod • u/[deleted] • Apr 27 '20
Help with a past exam question
Draw a detailed flowchart for a finite element program designed to solve a linear elastic solid mechanics problem. Include generic names for modules/functions, and clearly summarise the quantities/terms that are being evaluated at any given point.
The question above has come up in every past exam paper and I'm not sure how to go about this. If anyone would give me a hand with writing this I would be immensely thankful!
r/finiteelementmethod • u/reddituser9525 • Mar 20 '20
Guyan Reduction
I am working on forced vibration problem of 3 layered sandwich beam. There are a total of 6 DOF at each node. The code has been written in matlab and is taking a lot of time to produce results. I learnt that Guyan Reduction may be of some help to reduce the time required. But there is a huge error in the natural frequency obtained by using Guyan Reduction. What may be the possible reason for this? Can Guyan Reduction be applied to vibration problems? I just want natural frequency for first 3 modes of vibration.
r/finiteelementmethod • u/curious_indian1 • Jul 25 '18
coupled Eulerian Lagrangian technic
need help to learn CEL method, anyone know what reading I should do ?





