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
4 votes
1 answer
141 views

Nonlinear PDE with a trivial and nontrivial solutions: how to?

I am solving the following PDE: eqMain = D[z[x, y], {x, 2}] + D[ z[x, y], {y, 2}] - (a - x/(x^2 + y^2 + 0.0001))*z[x, y] - z[x, y]^3==0; with the zero ...
4 votes
1 answer
142 views

Problem with NDSolve for 1st order non-linear system of PDEs

I wish to solve the PDE system \begin{align} x_u^2+y_u^2+\left(xx_u+yy_u \right)^2&=1\\ x_v^2+y_v^2+\left(xx_v+yy_v \right)^2&=1 \end{align} subjected to $x(0,v)=0$ and $y(u,0)=0$. However, ...
6 votes
2 answers
252 views

SolidMechanicsStress returns, that the stress is equal to zero

Bug introduced in 13.1 and fixed in 13.2.0 I am trying to compute a deformation and a stress of a material with a custom material law. I have successfully computed the deformation using ...
  • 330
3 votes
1 answer
220 views

Solving 3D Nonlinear Integral Partial Differential Equation

I am trying to solve Equation number (1.2) numerically in MATHEMATICA. This equation is solved in the papers https://arxiv.org/pdf/2205.05193.pdf, https://arxiv.org/pdf/2202.13264.pdf, and https://...
7 votes
2 answers
153 views

Create a domain for an Hexahedron with the floor replaced with an Indian Burial Mound

I am trying to create an acoustic model domain for a small park that contains an Indian burial mound. The park is laid out using a 3D cartesian coordinate system in units of meters. A Hexahedron ...
  • 2,207
10 votes
3 answers
327 views

Can NDSolve be initialized with a close solution?

I have a set of 4 first order ODE with 4 initial conditions to be met. It models a simple damped pendulum like the one described here. What changes is the damping term and I switched to first order ...
  • 933
4 votes
1 answer
115 views

Is it possible to remove an element during computation in AceFEM?

The title says it all. I know there have been a lot of enhancements in the recent versions of AceGen/AceFEM. I would like to know if there is a possibility of removing an element during computation (...
  • 1,243
10 votes
1 answer
185 views

1D diffusion problem: Troublesome NeumannValue

Bug introduced in 13.1 or earlier and fixed in 13.2.0 Mathematica solves the diffusion problem (two Neumann-conditions) ...
0 votes
0 answers
28 views

Flux boundary condition on a line using derivatives [duplicate]

I am solving a partial differential equation for heat-transport on a rectangular domain of width W and length L with fluid flow. $$ v_{max}\bigg(1-\bigg(\frac{x-W/2}{W/2}\bigg)^2\bigg) \frac{\partial ...
4 votes
1 answer
239 views

How to get the cross sectional area of a wine bottle picture/photo by doing an appropiate image processing on it?

We are working on a PDE Acoustic model in which the geometry of analysis is the cross-sectional area of a wine bottle. We want to get the geometry from a wine bottle image by doing an appropriate ...
  • 101
2 votes
0 answers
49 views

System of PDEs with coupled Neumann BC--how to use NeumannValue?

I have the following system of PDEs for functions $u_1,u_2$ in a region $\Omega\subset\mathbb R^2$: $$ \begin{cases} 2\partial_{xx}u_1+\partial_{yy}u_1+\partial_{xy}u_2-u_1=f_1 & (x,y)\in\Omega\\ \...
  • 226
5 votes
2 answers
139 views

Select part of an ElementMesh

modified For an, examplary simple, ElementMesh ...
1 vote
2 answers
122 views

NDSolve with piece-wise function and BVP

How to numerically solve a system of differential equation with boundary conditions and piece wise affine functions ? Consider the following system of differential equations from some optimal control ...
  • 11
1 vote
0 answers
73 views

Building a structure out of cubes one block at a time

I have simplified code in which the motion of a point charge is simulated N times (one particle at a time) in a static electric field. When the point charge comes to rest (using WhenEvent boundary ...
  • 363
4 votes
0 answers
158 views

Solve 3D convection-dominated PDE with discontinuous coefficient, without tiny mesh

I'm trying to simulate a self-propelled particle diffusing on a disk. The direction of the self-propelled velocity $\vec{v_A}$ doesn't change, while it speeds up at the boundary and slows down at the ...
3 votes
2 answers
179 views

BoundaryMeshRegion Error: Boundary surface is not closed

I am trying to create a BoundaryMeshRegion comprised of many cubes with random locations, in a relatively small region. I have had success implementing my technique for a smaller number of cubes (say,...
  • 363
9 votes
2 answers
434 views

Calculating the 3D magnetic vector field of a permanent magnet, with shape given by STL File

following my earlier question Link, I am trying to calculate the magnetic field of a permanent magnet. The shape of the magnet was generated with FreeCAD and is provided to Mathematica by an .STL file....
  • 797
5 votes
1 answer
234 views

Monte Carlo Simulation of Charged Particles in Non-Uniform Electric Field

I have a code (provided below) which simulates the motion of an ensemble of charged particles which are subjected to a complex static electric field which passes through some aperture in a metallic ...
  • 363
1 vote
1 answer
83 views

Different boundary conditions

I have a problem regarding the definition of multiple boundary conditions in AceFEM. I am dealing with coupled problem simulations (displacement and magnetic potential) and therefore I have to apply ...
  • 634
2 votes
1 answer
142 views

How to solve Neumann boundary ODE with shooting method?

$\rho(x)$ is the distribution function. I'm trying to solve the following equation: $D_t\frac{\partial^2\rho}{\partial x^2}-\frac{\partial (v_0\rho)}{\partial x}=0$ $D_t\frac{\partial\rho}{\partial x}-...
3 votes
1 answer
105 views

How to solve PDEs for function $\Psi(z,\bar{z})$ dependent on independent variables $z,\bar{z}$? (Wirtinger derivatives)

For the past few days, I have been struggling to convey to mathematica to solve a PDE that is in terms of the independent variables $(z,\bar{z})$. I know mathematica supports solving PDEs with respect ...
1 vote
1 answer
133 views

How to set a adiabatic boundary conditions for a convection function?

$\rho(x,t)$ is the probability function, $x\in[-1,1]$. I'm trying to solve the convection function with adiabatic boundary condition as follows: $$ \partial \rho/\partial t=D_t\frac{\partial^2\rho}{\...
4 votes
1 answer
187 views

Set Neumann Boundary Condition in NDEigensystem function

I want to get the eigenvalue and the eigenfunction of the following partial differential equation: $$ -(\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2})\psi_n (x,y) + [\frac{1}{4}(x^...
  • 41
3 votes
1 answer
257 views

Semi-classical approximation of modified Schrodinger's equation on a sphere leads to ndsz warning

I know this error is very common. I checked out a good number of proposed solutions to this problem, but unfortunately, none of them helped in my case. I would appreciate any help or hints on how to ...
  • 33
3 votes
2 answers
133 views

What bump function to use in a system of partial differential equations?

I am solving a system of three time-dependent partial differential equations on a circular domain, using the finite element method. However, in the outer part of the domain ($r>R$) the equations ...
  • 31
6 votes
2 answers
264 views

Extract 2D quad mesh from 3D hexahedral mesh

I would like to extract 2D mesh of outer surface of 3D meshed object. Let's say I have 3D mesh data from here and I import the data into Mathematica. ...
  • 611
1 vote
1 answer
97 views

It is possible to use a different stress tensor than Cauchy stress tensor when creating a custom material law?

I would like to use Mathematica to solve some solid mechanics problems, which will include an implementation of a different model than the ones that Mathematica offers. The way how to write custom ...
  • 330
4 votes
1 answer
120 views

NDSolve for Fluid Flow - Monitor Residuals

I'm using NDSolve for fluid flow and would like to monitor the convergence of the solution more closely. I have a simple stationary case set up. NDSolve should return the solutions for u,v and p. ...
  • 401
3 votes
2 answers
169 views

Inactive nonlinear ODE system results in NDSolveValue::femcnmd warning

I am currently trying to solve a set of 1D steady state ODEs using NDSolveValue in the form of Inactive[Grad] and ...
  • 181
3 votes
3 answers
158 views

Iterative pde solution NDSolve && NIntegrate

I try to solve a diffusion pde depending on a timedependent argument. Step by step I have no problem to evaluate several solutions: first step (timefunction 0): ...
3 votes
2 answers
140 views

How to refine FEM mesh for steady state 1D problem?

I am solving a system of 3 steady state 1D ODEs, however the system consists of component that has sharp changes at x = 1, which is very hard to capture. Is there a way to specifically increase the ...
  • 181
4 votes
1 answer
101 views

3D Mesh refinement near sphere boundary and on surface revolutions

I am trying to solve an advection-diffusion problem inside surface of revolutions. I have high velocity gradients near the boundary of the bounding surface. Is there a way to refine the mesh near the ...
  • 75
3 votes
1 answer
100 views

Error Meshing with ToElementMesh (ToElementMesh: Cannot set region holes.) for certain objects

I have had a problem properly meshing certain .obj files, where others are meshed successfully. Here is an example of a successfully meshed .obj: Whereas, using the code at the bottom which includes ...
  • 363
3 votes
1 answer
77 views

Keeping mesh coordinates unchanged for Implict Region [duplicate]

I am trying to generate a 3D mesh for Finite Element simulations. I need to provide some precomputed inputs to the mesh points and will like my mesh to be the same for a given shape. However, ...
  • 75
1 vote
1 answer
151 views

Getting error message "The minimal damping factor of 1/10000 has been reached"

As a very beginner into Mathematica, I encounter error message as shown below when I am solving the system of three second order ODEs numerically using ...
  • 181
4 votes
1 answer
153 views

Finding sub-regions in an STL file for Finite Element

I use an external software (Amira) to segment X-ray tomography images and then create a surface mesh which I can then import into Mathematica as an STL file. This file has two enclosed regions, ...
  • 3,683
0 votes
0 answers
70 views

Using NeumannValue in finite element method to replace a derivative boundary condition in NDSolve to overcome a computational overflow

I am trying to implement and evaluate the function GeneratePsiOfX. The definition of GeneratePsiOfX is: ...
0 votes
1 answer
119 views

Finite Element NDSolve with input data at node points

I am trying to solve a steady-state advection-diffusion problem of the following form: $-D \nabla^2 T + \nabla \cdot (\mathbf{u} T) = -1$. I will be solving this problem in a 3D geometry (typically ...
  • 75
3 votes
1 answer
120 views

Solve PDE with consraints

I am trying to solve the following problem of the free fall dynamics under gravity of a inextensible horizontal string attached at its end, in a 2D vertical plane. If I'm right, that is the governing ...
1 vote
1 answer
213 views

Properly Updating Particle Motion in 3D Electric Field Simulation

I have a code (very bottom of post) which plots a static electric field as it passed through some metal sheet with an aperture in it. I seek to observe the motion of some N charged particles (point ...
  • 363
1 vote
0 answers
77 views

Transient darcy flow equation

I can solve the following stationary Darcy problem: $div(\nabla u)=1$ with $ u = 0 \in \Gamma_d$ ...
  • 2,820
0 votes
0 answers
62 views

Meshing Error on Imported obj file

I am trying to import a .obj file to be used in a static electric field simulation. I am able to successfully run the simulation with certain other aperture geometries (see here: < https://www....
  • 363
1 vote
0 answers
73 views

Simulating the Response of Charged Particles to Apertures with Inhomogeneous Electric Fields Passing through them

I have produced a simulation which allows me to observe a static electric field produced by a charged plate as it passes through some complex apertures in a different, oppositely charged metal plate. ...
  • 363
3 votes
2 answers
109 views

Defining Dirichlet Boundary Conditions on an Imported 3D Object with Apertures in it

I am trying to simulate a static electric field (in 2d and 3d) as it passes through a couple of apertures in a 3D "metal sheet" (model imported as a .obj file) given here: https://www....
  • 363
5 votes
1 answer
84 views

NDEigensystem: 1D problem with discontinuous coefficients

I am trying to use NDEigensystem to solve the 1D problem -cs[x]^2 vx''[x] = w^2 vx[x] with vx[x] and w the eigenfunction and eigenvalue. The coefficient cs[x] is discontinuous at x = -xp, +xp and vx[x]...
0 votes
1 answer
181 views

How to solve 2D Heat equation on rectangle with NDSolve?

I am trying to solve the 2D heat equation $$\Delta u =u_t$$ with Dirichlet boundary conditions on the rectangle $(0,a)\times (0,b)$ and with initial condition $u(x,y,0)=g(x,y)$. This is my code ...
  • 125
6 votes
2 answers
328 views

NDSolve for Laplace equation on disk is not working

I want to solve the laplace equation on the disk using NDSolve. Particularly I want to solve the problem $$\frac{\partial^2 u }{\partial r^2 } +r^{-1}\frac{\partial u }{\partial r }+r^{-2}\frac{\...
  • 173
1 vote
1 answer
132 views

PDE with tangential derivative condition along boundary. NDSolve not working

I'm considering the following PDE $$ \begin{align} \left[\cos\theta\frac{\partial}{\partial r}-\frac{\sin\theta}{r}\frac{\partial}{\partial\theta}\right]\left[\sin\theta\frac{\partial}{\partial r}+\...
8 votes
1 answer
490 views

Droplet of water-alcohol mixture spreading due to evaporation-caused surface tension gradient

I am trying to solve a coupled system of PDEs for 2 functions h[t,r] and c[t,r], with initial conditions of ...
4 votes
0 answers
111 views

FEM: modelling 2D flow under periodic forcing

Despite many examples of periodic boundary conditions being presented, it remains difficult to obtain a periodic solution. Let us consider a simple example of a flow in a two-dimensional channel under ...

1 2
3
4 5
28