instruction stringlengths 43 28.1k |
|---|
Many players in the field of engineering simulation software are investing on digital twinning and reduced order modeling techniques, meaning that the field bears potential.
I was wondering if among the various subflavours - POD, reduced basis... - there is one in particular that is spreading more than the others, or t... |
Consider the following equation, subject to homogeneous Neumann boundary condition.
$$
u_t = \Delta u + f(u).
$$
The weak formulation is as follows:
$$
(u_t,w) = (\Delta u, w) + (f(u),w), \quad \forall w \in H^1(\Omega).
$$
The standard finite element scheme is:
$$
(u_{h,t},w_h) = (\Delta_h u_h, w_h) + (f(u_h),w), \q... |
Consider
$$\begin{aligned}
\partial_t v + b\cdot \nabla \phi &=0 \\
\partial_t \phi + b\cdot \nabla v &= 0
\end{aligned}$$
for $v:(x,y)\mapsto \mathbb{R}$, unknown and time-dependent ($\phi$ similary), and $b\in \mathbb{R}^2$ given, and divergence-free. A weak form in $H^1$ is
$$\begin{aligned}
\int \partia... |
I have a simple questions on terminology. Is there a difference between softening length and smoothing length? I have been using the 2 terms interchangeably as the minimum distance between particles for calculating particle interactions, and have not found any direct comparison of the 2 terms.
For context, I use comp... |
Suppose $\mathbf{x}$ is a random variable in $n$ dimensions, and $u$ is a vector. How can I estimate the following quantity in an online fashion?
$$f(x)=\max_{\|u\|=1} \frac{ E\left[\langle u\cdot x\rangle ^4\right]}{E\left[\langle u\cdot x\rangle ^2\right]}$$
For a simpler problem of finding $\operatorname{argmax}_{\|... |
Need help with the code to estimate the Madelung constant for CsCl lattice:
Cs at (0,0,0)
Cl at (0.5, 0.5, 0.5)
Answer: Converged value I am getting is 0.465. However, the correct answer is approximately 1.763.
What am I doing wrong? Code as below.
M = 0
L = 10
for i in range(-L,L+1):
for j in range(-L,L+1):
... |
I am looking into the finite volume method and I have come to a problem with discritisation. Suppose I am looking at a particular cell(I'm dealing) with cartesian grid. at the points $(X_{i},Y_{j}),(X_{i+1},Y_{j}),(X_{i+1},Y_{j+1}),(X_{i},Y_{j+1})$. Call the edges of the call $e,n,w,s$ using the usual notation for FVM.... |
In Python / Matlab, if you run a routine for SVD on a significantly non-square matrix, X, such as X.shape = (2,15000) you will get significantly longer run time than on a matrix with X.shape = (800,1000), even though 2*15000 = 30000, and 800*1000=800000.
That is the second matrix clearly has much more terms with which ... |
Suppose that we have a $n\times n$ matrix $A$. We have its LU-factorization as $A=LU$ (or $PA=LU$ that $P$ is a permutation matrix). Now assume we change the last column of matrix $A$ and denote the new matrix as $A^\prime$. What is an efficient algorithm to find the LU-factorization of $A^\prime$ as $P^\prime A^\prim... |
I am here once again searching for wisdom, as some of you might notice I asked a related question a few days ago. And now I am struggling to add a forcing term at the center of the membrane, in order to recreate the Circular Chaldni figures, unless as at first approximation.
The idea is that with my original code see w... |
I wrote this code to find Cholesky factorization of a symmetric positive definite matrix in MatLab:
function L = cholesky(A)
n = length(A);
L = zeros(n, n);
for i=1:n
l = L_solver(L(1:i-1, 1:i-1), A(1:i-1, i));
L(i, 1:i-1) = l;
L(i, i) = sqrt(A(i, i) - l.'*l);
end
end
Which L_so... |
Consider $n$ apps and $m$ transactions. $x_{ij}$ is a binary variable, it takes 0 or 1. $x_{ij}$ takes 1 if $i$th app is used for $j$th transaction, else 0.
min $\sum_{i=1}^{n}\sum_{j=1}^{m} x_{ij}$
subject to
$\sum_{j=1}^{m} x_{ij} \leq 0.25m$
$\sum_{i=1}^{n} x_{ij}$ = 1
$\forall i'$ max($x_{i'j}$)=1
$i'$ = apps thro... |
For a project I'm working on, I was working with the following equation
$$
w(x) = \int k(x,y)v(y)dy
$$
I noticed that if I choose
$$
k(x,y) = -\delta'(x-y)
$$
Then we probably get (I haven't touched Dirac delta functions for years, please correct me if I am wrong.).
$$
v'(x) = -\int \delta'(x-y) v(y)dy \tag{1}
$$
Wher... |
I am doing some simulations on various systems expressed in 2nd quantization and one of the points of interest of mine was Phase transitions in the Bose-Hubbard model
$$
H = \sum_{k} \{ t_k(b^\dagger_{k} b_{k+1} + b_{k} b^\dagger_{k+1}) + U(n_{k}^2 - n_{k}) + \mu n_{k} \}
$$
Assuming a linear chain where the bosons are... |
Cross posted on StackOverflow
I am trying to use the gsl library for calculating 1F1. I have some C code.
The following works and matches Mathematica's results for small real arguments z but not large arguments:
/* file 1F1.c */
#include <stdio.h>
#include <stdlib.h>
#include <gsl/gsl_sf.h>
#include <gsl/gsl_math.h>
... |
I take a plot of father wavelet with this code
library(wavethresh)
y <- c(1,1,7,9,2,8,8,6)
ywd <- wd(y, filter.number=1, family='DaubExPhase')
plot(ywd)
But the terminal returns:
7 7 7
what this 7 7 7 mean?
I try to search in the documentation (link) but without success.
Thanks.
|
I am trying to solve a linear system of ODEs of the form:
$$ \frac{du}{dt} = A u, \quad u(0)=k$$
where $A$ is a 2x2 matrix and $u(t)$ is a 2x1 column vector. I want to solve this numerically, using Euler forward scheme, which means that I will use finite differences to approximate the above equation this way:
$$ \frac{... |
I am dealing with the integro-differential equation for Wigner function,
$$\frac{\partial f}{\partial t}+p\frac{\partial f}{\partial x}+\\+\frac{1}{\chi}\left\{\int_{-\pi}^{+\pi}dy\,\int_{-\infty}^{+\infty}dk\,V(y)f(y,k,t)\right\}\left[f\left(x,p-\frac{\chi}{2},t\right)-f\left(x,p+\frac{\chi}{2},t\right)\right]=0.$$
He... |
I'm given the 1-step implicit scheme $$y_{n+1} = y_n + \frac{h}{6}[4f(t_n, y_n) + 2f(t_{n+1}, y_{n+1}) + hf'(t_n, y_n)],$$
where $y'(t) = f(t, y)$, and I'm seeking the scheme's local truncation error. I've been able to use a Taylor series to get that
$$e_n(h) = hy'(t_{n+1}) - \frac{h^2}{2}y''(t_{n+1}) + O(h^3) - \frac{... |
What would be the approach to numerically solve for $\rho(x,t)$ the following equation with some initial conditions
$$\frac{\partial\rho}{\partial t}
+\sum_{i=1}^n\left(\frac{\partial(\rho g_i)}{\partial x_i}\right)=0,$$
where $x = [x_1 ... x_n]^T$, $\dot{x}=g(x,t)$ and $g(x,t) = [g_1(x,t) ... g_n(x,t)]^T$ is given?
Th... |
Im currently using a MUSCL scheme with a rusanov flux and Van Leer limiter to simulate the 2d euler equations:
$$ \frac{\partial \rho}{\partial t} + \frac{\partial \rho v_x}{\partial x} + \frac{\partial \rho v_y}{\partial y} = 0 $$
$$ \frac{\partial \rho v_x}{\partial t} + \frac{\partial (\rho v_x^2 + P)}{\partial x} +... |
Upon solving the 2D wave equation with Neumann boundary conditions $u_x = u_y = 0$ on a rectangular $10 \times 10 \times 10$ grid, I noticed something odd - $u$ seemed to shift upwards with time. This can be demonstrated with the following plot of two time slices:
In fact, the value of $u(x, y, t)$ shifted on average ... |
I am studying knowledge related to lumped mass finite elements. As is well known, lumped mass finite element methods higher than 2nd order on simplex mesh require the construction of new function spaces (here).
Specifically, on elements in the $k$-th order space, it is necessary to add bubble functions of order $k^{\pr... |
Setup
The 1D convection-diffusion equation is given by:
\begin{equation}\tag{1}
\frac{\partial u}{\partial t} + v \frac{\partial u}{\partial x} - \mu \frac{\partial^2 u}{\partial x^2} = 0,
\end{equation}
where $u$ is the solution variable, $v$ is the convection velocity, and $\mu$ is the viscosity coefficient.
Spatial... |
I am attempting to implement a model outlined in this paper:
General magnetostatic shape–shape interactions
Background
This model allows the calculation of magnetostatic interaction energies between objects of arbitrary shape. In the model, an object is defined as a three-dimensional array $D(\pmb{r})$ which is equal... |
I am trying to simulate data using parameters from a glmer() model output. The model, which comes from a published paper, is as follows: DV ~ 1 + group* sex *verb type + trial number + (1 |participant) + (1 | stimulus). All three IVs (group, sex and verb type) comprise 2 levels and are deviation coded so that, for inst... |
I tested my conjugate gradients implementation with float and double precision and contrary to my guess the double code was twice faster than the single precision code. The reason is that I need many more iterations to achieve the same residual. Mind you, that was already on a pretty small system of about just 2000 unk... |
I have an array of data whose columns are solution vectors to a system of ODEs at a specific time. I want to plot the power spectrum of a solution at a specific time, but when I attempt this I get unexpected results. I want to make sure I am plotting correctly.
First of all, I follow Matlab's format for storing the spa... |
I am trying to implement the below description from Ch. 11 of Heath's "Scientific Computing An Introductory Survey" of the Gauss-Seidel iterative method for solving a system of linear equations
\begin{align}
x^{(k+1)} &= D^{-1}(b - Lx^{(k+1)} - Ux^{(k)})\\
&= (D+L)^{-1}(b - Ux^{(k)})\,
\end{align}
However, I must be mi... |
Cross-posted on MMSE (Matter Modeling Stack Exchange).
The following are the movements of the center of mass of a polymer chain over time in a monte carlo simulation.
# cm-X cm-Y cm-Z
9.507 21.232 9.910
9.092 18.427 7.308
7.994 14.856 4.675
0.533 12.138 -1.163
-0.056 6.735 -5.470
-2.138 4.950 -7.280
0.736 13.0... |
I'm solving the following for $X$ with $A,B$ singular positive semidefinite matrices.
$$AX + XA = B$$
Because $A$, $B$ are singular, standard Lyapunov solver fails
However, if I heuristically skip dividing by 0 elements in Matlab implementation of the Lyapunov solver, I get the same answer as the least squares solution... |
Suppose I'm solving $Ax=b$ using row-action method like Kaczmarz for $m\times n$ matrix A with $m\approx \infty$ and have $H_k=\frac{1}{k}A_k^T A_k$ which is an estimate of the Hessian obtained from random $k$ rows of $A$.
How should I use $H_k$?
The problem of diving by $H_k$ is that it appears to underestimate the va... |
So what I am trying to do is to minimize the distance between the Frobenius norm of a PSD matrix and a real positive value, which can be formulated as
$$\min \left|\|\textbf{P}\|_F - J\right|^2$$
where $\textbf{P}$ is the PSD matrix to be optimized and $J$ is a real positive constant. Then the problem here is that the ... |
To start with, I need to solve this partial equation numerically, but I do not know how to do that. If I try a finite difference method, I face a problem that $u_{i,j}$ is also located in exponential, consequently, there is no way to find $u_{i,j}$.
I tried this fragmentation: $$\frac{u_{i+1,j}-2u_{i,j}+u_{i-1,j}}{\Del... |
I was wondering about the symmetry axis boundary condition in commercial CFD solvers such as ANSYS Fluent.
If the problem is the flow through a round pipe or out of a round nozzle, it is natural to set up a solver in axisymmetric space. That means a 3D flow domain $(x, r, θ)$ can be sliced along the $θ$ direction to pr... |
I am reading "Domain Decomposition: Parallel Multilevel Methods for Elliptic Partial Differential Equations" (Smith 1996), and I am confused as to how the below Alternating Schwarz algorithm (algorithm 1.1.2 from Smith 1996), specifically the term $v$ would be incorporated into a preconditioned krylov method (e.g., con... |
I have a problem to resolve with the Finite Difference method in $[a,b]$:
$$-\frac{d}{dx}(\alpha(x)\frac{du}{dx})= g(x),$$
with $\alpha(x) \in L^{\infty}$ continuous in $]a,c[$ and $]c,b[$ and discontinuous at $c$, $\alpha_{*}< \alpha(x)<\alpha_{**}$, $g \in L^2$, and $u \in C^4([a,b])$.
I want to resolve it with the F... |
i am performing parameter identification for a non-linear partial differential equation (elasticity) that I solve with finite elements.
My optimization problem is a non-linear least squares data-fitting problem because I want to fit the parameters to measured data, e.g. coming from Digital-Image-Correlation. The residu... |
Just as an exercise, I am numerically solving the following system of equations:
$$
\begin{equation}
\begin{cases}
x^2 + y^2 = 32 \\
3x + 7y = 15
\end{cases}
\end{equation}
$$
I use the following code:
from scipy.optimize import root
nfev = 0
def fun(x):
global nfev
nfev += 1
return... |
I have a set of 6 nonlinear equations, and using Sympy I find the values of the 6 unknowns. This works perfectly and it directly gives the exact solution, using sympy.solve to be specific. Now I actually have a minimum of 26 equations, and the issue is that once I try to solve for above 6 equations, like 11 equations l... |
I am dealing with an assignment in MATLAB. It has to do with 'self-driving' cars which are driving in-front/behind eachother. Assuming M cars on a single-lane road, each car adjusts its speed based on the distance to the one in front of it. The positions are governed by the following (numerical) differential equations:... |
everyone.
I am a beginner in Numerical mathematics, I have some idea of how to use Galerkin method to solve PDEs numerically, but so far I had no luck finding an example of how to solve a simple PDE using cubic Hermite polynomials. If you could help me out and provide an example of how to solve some poisson equation us... |
I am trying to solve the in-homogeneous Helmholtz equation with damping and forcing using finite element method (FEM) with FEniCSx. The equation is;
$c^2\nabla^2p - c^2\omega i d \nabla^2p + \omega^2 p = f$
where the $d$ is the damping parameter, the $i$ is complex number, the f is the forcing, the $\omega$ is the eige... |
Suppose I have $k$ pairs of $(a,b)$ where $a$ and $b$ are vectors in $\mathbb{R}^d$, $Y$ is $d\times d$ and I need least squares solution for $X$ in the following
$$\sum_{(a,b)}^k b a^T (b^T X a) = Y$$
This is equivalent to $d^2\times d^2$ linear system $\sum_{a,b} (a\otimes b)(a\otimes b)^T$ , but I need an estimate... |
Consider a vector $v$ in $\mathbb{R}^{n\times1}$. The Householder matrix is defined as follows:
$$H(v)=I-\dfrac{2vv^T}{v^Tv}.$$
It can be demonstrated that $H(v)$ is symmetric and orthonormal. The challenge lies in identifying a vector $v$ for two vectors $a$ and $b$ that are not collinear (i.e., $a\neq\alpha b$ for an... |
Backround
The mathematical model I am trying to numerically solve models wave propagation inside a cylinder with specific material properties suited for dynamic loading. The cylinder's upper base is under the impact pressure of a rigid body, while the lower base is fixed (as presented in the picture below):
Model
In i... |
I have experience with LAPACK (direct solvers) and ARPACK (sparse iterative solvers), but are there any sparse direct solvers? I am concerned more with preserving space than with fast solutions. ARPACK is fast when it converges, but seems to struggle when many eigenvalues are degenerate.
|
I am using the Levenberg-Marquardt method for calibration purposes. Typically, the RMSE of my calibration looks like:
I want to break the algorithm when the algorithm step-updates start to slow down, which is when the RMSE flat-lines at $\approx 150$. But the issue is at the start $\approx 1$ to $5$, the incremental s... |
In one dimension there are two types of quadrature schemes.
asymmetric rules like Newton-Cotes like formulas (Trapezodi, Simpson), and Clenshaw-Curtis place sampling points on boundary of the interval.
symmetric Gaussian Quadrature use only internal points which never tough the boundary.
Clear advantage of asymmeric ... |
Now, we consider a non-orthonormal basis:
$$\mathcal{S}_N=\{|\alpha\rangle,a^\dagger|\alpha\rangle,a^{\dagger 2}|\alpha\rangle,\ldots,a^{\dagger N}|\alpha\rangle\},$$
where $|\alpha\rangle$ is the coherent state and $a$ is the annihilation operator of bosonic mode.
Then, we assume $|\phi_m\rangle=a^{\dagger m}|\alpha\r... |
I want to simulate some frictional contact problems, but I'm not familiar with this field, could you please recommend some new books as introductions?thank you
|
I am trying to use matlab and YALMIP to solve a graph learning problem of recovering eigenvalues from the eigenvectors of the covariance of sampled graph signal data. This is to implement the algorithm in https://graphex.mit.edu/sites/default/files/documents/2017_Poster_Segarra.pdf. A better explanation is their paper ... |
One beginner's question about discretization of a Hamilton-Jacobi equation(non-linear)
$$
u_t = H(u_x)
$$
$u_x$ is discreated with 2nd order ENO-FD
1st order: $D_1^{\pm}u = \pm [u_{x\pm1} - u_x ] / \Delta_x$
2nd order:
$$D_2^{\pm}u = D_1^{\pm}u \mp \frac 1 2 \Delta x \{\min[ \max (D_1^{\pm}D_1^{\pm}u,0),\max(D_1^{-}... |
I would like to numerically solve the following heat equation problem:
$$ u_t = \Bigg(2{a \over l}\Bigg)^2 u_{xx} \tag 1$$
$$ x \in [ -1, 1 ] \tag 2$$
$$ u(x, 0) = 0 \tag 3$$
$$ u(1, t) = A \sin \Bigg({a^2 \over l^2}t\Bigg) \tag 4$$
$$ u_x(-1, t)=0 \tag 5$$
$$ u(x, 0) = 0 \tag 6$$
where $u(x,t)$ is the heat function, $... |
If I numerically compute the envelope of $\sin(\pi t)$ using a Hilbert transform, I obtain exactly what I expect:
If I do the same for $\mathrm{sinc}(t)$, still I obtain an envelope which agrees with my intuitions:
However, if I try to find the envelope of a Gibbs oscillation using the Fourier series for the Heavisid... |
I'm trying to implement mesh in Google colab from gmesh tutorials.
I have an error: Exception: Fltk not available
My code is:
try:
import google.colab # noqa: F401
except ImportError:
import gmsh
else:
try:
import gmsh
except ImportError:
!wget "https://fem... |
I have been using the QR-based approach on this link to find the null space of rectangular matrices, and possibly sparse matrices, that emerge as a result of some coupling conditions of different domains such as interface compatibility conditions. I am also aware of this link where some other people suggest some effici... |
In Scipy's solve_ivp documentation, we see the method argument can be either a string or a user-defined OdeSolver inherited from scipy.integrate._ivp.base (source code). I tried to create my own OdeSolver class and pass it into solve_ivp as follows:
from scipy.integrate._ivp.base import OdeSolver
### not actually cha... |
Suppose I have a 2D advection equation $$\frac{\partial \rho}{\partial t}=-\nabla\cdot(\vec{w}\rho)$$ with $\vec{w}=(u,v)$ non-constant and having zero divergence. I want to numerically solve this equation, but the scheme that I am currently using does not conserve mass. I am quite new to this topic. My question is:
a... |
Say I have two sets of variables $x$ and $y$ of equal size. $x$'s have a lower bound $x_{min}<0$, and $y$'s have a lower bound $0$.
Is there a linear way to constrain that $x_i\geq0$ if the solution has $y_i>0$, and $x_i\geq x_{min,i}$ if the solution has $y_i=0$.
A few other points that might be useful
$x$ and $y$ ar... |
I have previously successfully implemented the QR decomposition method in MATLAB to calculate Lyapunov exponents for Lorenz equations. See here.
This method integrates the stacked system, i.e. the system equation + the variational equation and use one common integrator to integrate them at the same time steps.
What I a... |
Don't take the derivative of the approximation but approximate the derivative
or something similar.
I don't quite remember where I heard this but I am trying to find some work on the support or denial of this statement especially when using AD to approximate (calculate derivative) of a function approximation (say a n... |
I am trying to implement the ADI scheme of Douglas and Rachford.
For $p(X,Z,t)$, there is:
$$
\begin{gathered}
A=p^{n-1}+\Delta t_n\left[F_0\left(p^{n-1}, t_{n-1}\right)+F_1\left(p^{n-1}, t_{n-1}\right)+F_2\left(p^{n-1}, t_{n-1}\right)\right] \\
B-\alpha \Delta t_n F_1\left(B, t_n\right)=A-\alpha \Delta t_n F_1\left(p^... |
I'm working on implementing the discretised Burger's equation. I am quite confused as to why it does not work when using a step-function and downwind difference formula. When using a step-function and downwind difference, Newton's method fails to converge.
Utilising downwind difference should provide results, as using ... |
I'm working on trying to solve a steady state PDE in python and I am quite new to python and I am slightly confused on the implementation details. I have an example implementation of solving a non-linear Laplace equation:
$$
-\nu \left( \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} \right) \ =... |
I have a (right) sub-stochastic CSC sparse matrix $Q$ of dimension 5 million, with 200 million nonzero entries, which is a nonzero percentage of 0.0008%, so it is indeed extremely sparse. It is not banded, nor does it have any other obvious sparsity pattern.
I'm trying to solve the linear system,
$$(I-Q)x={\bf 1}$$
I'v... |
Is computing the 2-norm of a vector $x$, computed by setting $\alpha = \max_i x_i$ and then computing $|\alpha| \cdot ||x / \alpha ||_2$ (e.g., as in this link) numerically stable?
There are two parts which might be concerning numerically: you have to make $len(x)$ divisions by $\alpha$, and also take a square root. Th... |
I am solving differential equations that require inverting dense square matrices, and I wanted to know what algorithm(s) do numpy and scipy use to calculate matrix inverses?
|
I get 0 node and elements when I use -refine command line flag in gmsh.
Explicitly writing RefineMesh; in the script produces the original mesh and not a refined one.
Am I missing something while using refinement feature? I remember command line flag -refine used to work. I am using gmsh after a long a time and I wonde... |
I am trying to solve the variable-coefficient Laplace equation $$\partial(\epsilon\partial u) = (\partial\epsilon)(\partial u) + \epsilon\partial^2 u = 0$$using a finite difference scheme:
$$\left(\frac{\epsilon(x+h) - \epsilon(x-h)}{2h}\right)\left(\frac{u(x+h)-u(x-h)}{2h}\right) + \epsilon(x) \frac{u(x+h) - 2u(x) + u... |
I am working on solving the following PDE: $$\left(\mu_{x}\frac{\partial^{2}u}{\partial x^{2}}+\mu_{y}\frac{\partial^{2}u}{\partial y^{2}}\right)=f(x,y) \tag 1$$
Which is then discretised:
$$- \mu_{x} \left(\frac{u_{i-1,j} - 2u_{i,j} + u_{i+1,j}}{h^2}\right) - \mu_{y} \left(\frac{u_{i,j-1} - 2u_{i,j} +
u_{i,j+1}}{h^2}\... |
I am working on modeling incompressible elasticity at finite strains.
$$
\mathrm{Div} \boldsymbol P = \boldsymbol 0, \quad \boldsymbol X \in \Omega_0 \subset \mathbb R^3, \\
J = 1, \qquad \boldsymbol X \in \Omega_0 \subset \mathbb R^3,
$$
with given Dirichlet BCs
$$
\boldsymbol u = \bar{\boldsymbol u}, \quad \boldsymbo... |
I would like to request some literature recommendations covering Chebyshev's pseudospectral collocation method for solving space-time PDEs. It would be nice if it even contained some example problems that cover different types of equations (heat equation, wave equation, etc.), as well as an explanation of how to implem... |
I want to plot nodes from 0 to 28 without including nodes from 2:9
I tried to use this command, but got syntax error:
plt.scatter(node_coords[0:2&&10:28,0], node_coords[0:28,1], color='red', s=70)
|
Consider an ordinary differential equation (ODE) in the form $u_t=g(t,u(t))$ and apply the explicit Runge-Kutta method, as defined by the following Butcher tableau:
$$
\mathrm{RK}(s,p):\begin{array}{c|cccc}
0 & 0 & 0 & 0 \\
c_1 & a_{1,0} & 0 & 0 &0\\
c_2 & a_{2,0} & a_{2,1} & 0 &0\\
\vdots & \cdots & \cdots & \cdots &... |
So I'm trying to use the Lax-Friedrichs method to solve the inviscid burgers' equation with initial condition $$u(x,0) = \sin(x)$$, using
$$u_m^{n+1} = \frac{1}{2}(u_{m+1}^n + u_{m-1}^n) - \frac{\Delta t}{2 \Delta x}\left(\frac{(u_{m+1}^n)^2}{2} - \frac{(u_{m-1}^{n}) ^2}{2}\right)$$
I believe there should be a shock, s... |
I'm dealing with a particular reaction-diffusion equation having the form
$$ c_t = \alpha \nabla^2 c + F(c,x,t). \tag{1}$$
where $F$ is nonlinear. I would like to solve (1) with a finite-difference scheme. Specifically, I would like to use a Crank-Nicolson scheme to progress the solution forward in time. Letting $C_{i,... |
I'm currently in search of an open-source PDE solver (Finite Element Method is preferred) that can effectively handle the challenge of material properties coefficients associated with each element in mesh data (inhomogeneous material properties).
To provide more context, I'm working on a versatile method applicable to ... |
I’m currently working on solving the following PDE:
$$\begin{equation}
-(\mu_x \frac{\partial^2 u}{\partial x^2} + \mu_y \frac{\partial^2 u}{\partial y^2}) = f(x, y)\end{equation}$$
Where a right hand side F is formed, which we can use to solve Ax = b (AU = F)
I’m using Python and the scipy.sparse.linalg.spilu function... |
I am having difficulties applying the boundary condition
$$\frac{\partial \vec{V}}{\partial t} + u\frac{\partial \vec{V}}{\partial x} = \frac{1}{\operatorname{Re}}\frac{\partial ^2 \vec{V}}{\partial y^2},$$
where $\vec{V}=(u,v)$ to the momentum equation at the exit (right side of the domain) of the Incompressible Navie... |
Let $x_1,\dots,x_n\in \mathbb{R}^n$, $y_1,\dots,y_n\in \{-1,1\}$, $\lambda \ge 0$
and $K$ be the invertible Gram matrix $K=(x_i\cdot x_j)_{ij}$.
Consider
$$
(P) \qquad \qquad \min_{a\in \mathbb{R}^n} \lambda a^\intercal Ka + \frac{1}{n}\sum_{i=1}^n \max(0,1-y_i(Ka)_i)^2
$$
I want to compute the dual problem of $(P)$, ... |
How to approximate flux $F(u)\cdot n$ where $n$ denotes the unit normal outward when using finite volumes?
$$\int_{\sigma} F(u) \cdot \boldsymbol{n}_{K, \sigma} \mathrm{d} \gamma(x)$$
|
Fix a dimension $d \ge 1$. Is there an efficiently computable sequence $f : \mathbb{N} \to [0,1]^d$ such that
$f$ is either random or quasirandom (e.g., similar to Sobol sequences).
Given $n \in \mathbb{N}$ and a box $S = [a_0,b_0] \times \cdots \times [a_{d-1},b_{d-1}]$, one can find the subset $f_{S,n} = \{f_k | k... |
I want to solve the problem to determine the next intersection of a Keplerian orbit with the Sphere of Influence of a celestial body to find the next intersection within one future period of the satellite orbit (the satellite and the celestial are both in confocal Keplerian orbits around a primary star or planet and th... |
I'm currently trying to run a MIP (have access to both Gurobi and CBC) with a piecewise linear function having ~200 intervals for each of the ~30 x values I have. I am using the standard decomposition to linearize the function. I.e.
having a binary variable $y_i$ for each interval $D_i = [a, b - eps]$ s.t. if $x \in D$... |
I am developing a code to simulate a Non-Volatile Memory (NVM). For that, I need several constants (memory dimensions, feature size, temperature etc.).
Until then, all my constants were defined at compile-time using pre-processor macros and constexpr variables. But as I needed to re-compile my code each time I wanted ... |
Cross-posted on Math.SE
Are there real-world applications that call specifically for eigenvalues rather than singular values?
I often see eigendecomposition used as "poor-man's SVD"
For instance it's used in Matlab's Lyapunov solver, but that could be reformulated in terms of SVD with greater cost ($22n^3$ instead of $... |
I am trying to solve the Stokes equation containing viscosity nonlinearity using the open source finite element software underworld2 with nested PETSc. The resolution is 2000*200. The solution results of the mumps and multigrid methods were obtained respectively.
========> mumps-parallel <========
SCR Solver Summary:
R... |
I solved numerically the following wave equation with a source problem:
$$ u_{rr} + {1 \over r}u_r + u_{zz} = {1 \over c^2}u_{tt} + s(r,z,t) \tag 1 $$
$$ u_r(0,z,t) = 0 \tag 2$$
$$ u_r(r_{max},z,t) = f(z,t) \tag 3$$
$$ u_z(r, 0, t) = g(t) \tag 4$$
$$ u(r, z_{max}, t) = 0 \tag 5$$
$$ u(r,z,0)=0 \tag 6$$
$$ u_t(r,z,0)=0 ... |
Hopefully this question makes sense.
I know I can formulate an operator for a vector as a matrix, then apply that matrix to my vector to get a new vector. For example, if I define a left shift operator which shifts all elements left I can write such a matrix as follows (I will denote as $L$). I've assumed periodic boun... |
I am studying spectral methods for solving PDEs numerically. I finished a chapter that explains how to use Chebyshev's collocation method to solve them. Though the explanation in the book is quite good, I still have some questions regarding the implementation of Neumann type boundary conditions (both homogeneous and no... |
As shown in Algorithm 2 of this document a linear system $M{\bf z}_k = {\bf r}_k$ is required for every iteration of the preconditioned conjugate gradient (PCG) method. I assume this system is typically solved using the (un-preconditioned) conjugate gradient method. If this is the case, why does this approach not have ... |
When reviewing papers on the numerical solutions of Partial Differential Equations (PDEs), I observed the following equation:
$$
(1-C\tau)||\theta^n||^2 \leq ||\theta^{n-1}||^2 + C\tau (h^{2r+2}),
$$
where $\tau$ is the discrete time step, and $h$ is the spactial step size. The above equation is equal to
$$
||\theta^n|... |
How to approximate flux ()⋅ where denotes the unit normal outward when using finite volumes?
in my case it's not a conservation law so my question is how can we approximate the final term
\begin{align}
\int_{k} div(\boldsymbol{\mathcal{F}}(u)) \mathrm{d}x = \int_{\partial K} \boldsymbol{\mathcal{F}}(u) \cdot \vec{n} ~... |
I have been working with a matrix $A$ and preconditioner $P\approx A^{-1}$ that I've then applied GMRES to the (left) preconditioned linear system
\begin{equation}
P^{-1}Ax=P^{-1}b
\end{equation}
$P^{-1}A$ is not normal and so cannot be diagonalized by a unitary matrix. I have been able to show that for arbitrarily sma... |
I am solving a least squares problem. Using lsqr is relatively slow. Is there a way to add a right preconditioner for lsqr?
https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.linalg.lsqr.html
Here no option to directly use a preconditioner.
Not sure how to define a linear operator for A @ (LU)^{-1} and i... |
This is more of a conceptual question but closely related with how non-linear dynamics simulations results should be interpreted.
I am confused about the relationship of "period" in the context of period-doubling bifurcation, quasi-periodicity and dimension of the torus attractor. I find the wikipedia article on quasi-... |
I need to find a distance from a point in 3D space to a parallelepiped (a crystal lattice cell). The problem boils down to a quadratic programming task:
Let $L$ be a matrix of lattice vectors (row-wise); $q$ is a point to find a distance from. Then the problem is following:
$$\min_{\textbf{x}} |L^T \textbf{x} - \textbf... |
Scaling Issues: Many of the columns I'm analyzing are in different scales, which makes it challenging to visualize them together effectively.
Visual Representation: I initially attempted to use Matplotlib with a secondary y-axis, but the resulting plot was complex and challenging to interpret.
Time-Based Analysis: I al... |
If I am creating a grid in the $S_i$ direction with $N_S+1$ grid points. If I want more steps around some $K$, I can use:
$$
S_i=K+c \sinh \left(\xi_i\right), \quad i=0,1, \ldots, N_S
$$
where $c=\frac{K}{5}$, and;
$$
\xi_i=\sinh ^{-1}\left(\frac{-K}{c}\right)+i \Delta \xi
$$
with
$$
\Delta \xi=\frac{1}{N_S}\left[\sinh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.