Questions tagged [finite-element-method]

Tag for the usage of "FiniteElement" Method embedded in NDSolve and implementation of finite element method (fem) in mathematica.

Filter by
Sorted by
Tagged with
6
votes
1answer
190 views

FEM: periodic solution of 2D Navier-Stokes equations

Let’s consider a horizontal channel with a round obstacle in the middle. ...
1
vote
1answer
78 views

why on some MaxCellMeasure values, FEM gives internal 1/0 error?

V 12.1 on windows 10 When I was answering NDSolveValue taking too long I noticed the following When I use some value for MaxCellMeasure, then FEM gives 1/0. Why ...
2
votes
3answers
165 views

NDSolveValue taking too long

I am trying to solve heat diffusion equation on hollow cylinder with constant DirichletCondition on inner radius and zero ...
0
votes
0answers
69 views

To obtain eigenvalues and eigenvectors from FEM solution

I have a model which solve a 2D coupled elasticity problem. Now I'm trying to get the eigenvalues and eigenvector from that solution. But, following the very first step to get stiffness and load ...
7
votes
1answer
216 views

How to Improve FEM Solution with NDSolve?

First some comments. This same calculation works beautifully in 2D with essentially the same code. I have copied it largely unaltered into 3D as part of a migration to 3D so that I can do more complex ...
1
vote
1answer
121 views

How to learn numerical solving PDEs in WM?

I started to try to solve PDEs in WM and I go gradually according to tutorial. Unfortunately, I couldn't get any solution other than that copied from the tutorial. So I ask someone more experienced to ...
2
votes
2answers
120 views

Wall boundary condition in inviscid flows with NDSolve

I am trying to duplicate https://www.wolfram.com/language/12/nonlinear-finite-elements/navier-stokes-equation.html?product=language Naiver-Stokes type simulation for a charge current density. If I ...
2
votes
0answers
84 views

Quasi-periodic boundary conditions

I am trying to solve the following problem using Mathematica's NDSolve $$ \partial^2_{y}\psi+\partial^2_{x}\psi-2\,i\,q\,B\,y\,\partial_{y}\psi-q^2B^2y^2\psi+q\,B\,\psi=0 $$ subject to the boundary ...
2
votes
1answer
85 views

Trying to use output of ParametricNDSolve as Dirichlet conditions for another ParametricNDSolve

My apologies if the problem was already solved in a similar thread, but i was not able to find a working answer. I am trying to numerically solve a quite cumbersome PDE of second order which requires ...
5
votes
3answers
144 views

RegionUnion Fails for Overlapping 3D Regions

Bug introduced in 12.0 or earlier and persisting through 12.1.0 Warning: The below code may crash your kernel! I am trying to make a (simple) 3D mesh of a box for a FEM solution (I am using MMA 12.1 ...
0
votes
3answers
96 views

Is WM able to solve PDEs (non-linear with variable coefficients) with variable initial conditions?

I'm learning how to solve PDE from tutorial. My question is about passage: "The transient Navier–Stokes equation" (code below) at the end of tutorial. First, there is a stable flow through the ...
1
vote
1answer
145 views

High peaks of FEM solution

Following this question and user21 answered, I changed the BCs of the initial problem. The code following bellow. ...
2
votes
0answers
64 views
5
votes
1answer
92 views

Assigning ElementMarkers to existing ElementMesh boundaries

I've imported a 2D element mesh from another program as a list of triangle coordinates {{x1,y1},{x2,y2}....} ("nodes") and element connections {{n1,n2,n3},...} ("elements"). Then I create an ...
10
votes
5answers
269 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: ...
2
votes
1answer
135 views

Problem with a solution of PDE with initial and boundary conditions

I would like to solve relativistic hydrodynamic equations (nonlinear PDEs) introduced here: I use eqs (33 - 35), (38 - 41), where (40) P(rho)=k*rho^g0 (all with one spatial coordinate "mu" and one ...
1
vote
1answer
99 views

NDSolve for 2D Laplace equation with mixed boundary conditions

I used NDSolve to solve the 1D Laplace equation for phi with a Dirichlet boundary condition on the left boundary and a Neumann boundary condition on the right. The calculation for phi relies on the ...
3
votes
1answer
124 views

Error using FEM package

I'm getting the following error: NDSolveValue: The FEMStiffnessElements operator failed. I looked for this error in FEM documentation and did not find anything. I'm using Mathematica 12. It ...
0
votes
0answers
56 views

NDSolve error for system of two non-linear equations

I'm trying to solve this system of non-linear ODE's $$\left\{y'(s) \left(x''(s) y'(s)-x'(s) y''(s)\right)=0,\mu x'(s) \left(x'(s) y''(s)-x''(s) y'(s)\right)=g \lambda \left(x'(s)^2+y'(s)^2\right)^{3/...
4
votes
1answer
113 views

Trouble with dependent variables in NDSolve while modelling transparent boundary conditions on a quantum graph with Mathematica

I am trying to create a model of plane wave's propagation on a quantum graph(metric graph with a differential operator, Shrodinger operator in my case, along the edges and continuity condition at the ...
2
votes
0answers
48 views

Computing the first eigenfunction of the p-Laplacian in a real interval

How can I numerically compute the first (non-negative) eigenfunction $u$ of the $p$-Laplacian ($p>1$) in a bounded interval $(-a,a) \subset \mathbb R$ (up to positive multiplicative constant)? $$-\...
3
votes
1answer
96 views

How to divide a region in FEM with a parametric curve?

I'm using NDSolve with finite element to try to solve a heat transfer problem. The region I have is a rectangle where the four vertices are at ...
16
votes
4answers
533 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) = ...
8
votes
1answer
200 views

How to handle discontinuity in diffusion coefficient?

I am looking to solve the diffusion equation with a discontinuous jump in the diffusion coefficient. In 1D, the diffusion equation for $u(t,x)$ is: $$ \partial_t u = \partial_x (D \partial_x u), $$ ...
2
votes
1answer
91 views

FEM: Getting Resulting Electric Force on each body from electric field

Based on this excellent answer FEM: Electric Field between two arbitrary defined shapes I can compute the electric field ef between two conducting objects. $$ F = ...
6
votes
1answer
89 views

FEM Simulation: Meshing two Arbitrary objects in an “air” mesh

Based on this excellent answer to my previous question: FEM: Electric Field between two arbitrary defined shapes I wanted to try out other shapes: ...
2
votes
1answer
103 views

How do I get a better result in NDSolve for 2D wave?

Consider the following equation solved with NDSolve: ...
5
votes
2answers
120 views

Mesh on cross section of meshes / 2D Region on cross section of 3D Regions

Context This is fairly general and simple question, (probably because it has a simple solution?). I want to define a mesh (e.g. to be used with Plot3D or FEM or ...
8
votes
1answer
290 views

FEM: Electric Field between two arbitrary defined shapes

I was wondering how to do the following: I would like to compute the electrostatic field between two shapes using the FEM method. ...
5
votes
1answer
125 views

Piecewise Continuous Linear Basis on a Triangular Mesh

Question Given a FEM mesh, I would like to define a set of basis functions anchored to the mesh, so that any piecewise linear continuous function on the mesh can be expanded over that set. Such a ...
6
votes
1answer
255 views

Laplace equation with robin boundary conditions

I want to solve the following steady state heat transfer problem with robin boundary condition at the bottom: The following is the code for the transient solution, but how should I change the code ...
6
votes
2answers
110 views

Penalty function on discrete mesh using Laplace-Beltrami operator?

Context I am interested in extending to the ill-condionned regime the inversion of linear equations arising from inverting differential equations which have been solved via 0-splines over a mesh ...
3
votes
0answers
85 views

1-D stress (displacement) analysis in annulus by considering viscoelasticity

I am a new Mathematica user, and I was trying to solve a stress (or displacement) field problem in an annulus. Here is the problem in the polar coordinate: The inner radius of the annulus is $b$, ...
5
votes
0answers
152 views

Transition to turbulence

I found that a 3D model of viscous flow in a rectangular channel with jump section implemented on the basis of FEM demonstrates a transition to turbulence. We use an algorithm for unsteady flows ...
2
votes
1answer
128 views

How to numerically obtain the first ten eigenvalues of a 3D Sturm-Liouville problem

I'm trying to numerically obtain the first ten eigenvalues of a 3D S-L problem via NDEigenvalues but with no success. The problem is given by ...
8
votes
1answer
163 views

Why can't I use Inactive[D] in NDSolve?

I have a 2D rectangular domain with -L/2 < x < L/2 and 0 < y < D0, which is divided into two parts, with a ...
2
votes
1answer
100 views

Define indicator function of mesh elements

Context I would like to (partially) answer my own question here (ok its a bit cheesy but...) Question I am interested in defining an indicator function which value would be 1 on a cell and ...
0
votes
2answers
103 views

Poisson equation and FEM [closed]

I am trying to solve $u_{xx}+u_{yy}=-[(3x+x^2)y(1-y)+(3y+y^2)x(1-x)] e^{x+y},$ for $0<x<1,0<y<1,$ and homogeneous Dirichlet boundary conditions $u(x,y)=x(1-x)y(1-y)e^{x+y}$ by an ...
3
votes
1answer
81 views

Plotting a differential equation with boundary conditions

I have a problem with numerical calculation and plotting of differential equation. Now I set a complicated region to set a boundary condition: ...
4
votes
1answer
120 views

Using FEM and NDSolve

I have to solve the ODE $u''[t]+u'[t]+\sin {(5t)} u[t]=t^3-t$, with $u[0]=0,u[1]=0,$ with a finite element method and then with NDSolve. Finally, I have to ...
20
votes
3answers
442 views

Inverting differential equation using finite element methods

tl;dr; How to use FEM tools to extract models needed to invert PDEs. Context In astrophysics, one is interested in so-called 'cosmic archeology' which involves recovering the origin of a given ...
11
votes
3answers
337 views

Why the mesh generated for NDSolve is different from the final plotted mesh?

When I try the following code to solve the Laplace's equation, the mesh generated by bmesh = ToElementMesh[bmesh] is different from the mesh shown in ...
9
votes
2answers
235 views

FEM Mesh related errors

Bug introduced in 12.0. Fixed in 12.1.0. I try to solve the simple heat transfer equation but there are some errors at the stage of the pre-processing. ...
0
votes
0answers
71 views

NDSolve: Which method for fast moving/spreading wavepackets?

I want to model a wave-packet interacting with a non-linear potential. ...
2
votes
0answers
127 views

Normal derivative for Laplace equation [closed]

I am try to evaluate the Neumann boundary conditions for Laplace equation which define as: dy/dn, where n the external normal vector to the boundary, I have: ...
3
votes
0answers
70 views

Numerical solution for PDE [duplicate]

I have got the help from the expert ''Nasser'' to write the code for the PDE with variable coefficients and mixed boundary conditions define on a square domain: ...
9
votes
2answers
265 views

Unexpected 'switch' of partial derivatives when differentiating InterpolatingFunction

Bug introduced in 11.3 or earlier and persisting through 12.1.0 or later - Fixed in Version: 12.1.1 In short, there is a simple initial boundary-value problem for which NDSolveValue produces an ...
7
votes
1answer
171 views

FEM: how to find 2D flow under external forcing?

I'm trying to sovle a 2D Navier-Stokes equation in a rectangular region with no-flow boundary conditions and an external rotating force $f(x,y)=(-y,x)$. I've got the error message: NDSolveValue::...
3
votes
1answer
54 views

Exporting data from an Interpolating Function

Apologies if this question is repetitive, but I have browsed the questions already posed on exporting data from NDSolve and haven't been able to successfully apply the information I found to my own ...
5
votes
1answer
174 views

Problem Solving Steady-State Euler Equations in 2D Using FEM

I am working with gas flows, and my Reynolds number is very large (>10^6). Still as a toy exercise, I solve the steady-state Navier Stokes equations for my volume and it seems to work ok for Reynolds ...

1 2
3
4 5
15