All Questions
11,377
questions
1
vote
0
answers
66
views
Combining fluid flow solver based on lattice Boltzmann method with a mechanical deformation solver based on finite element method
I'm thinking to couple my fluid flow solver based on lattice Boltzmann method with a mechanical deformation solver based on finite element method to take account for solid deformation in my models. In ...
1
vote
0
answers
99
views
B-splines least squares with equality constraints
Can someone recommend the best way to solve a least squares fitting problem with B-splines, with additional equality constraints? I want to solve:
$$
\min_x || b - A x ||^2, \textrm{subject to: } C x =...
1
vote
0
answers
52
views
Efficient numerical optimization of an "almost separable" function
I have come across an optimization problem with the following objective function:
$$f(x_0,y_0,z_0,x_1,y_1,z_1,...,x_N,y_N,z_N) = \sum_{i=0}^N f_i(x_i,y_i,z_i, \alpha(x_{i+1}-x_i) + \beta(y_{i+1}-y_i))...
1
vote
0
answers
45
views
Maple: patmatch does not identify patterns inside diff() operator
I understand that the function applyrule uses patmatch to identify patterns and apply transformations accordingly.
Suppose, I ...
1
vote
0
answers
52
views
The sign of Schrodinger equation
I have a question for the format of Schrodinger equation
$$\psi(x,t) = \int_0^\infty c_n e^{-iE_nt/\hbar} \psi_n(x)$$
Why do we have $i$ instead of $-i$?
1
vote
0
answers
545
views
Inflow and outflow boundary conditions for advection-diffusion equation
I'm trying to solve this advection-diffusion equation (ADE):
$$\frac{\partial \phi}{\partial t} + \nabla \cdot (-D \nabla \phi + \mathbf{u} \phi) = 0$$
In fact, this ADE framework is coupled to a ...
1
vote
0
answers
225
views
Use of Morton Key to reduce number of grid points
I asked a question on Stack Overflow Performance Issue with VP Trees and Nearest Neighborsand I was not satisfied with the answer and so I thought I would reword my question for this site and post ...
1
vote
0
answers
58
views
Methods to compute specific eigenvector components for a tridiagonal matrix
I have an application that is somewhat similar to the situation of computing Gaussian quadrature nodes and weights: simply put, I need to compute the eigenvalues and the last two (normalized) ...
1
vote
0
answers
30
views
Algorithm for integrating a 6D function in a Morse-Smale 3D cell
Lets say that one has a scalar field defined in 3D space for whose gradient he wants to find the Morse-Smale Complex for later performing an integration of several hexa-dimensional functions over ...
1
vote
0
answers
566
views
Maintain sorted ring buffer [closed]
I would like to insert elements into a ring (circular) buffer one at a time and maintain a permutation array which keeps track of the sorted elements in ascending order. To do this, I have adapted the ...
1
vote
0
answers
467
views
What does the Jackson Kernel measure?
A certain filter I'm writing uses two different kernels. The Fejer kernel (which is common) and the Jackson kernel:
$$ \Delta_T(x) = T \,\left( \frac{\sin \pi T x}{\pi T x}\right)^2 \quad\text{and}...
1
vote
1
answer
236
views
Algorithm to find most similar elements in several groups
I'd like to find an algorithm that can solve the following problem:
Consider 4 groups of numbers:
Group 1: [10, 100, 1000],
Group 2: [101, 15, 2000],
Group 3: [20, 1500, 100],
Group 4: [150, 3000, ...
1
vote
0
answers
48
views
How to analyze the dispersion and dissipation of a certain FEM?
In Finite Difference method or Finite volume textbook. Dispersion/Dissipation can be analyzed by set $u = u_0\exp{\omega t +\mathbf{kx}}$。
However, I cannot find something about this kind of analysis ...
1
vote
0
answers
98
views
Basic approach for numerical solution of PDE
I'm looking for some guidance on how to write a program to numerically solve a PDE. As an example for comparison in 1D:
$$\frac{d^2u}{dx^2} = f\;\;\;\;u(0) = 0\;\;\;\;u(1) = 0$$
We could try 6 ...
1
vote
0
answers
63
views
Understanding design patterns [closed]
I read some books and scoured the web about design pattern,but almost all ways of expressing design patterns are the same. They define what is it,draw UML and give an example,but what I want is to ...
1
vote
0
answers
55
views
What is the finite-difference representation of the Laplacian operator with periodic boundary conditions? [duplicate]
I am using a central-difference scheme to solve the eigenvalue problem
$$\frac{d^2}{dx^2}u = \lambda u$$
on a unit interval with periodic boundary conditions. My understanding is the eigenvectors $...
1
vote
0
answers
1k
views
Which solvers for BVP in python are the best? Is there something better that scipy.integrate.solve_bvp?
I am trying to solve a boundary value problem with Python. I have been using scipy.integrate.solve_bvp but the result that it is giving me is completely wrong. Basically my code is as follows:
...
1
vote
0
answers
84
views
How to model a non-linear least-squares problem for triangles
I have a non-linear least-squares problem to solve and with my current modeling, the solver is either very slow or does not converge to a correct solution.
For the problem, I need to minimize energy ...
1
vote
0
answers
38
views
How to numerically transform a 2D Fourier spectrum with arbitrary frequency shift to center frequency?
Suppose $F(u,v)$ is the center frequency Fourier representation of some $f(x,y)$ in 2D.
$$
f(x,y)=\int\limits_{-\infty}^{\infty}\int\limits_{-\infty}^{\infty}F(u,v)e^{2\pi i (xu+yv)}dudv
$$
In ...
1
vote
0
answers
95
views
Equal area algorithm to find shock location
I am looking to solve 1D burgers equation with various random initial conditions. What is the best algorithm to find the exact solution?
One method that is covered in literature is the equal area ...
1
vote
0
answers
34
views
Best Possible Convex bounds for optimization problems
Suppose we have a primal problem
$$
p^{*}=\min_x f(x), \\\text{s.t.}~~ h_i(x) \leq 0,
$$
where $f(.)$ and $h_i(.)$ are possibly non-convex.
Then its Lagrangian is
$$\mathcal{L}(x,z_i)= f(x) + \...
1
vote
0
answers
149
views
$ A * B $ computation when B is a symmetric matrix in armadillo [closed]
Is there any way to multiply a symmetric matrix by a dense one in armadillo(and use the fact that we have a symmetric matrix)? I know about DSYMM Routine in BLAS,...
1
vote
0
answers
347
views
Getting started with FEM: Ill-conditioned matrix when evaluating flux terms in conservation law?
I have a system of conservation laws of the form
$$ \frac{\partial \mathbf{q}}{\partial t} + \nabla \cdot \mathbf{F}\!\left(\mathbf{q}\right) = 0 $$
I want to use finite elements to solve this ...
1
vote
0
answers
66
views
Efficient initial identification of solid or liquid domains for a block structured Cartesian grid generation system
INTRO
Within the last 5 days I was able to generate a block structured Cartesian grid
generation system with a combination of Fortran,C++ and Python.
I am running intersection tests of the ...
1
vote
0
answers
140
views
Finite difference methods for coupled 2nd order nonlinear pdes
I have a system of coupled nonlinear PDEs that I cannot figure out how to solve in a smart way using FDM, so I was hoping someone here might have a clue.
The equations go as:
\begin{align*}
\frac{1}{...
1
vote
1
answer
296
views
PBS: Using different computational resources on different nodes
I am using an HPC cluster to launch parallel simulations. At the moment, there are 48 free cores over 4 nodes but not each node do not have the same number of free cores. The distribution is something ...
1
vote
0
answers
54
views
Space covering optimization
I have the following problem:
In the space $E=\{1, 2, \dots, N_x\} \times \{1, 2, \dots, N_y\}$, I want to define $N_R$ rectangles $R_k=\{x_k^0, \dots, x_k^1\}\times\{y_k^0, \dots, y_k^1\}$ which ...
1
vote
0
answers
179
views
Algorithm for group forming: as individual or in a preformed group
I have 20-80 users and 5-10 events with varying ranges of minimum and maximum number of free seats (2-4, 3-5, 2-6...). For example, with a range of 3-5 it is acceptable to only assign three users to ...
1
vote
0
answers
69
views
Fixed point iteration reduction factor
In a book for solving a nonlinear differential equation with $N+1$ points, $u_{xx} = e^{u}, u(-1)=u(1) = 0$, in $[-1,1]$ with homogeneous Dirichlet boundary conditions, the fixed point iteration is ...
1
vote
0
answers
119
views
How to make supercell of partial occupancies for DFT?
In the case of partial occupancies (for example, this CIF), a supercell should be made for DFT calculations. However, numerous supercells can be built from a lattice (in the above example, 200 ...
1
vote
0
answers
159
views
computing dual matrix trace norm and tensor gradient in python
I'm trying to write the following function in python:
$$
f_\mu(\mathcal X) = f_0(\mathcal X) + \sum_{i = 1}^n \max_{||\mathcal Y_{i(i)}|| \leq1} \alpha_i\langle \mathcal X_{(i)},\mathcal Y_{i(i)} \...
1
vote
0
answers
57
views
Decrease in slope during convergence analysis
I am using the method of manufactured solutions to perform the order of accuracy testing. I am using a cube for the testing. The cube is size 1m on all sides.
I used 5 refinements:
$dx = dy = dz = ...
1
vote
0
answers
49
views
Limit to volume change in a discretized mathematical model?
I have set up a mathematical model describing the diffusion of ozone out of a gas bubble. The bubble is surrounded by a thin gas film. So actually, the model describes the diffusion of ozone through ...
1
vote
0
answers
213
views
Method of manufactured solutions - choice of type of boundary conditions
I am attempting to use the method of manufactured solutions (MMS) for code verification for linear elasticity. However, this is more of a general question regarding the general use of MMS.
In MMS, ...
1
vote
1
answer
68
views
FE discretisation of normal to displacement vector
Having shape functions $N_i(\xi,\eta), i = 1,...,N_n$ and, a normal vector $n = (n_x,n_y,n_z)$, a thickness function $F_\tau (\zeta), \tau = 1,...,N_\tau$ and nodal variables $\mathbf{Q}_u = (Q_u,Q_v,...
1
vote
0
answers
66
views
Jacobian Elements for Coupled Drift-Diffusion System using Vertex-Centered Finite Volume
I'm trying to solve the fully coupled drift-diffusion system using Newton's Method. Although I eventually plan to potentially use a Jacobian-Free Newton-Krylov approach, this is still something that I ...
1
vote
0
answers
87
views
fourth order Poisson iterative solver --in Matlab
I want to calculate the stream function $\psi$ starting from a velocity field $(u,v)$ (such that $u=-\frac{\partial\psi}{\partial y}$ and $v=\frac{\partial\psi}{\partial x}$). I thus calculate the ...
1
vote
0
answers
286
views
Neumann boundary condition FD implementation for instationnary diffusion equation
I am trying to solve this diffusion equation :
$\dfrac{\partial D\dfrac{\partial f}{\partial x}}{\partial x}+S = \dfrac{\partial f}{\partial t}$ ($D$ is not constant and varies according to $x$) with ...
1
vote
0
answers
461
views
Global truncation error behavior at fixed time step
I am trying to solve the following diffusion equation problem:
$\frac{\partial f}{\partial t}=\frac{\partial (D\frac{\partial f}{\partial x})}{\partial x}+S$
$D=1+x^{2}+\sin(x)$
$f(x,0)=1 , f(0,t)...
1
vote
0
answers
61
views
Numerical analysis: Chebyshev coefficient representation error
If $x_k$ are the Chebyshev nodes, that is for $n \in \mathbb{N}^*$, we have $x_k = \cos(\pi \frac{2k + 1}{n})$. Now suppose you have approximated values of $x_k$ and $x_{k'}$ for $k,k' \leq n$. In the ...
1
vote
0
answers
79
views
Stokes flow around rigid body
I'm trying to simulate Stokes flow in 2D around an arbitrary polygon (representing a rigid body). I'd like to get both the effect of the body on the flow velocity and the forces on the body by the ...
1
vote
0
answers
70
views
How does the MADS algorithm work in practice
Mesh Adaptive Direct Search (MASH) is an algorithm for black box optimization
I want to understand an implement this method to solve some 2D multivariate blackbox function $f(x,y)$, but am having ...
1
vote
0
answers
37
views
fitting exponential versus exponential w/ power
I have two models which I would like to investigate for my data. One form is:
\begin{equation}
\label{one}
f(r) = A e^{-B r}
\end{equation}
and the second is:
\begin{equation}
\label{two}
g(r)...
1
vote
0
answers
77
views
Magnetostatic modelling Radia: Increasing distance between magnets a produces positive force until a certain point, beyond which force goes haywire
I have two sets of magnets. One set consists of two electromagnets (Shown below: Blue) and the other set consists of two NdFeB N40 permanent magnets. Both sets of magnets lie on the same plane. I want ...
1
vote
0
answers
49
views
Genetic Algorithm: Need some clarification on selection and what to do when crossover doesn't happen
I'm writing a genetic algorithm to minimize a function. I have two questions, one in regards to selection and the other with regards to crossover and what to do when it doesn't happen.
Here's an ...
1
vote
0
answers
862
views
Alternatives to Newton-Raphson for nonlinear elasticity via finite element
As far as I have seen, solving problems of nonlinear elasticity using the finite element method proceeds by linearizing, either around the initial configuration (total Lagrangian approach) or around ...
1
vote
0
answers
489
views
Levenberg-Marquardt for root-finding: just square the function?
This question might be so obvious and trivial that I'm having a hard time googling it.
I have a multivariate root finding problem that I'm trying to solve in C# and the library that I'm trying to use ...
1
vote
0
answers
17
views
Procedure to identify characteristic properties of unknown functions in a DAE model
I have a system of 1st order odes given by
$$
\dot{x_1}(t) = \alpha_1 f_1(x_1,t) + \beta_1 u(t) \\
\dot{x_2}(t) = \alpha_2 f_2(x_2,t) + \beta_2 u(t)
$$
They are constrained by an algebraic equation
...
1
vote
0
answers
35
views
What is the inverse Laplace transform algorithm that is most accurate given the fewest frequencies considered?
Based on your empirical knowledge.
This paper suggests a nonlinearly accelerated Fourier series approach, such as the one proposed here, but I have one constraint: we should be able to express the ...
1
vote
0
answers
82
views
Radially symmetric system of PDEs in deal.II
I am trying to solve the radially symmetric polar form of the PDE with homogeneous Neumann BC in deal.II on a unit circle:
$$ u_t = \Delta u - \nabla \cdot (u \nabla h) $$
$$ h_t = \Delta h $$
I am ...