Questions tagged [finite-element-method]

Usage of the Finite Element Method embedded in NDSolve and details on the implementation of the fem in mathematica.

Filter by
Sorted by
Tagged with
53 votes
4 answers
8k views

Dynamic Euler–Bernoulli beam equation

I am trying to solve for the vibration of a Euler–Bernoulli beam. The equation is $\frac{\partial ^2u(t,x)}{\partial t^2}+\frac{\partial ^4u(t,x)}{\partial x^4}=0$ For the boundary conditions I ...
Hugh's user avatar
  • 16.3k
60 votes
1 answer
3k views

What's inside InterpolatingFunction[{{1., 4.}}, <>]?

I'm curious what's inside the InterpolationFunction object? For example: ...
xslittlegrass's user avatar
16 votes
2 answers
3k views

Boundary condition with spatial derivative is ignored by NDSolve

Consider the following differential equation: $$\begin{align*}&\rho C_p\left(\frac{\partial T}{\partial t}\right)=k\left[\frac{\partial^2 T}{\partial x^2}\right]+\dot{q}\\ &\text{at }x=0,\;\...
Feyre's user avatar
  • 8,587
103 votes
17 answers
5k views

Future enhancements for the finite element method

How should the finite element method (FEM) framework in the language be extended to be more useful? With the release of version 12.0 all fundamental FEM solvers (linear, nonlinear, stationary, ...
user21's user avatar
  • 39.4k
80 votes
3 answers
10k views

Numerically solving Helmholtz equation in 2D for arbitrary shapes

I would like to solve the Helmholtz equation with Dirichlet boundary conditions in two dimensions for an arbitrary shape (for a qualitative comparison of the eigenstates to periodic orbits in the ...
Julian S.'s user avatar
  • 1,018
13 votes
1 answer
955 views

PDEs : automatic method choice : TensorProductGrid or FiniteElement?

A problem that arises when we solve PDEs with NDSolve[] and Method->Automatic is how to know which method has been chosen : <...
andre314's user avatar
  • 18.2k
73 votes
4 answers
6k views

Can Mathematica solve Plateau's problem (finding a minimal surface with specified boundary)?

Given a closed curve $\mathcal C$ in three dimensions, is it possible to use Mathematica's built-in functionality to compute a minimal surface whose boundary is $\mathcal C$? For simplicity, let us ...
user avatar
40 votes
3 answers
6k views

Nonlinear FEM Solver for Navier-Stokes equations in 2D

it's me again. I'm trying to obtain a numerical solution to Navier-Stokes equations in 2D in a non-rectangular region. So far, this guide was very helpful, but he is using finite differences, which is ...
user16320's user avatar
  • 2,396
16 votes
3 answers
589 views

Reveal the formal PDE of FiniteElement

When FiniteElement method is used, the differential equations will first be transformed to certain standard form (named as formal PDE in recent FEM document), and ...
xzczd's user avatar
  • 65.4k
8 votes
4 answers
5k views

Nonlinear differential equation: numerical solution

I have to find and plot a numerical solution for this second order differential equation: u''[x] + (u'[x]/x) - (u[x]/(x^2)) + u[x] - u[x]^3 = 0 where $0\leq x &...
user avatar
12 votes
4 answers
1k views

Position of discontinuous coefficient influences the solution of PDE

This issue is raised in the discussion under this post about heat flux continuity and I think it's better to start a new question to state it in a clearer way. Just consider the following example: <...
xzczd's user avatar
  • 65.4k
7 votes
2 answers
2k views

Test a wooden board's vibration mode

Here is a wooden board, with dimensions shown on the picture below. How we can use Mathematica's newly build-in finite element analysis features to show the different modes of its vibrations. Assuming ...
Putterboy's user avatar
  • 4,651
26 votes
3 answers
14k views

How to solve ODE with boundary at infinity

y''[x] - x y[x] == 0 y[0] == AiryAi[0], y[∞] == 0 The analytic solution to this ODE is the Airy function y[x] == AiryAi[x] if ...
3c.'s user avatar
  • 669
24 votes
2 answers
3k views

ListContourPlot interpolation fails if x and y axes have different scales

To summarize what is below: ListContourPlot doesn't work when the domain has different x and y scales (fails when x/y~10^4, which seems surprisingly small). Is it possible to call ListContourPlot on ...
ninemileskid's user avatar
20 votes
3 answers
2k views

Numerically solve the initial value problem for the 1-D wave equation

I want to solve the standard 1-dimensional wave equation $y_{xx}=y_{tt}$ using NDSolve (for $y(x,t)$) with the following conditions: ...
arcbloom's user avatar
  • 313
16 votes
4 answers
1k views

Understanding PeriodicBoundaryConditions

Every thing works fine in a simple example with periodic boundary condition u[ 2,y]==u[0,y] from documentation of ...
Ulrich Neumann's user avatar
10 votes
2 answers
1k views

2D inhomogeneous biharmonic equation

How to solve a 2D inhomogeneous biharmonic equation with NDSolve? I tried the following code: ...
Asatur Khurshudyan's user avatar
2 votes
2 answers
801 views

What causes the warning "The dependent variable in the boundary condition needs to be linear" when using NDSolve?

V 12.1.1 on windows 10 Why the following works ...
Nasser's user avatar
  • 142k
19 votes
6 answers
2k views

Poisson equation with pure Neumann boundary conditions

Dear Mathematica users, I would like to numerically solve a, as the title says, Poisson equation with pure Neumann boundary conditions $-\nabla^2(\psi)=f$ $\nabla(\psi)\cdot \text{n}=g$ Is it ...
Mefistofelis's user avatar
29 votes
1 answer
5k views

Stress calculations using finite elements

A standard engineering problem is to calculate stresses in a structure due to applied forces. With the inclusion of the finite element method in version 10 this question attempts to investigate how ...
Hugh's user avatar
  • 16.3k
26 votes
1 answer
7k views

How to numerically solve a 1-d time-independent Schrödinger equation?

The point is to solve the eigensystem of the given Hamiltonian. I tried ParametricNDSolve combined with FindRoot to search for ...
Turgon's user avatar
  • 1,040
17 votes
4 answers
1k views

How to model diffusion through a membrane?

This is a follow-up on How to handle discontinuity in diffusion coefficient? Consider diffusion of $u(t,x)$ on the domain $x \in [0,2]$ with some simple boundary conditions such as $u(0) = 2, u(2) = ...
Szabolcs's user avatar
  • 234k
18 votes
1 answer
2k views

Solver for unsteady flow with the use of the Navier-Stokes and Mathematica FEM

There are many commercial and open code for solving the problems of unsteady flows. We are interested in the possibility of solving these problems using Mathematica FEM. Previously proposed solvers ...
Alex Trounev's user avatar
  • 43.4k
14 votes
1 answer
2k views

NDSolveValue - Heat flux continuity

I'm having some problems with NDSolve and the problem of conduction of heat. Specifically I'm having problems with the continuity of heat flux. First, let me ...
J.Edwards's user avatar
  • 175
9 votes
3 answers
1k views

How to use Finite elements to solve an initial value ODE with NDSolve?

This is on 11.3, windows 7 I have not used Mathematica FEM much at all. So sorry for this basic question on using it to solve a basic second order initial value ODE. I want to use ...
Nasser's user avatar
  • 142k
6 votes
3 answers
2k views

How to input Robin boundary conditions for nonstandard Laplace equation?

What is the correct way to input these boundary conditions for the following nonstandard Laplace equation, whose coefficients of $\frac{\partial^2 u}{\partial x^2}$ and $\frac{\partial^2 u}{\partial y^...
zhk's user avatar
  • 11.9k
16 votes
3 answers
4k views

Solve Laplace equation in Cylindrical - Polar Coordinates

Hey mathematica stackexchange!! I've got a (possibly stupid) problem. I've tried many things to no avail, and I've read every post I've found on Laplace's equation. Background: I'm trying to find the ...
Peanut14's user avatar
  • 365
14 votes
5 answers
2k views

3D FEM Vector Potential

I am trying to reproduce an FEM result in a paper. Due to possible copyright I cannot show the result directly but fortunately there is a free link An Incomplete Gauge for 3D Nodal Finite Element ...
Greenasnz's user avatar
  • 231
13 votes
2 answers
616 views

Nonlinear dispersal equation modeling insect aggregation

I'm a newbie with Mathematica, I know it's a basic answer, but I can't solve the problem on my own. I have the following equation reflecting insect aggregation at low population densities (taken from ...
Vefhug's user avatar
  • 421
12 votes
4 answers
1k views

Solving Burger's equation with NDSolve at large time

I want to solve the following Burger's equation $$\partial_tu+\partial_x\left(\frac{u^2}{2}\right)=0,~~x\in[0,2\pi],~t>0\\u(x,0)=\frac{1}{3}+\frac{2}{3}\sin(x)$$ with mathematica. Here's my code: <...
Ho-Oh's user avatar
  • 245
55 votes
2 answers
4k views

Numerically solving Helmholtz equation in 3D for arbitrary shapes

Context While studying manifold Learning I got interested in finding the eigenvectors of the Laplacian. (also in connection to this problem of solving the heat equation) Following this and that ...
chris's user avatar
  • 22.8k
32 votes
7 answers
5k views

How to generate a mesh with quadrilateral elements?

I have the following code that generates a finite element mesh: ...
Stratus's user avatar
  • 2,882
27 votes
1 answer
4k views

How do I use the new nonlinear finite element in Mathematica 12 for this equation?

With Mathematica 12 we get new technology for nonlinear finite elements. Out of curiosity, I just wanted to solve the following equation $$ \frac{d}{dx} \left( c(x) \left[\frac{d}{dx} u(x)\right]^p \...
Mauricio Fernández's user avatar
21 votes
2 answers
2k views

Least effort to handle a point source inside the domain of PDE(s)

By point source I mean a constrained condition at one point inside the domain of PDE(s). For example: $$\frac{\partial ^2u(t,x,y)}{\partial t^2}=\frac{\partial ^2u(t,x,y)}{\partial x^2}+\frac{\...
xzczd's user avatar
  • 65.4k
19 votes
4 answers
1k views

How to apply different equations to different parts of a geometry in PDE?

I want to solve two coupled partial differential equations on two dimension. There are two variables v and m. The geometry is a ...
MOON's user avatar
  • 3,854
17 votes
1 answer
1k views

Is it possible to re-mesh, downsample & upsample a DiscretizeRegion object?

In my project, I am importing a complex geometry from an STL file into Mathematica as a MeshRegion. I would like to edit this mesh significantly: For instance, drastically reduce or increase the ...
Alexander Erlich's user avatar
16 votes
3 answers
1k views

Solving Stefan's solidification problem - for the case of 3 regions

This question heavily related to this question, where the case of two PDE's are solved along with a zipping condition that is a function of time. Using the link in the code I have solved this set of ...
Ofek Peretz's user avatar
11 votes
3 answers
1k views

Laplace's equation in spherical coordinates with Neumann b.c

I am trying to find the temperature field in a semi-infinite solid on whose surface there is an isotherm spherical cap sunken by a length p. For example: ...
umby's user avatar
  • 585
8 votes
1 answer
1k views

Controlling dynamic time step size in NDSolveValue

Statement of problem I'm writing a script to calculate the temperature of a 2D system with time-dependent heat deposition. The heat deposition is a square wave pulse of duration w = 10^-6 seconds, ...
BohemianTapestry's user avatar
6 votes
2 answers
669 views

NDSolve with equation system with unknown functions defined on different domains

Based on @xzczd's excellent answer on solving an equation system with unknown functions defined on different domains, I've tried to apply the same technique to a similar system shown below: Equations: ...
Rpj's user avatar
  • 249
6 votes
1 answer
651 views

Incorrect results of diffusion equation with Neumann boundary conditions [duplicate]

I want to resolve a PDE model, which is 1D heat diffusion equation with Neumann boundary conditions. The key problem is that I have some trouble in solving the equation numerically. Consider the ...
H. Kuwae's user avatar
41 votes
4 answers
7k views

Creating a 2D meshing algorithm in Mathematica

As what is proving to be a difficult, but entertaining task, I am attempting to adapt a 2D meshing algorithm created for MATLAB and port it to Mathematica. I understand meshing functions already exist ...
Tom's user avatar
  • 3,416
35 votes
1 answer
4k views

Calculating a potential function using the finite element method

This is my first attempt to use the Finite Element method available in version 10. There are questions and I am very open to suggestions. My example is flow around a cylinder which is a well known ...
Hugh's user avatar
  • 16.3k
24 votes
2 answers
3k views

Optimizing a Numerical Laplace Equation Solver

Laplace's Equation is an equation on a scalar in which, given the value of the scalar on the boundaries (the boundary conditions), one can determine the value of the scalar at any point in the region ...
Vincent Tjeng's user avatar
20 votes
2 answers
1k views

Large deformation of solids

Link to notebook with this question and code I'd like to understand how large deformations of solid mechanics work and how they are implemented. For this am looking at the following reference problem: ...
user21's user avatar
  • 39.4k
13 votes
1 answer
4k views

Numerically solving an inhomogeneous partial differential equation

I'm trying to solve a cylindrical partial differential equation with boundary conditions. But I got an error message saying ...
DumbleKo's user avatar
  • 363
10 votes
1 answer
1k views

Why should the spatial derivative order of the ODE *not* exceed two?

Following this question I came across this strange behaviour. Let me define a 1 D interval implicitely ...
chris's user avatar
  • 22.8k
10 votes
5 answers
696 views

Overflow with NDSolve

Backslide introduced in 10.0, persisting through 12.1. I am trying to solve the following differential equation and plot the result: ...
mattiav27's user avatar
  • 6,637
7 votes
1 answer
712 views

NDEigensystem for structural vibration

Having installed version 11 I thought I would check an old Stack Exchange vibration problem using NDEigensytem. The old problem was Test a wooden board's vibration mode and I think this was before ...
Hugh's user avatar
  • 16.3k
3 votes
1 answer
183 views

Convert boundary condition involving derivative to NeumannValue programmatically

As discussed in e.g. what causes the error "The dependent variable in the boundary condition needs to be linear" when using NDSolve? When FiniteElement ...
xzczd's user avatar
  • 65.4k

1
2 3 4 5
9