instruction stringlengths 43 28.1k |
|---|
The Lanczos method can be used to obtain extremal eigenpairs of sparse symmetric or hermitian matrices. I know there are several implementations of the Lanczos method (as well as Arnoldi, Davidson, and others) out there, but I am specifically interested in one that returns the tridiagonal matrix, not just the eigenvalu... |
I am currently in the early construction process of building a simple CFD model of a rotating planetary atmosphere. The planet should be allowed to tilt significantly, so that a time-dependent source function for heating the atmosphere can also go overhead the poles.
Because of this, I have to consider grids other than... |
Say we want to find a sparse approximate minimizer to the function $f(x) : \mathbb{R}^d \to \mathbb{R}$. Then in line with the work in the field of compressed sensing, we can instead minimize $$f(x) + \lambda \|x\|_1$$ as a convex proxy/relaxation to the desired sparsity constraint on $\|x\|_0$.
But often times optimiz... |
I would like to know the command/line in Maple 16 or similar to obtain the second fundamental form tensor for a given metric. I've managed to obtain Rienmann and Ricci tensor, even Weyl, but I can't find anything on the internet that would help me to obtain the K_mu_nu of a generic spherically symmetric metric such as:... |
I would like to calculate the following two expressions using Wolfram Alpha:
$$z = (x (d^2 + d (4 y - 6) - 8 y^2 + 12 y - 3) + 6 (d - 1) (y - 1) y)/(d^2 - 2 d y + 4 y^2 - 6 y + 3)$$
and
$$w = -(\sqrt3 (d^2 (x + 2 y - 1) - 2 d (x (2 y - 1) + y^2) + x (4 y - 3) - 2 y^2 + 6 y - 3))/(d^2 - 2 d y + 4 y^2 - 6 y + 3)$$
where... |
I came across the method of multiple-scale analysis and was intrigued, because I am trying to solve a linear ODE with multiple characteristic timescales. When I apply the method as described, say, here, I find that the zeroth-order solution is the exact solution! This is exactly what I don't want, because conventional ... |
I am solving a system of nonlinear time-dependent equations using the Newton method in a finite-element-setting, i.e. first I create the jacobian matrix for the current time, and afterwards I try to solve the system (using a GMRES-solver, preconditioned using the AMG-method) to get the solution update. This is repeated... |
Suppose $A,B\succeq0$ and $C\in\mathbb R^{n\times n}$. I am hoping to solve an instance of the following optimization problem:
$$
\min_{\textrm{permutation matrices }P}
\mathrm{tr}(BP^\top AP+C^\top P)
.
$$
This objective function is convex in $P$, but the constraint forces $P$ to be a permutation matrix. In essence,... |
I need to calculate a closed-loop system in Python; specifically, obtain the PID response and then use the output to obtain the system response sample-by-sample with my own loop.
For this, I am using a fourth-order Runge-Kutta with an adaptitive step size to solve the state space representation. So far, the only way I... |
Recently, I have met a question that
a saying goes that for large linear system: iterative methods are required because of memory problem of direct methods.
But when I implement some experiments in Matlab, I find a strange phenomenon:
I used the Poisson equation in 2D and use Q1 element, grid input is 10, and I got... |
i have a large rectangular invertible matrix M (about 5000x5000) and i have a loop in which i do the following for each iteration i (there are about 6000 iterations):
i am given a subspace S_i (which in my problem is always a subset of the standard basis; for example, "dimensions 3, and 300, and 3723"; these subspace... |
I have a smooth enough injective function $f:[a, b]\to \mathbb{R}$ which I want to approximate by something that can be computed quickly, e.g., a Padé approximant of low degree,
$$
\frac{\sum_{j=0}^m a_j x^j}{1 + \sum_{k=0}^n b_k x^k}.
$$
At the same time, though, I also need the inverse of the approximating function t... |
Can someone suggest a way to get Cholesky factorization of a singular covariance matrix? I need it to match Cholesky on full-rank matrices, ie coordinate order should be preserved. My attempt below was to use ldl routine in scipy, but that gives me factorization on a different ordering, any ideas?
import numpy as np
fr... |
I am trying to replicate the method given in the this paper. I have written a Matlab program which determines the displacement field of Mindlin–Reissner plate theory using Ritz method. The limitation of the program is that the plate should lie on xy-plane.
Now I want to extend it to plates that are NOT aligned with an... |
From the Petsc manual pages, I fail to understand what the orientations of cones and transitive closures mean.
In particular, how can I relate these numbers to the orientation of the length/area/volume of the corresponding mesh components ? How can I retrieve the notion of "relative orientation of a face within a cell... |
Let's assume I am working on a 2-D domain on $R^2$, with my coordinates $x \in[-1,1]$, $y \in[-1,1]$ and I want to solve a popular CFD problem, like the shallow water system or the Euler system.
At $x=0$ there is some physical feature that I want to resolve really well, so I want to employ mesh refinement around the or... |
I am making a toy code in Python to solve the advection equation $$u_t + cu_x = 0$$
with, for example, periodic boundary conditions.
Background information
The numerical grid is specified like this:
# problem parameters
lx = 2.0*np.pi # length of the domain
c = 1.0 # advecton speed
# grid generation
nx = ... |
I'm using the Barnes Hut method to calculate the magnetic vector potential induced by an applied current. Given as:
$\begin{equation} A(r) = \frac{\mu_0}{4\pi} \int_V\frac{\bf{J(r')}}{|r-r'|}dV(r') \end{equation}$
In general this equation can be written as:
$\begin{equation} \Phi_i = \sum^N_{j=0} \frac{m_j}{r_{ij}} \en... |
I'm solving a quantum mechanical problem, and the quantization condition requires me to solve the equation
$$
U\left(\frac12(\ell+1-E), \ell+1, r^2\right) = 0,
$$
where $U(a,b,z)$ is the confluent hypergeometric function of the second kind, $r>0$ is a fixed positive real number, and $\ell\geq0$ is a fixed non-negative ... |
I have implemented the Jacobi iteration in C++ using a dense vector and a sparse matrix in CSR format. The code is as follows:
{
T omega = 2.0 / 3.0;
std::vector<T> temp = result;
for (int niter = 0; niter < maxit; ++niter)
{
for (int i = 0; i < matrix.get_rowptr()->size... |
For a performance-sensitive problem, I need to compute the pseudoinverse of a skinny matrix (#rows = 1000–10000, #cols= 10–20).
I already employ the traditional SVD econ method. For some problem sizes, this takes up most of my computational time. Is there any faster method?
The matrix is dense, and usually ($A^TA$) is ... |
For numerical methods of the Stokes equations, with appropriate boundary:
$$-\nabla^{2} \vec{u}+\nabla p=\overrightarrow{0}$$
$$\nabla \cdot \vec{u}=0$$
one may use FDM (finite difference method) or FEM (finite element method) to discretize it, which can both be tranformed into a saddle points system as follows:
$$\lef... |
We've recently ported our Python/Fortran simulation code to a new supercomputer. Some (not all) of the tests (simulations) that we've run on the new platform yield results that are significantly different from those we got on the "old" cluster. We see ${\cal O}(1)$ numerical differences between output variables on the ... |
Motivation: I'm using 2D regular grid (it's actually a quadtree but I can still treat it as a finite difference thing if I weight-average the solution over smaller scale cells for the purpose of estimating Laplacian in the neighbor points) to discretize my Poisson equation and I'd like to solve it iteratively. The disc... |
I am looking at the following system of ODEs:
\begin{array}{r}{\left[c_{2}(k)-\partial_{\tau}^{2}\right] \varphi_{2}\left(\tau \right)=f_{21}(\tau) \varphi_{1}\left(\tau \right)} \\
{\left[c_{1}(k)-\partial_{\tau}^{2}\right] \varphi_{1}\left(\tau \right)=f_{11}(\tau) \varphi_{1}\left(\tau \right)+f_{12}(\tau) \varphi... |
EDIT: We have a coupled system of 10 ode each. The coupling presents in the last equation. I thought about using a matrix 10 by 2 as initial conditions.
I also followed a similar question with the same title here, but I still get the same errors ('Too many input arguments.')
time = [0 5];
x1_0 = [0 0 0 0 0 0 0 0 0 0];... |
i have a time-series and, in analogy with exponentially weighted moving average, i would like to compute the exponentially weighted moving standard deviation or variance in an efficient, numerically stable manner. This is in Octave/MATLAB so vectorized is better than looping.
An incremental algorithm for computing weig... |
I am trying to understand intuition of ADMM (alternating direction methods of multipliers). It combines dual ascent and method of multipliers. Downside of method of multiplier is the loss of decomposability. Why does method of multipliers lose decomposability?
|
I am working on the following Stochastic Differential Equation (SDE) in the Quantum Mechanics context:
$$dX_{t} = a X_{t} dt + b X_{t} dW$$
where $X_{t}$ is my stochastic varible, $dt$ is my integration time step, and $dW = N[0,1] \sqrt{dt}$ is the Wiener differential.
Due to the "quantumness" of this SDE, it's not pos... |
I want to use the Numerov method but keep higher-order terms from the Taylor expansions. In the literature, I found the term "Deferred Difference Corrections" for the procedure of first solving the differential equations via the standard Numerov method and afterward adding the higher-order terms. For me, this sounds ju... |
An important component of the Cartan KAK decomposition for 2 qubit operations is to diagonalize a 4x4 unitary matrix using orthogonal (not unitary, purely real orthogonal) matrices. That is to say, given unitary U find orthogonal A and B such that A*U*B is diagonal. (Actually, the orthogonal matrices are supposed to be... |
someone knows where I can find a FEniCS implementation of Maxwell equations for a dipole or other type of antenna? I mean a dipole antenna with an arbitrary geometry of every 'leg' in the dipole.
|
I have a data extracted from Comsol on some node points and I know the coordinates of each node.
Does anyone know how Comsol calculate the partial derivative from the values at each node and also using the coordinate information?
|
Suppose I have semi-positive definite matrices $A$ and $C$, is there an efficient approach to get top singular values of X entering the following expression?
$$
AX+XA=C
$$
My matrices are 4k-by-4k and are known to be low rank, rank somewhere between 50 and 1000.
I've been using SVD on top of scipy.linalg.svd(scipy.lina... |
I'm looking for references to understand where the numerical instabilities come from in hydrodynamics in general, and notably when the Péclet number: $Pe>1$. I'm using the finite element method.
Would you have some references for that, please? Or if you could explain at least the case of the Péclet instability for exam... |
I'm using the finite element method (FEM), but my question is quite a global question. It's related to this question but it is not the same.
Let's assume we have this equation : $$\partial_t c - u\frac{dc}{dx}=\frac{d}{dx}\Big(D(c)\frac{dc}{dx}\Big) $$
with $u$ a positive constant.
and with $D(c)>0$ and $$\lim_{c\right... |
Is there an algorithm to evaluate spin-weighted spherical harmonics (swSH) at arbitrary points on the sphere? In particular I am looking for, e.g. a recursion relation to evaluate the "spin weighted Legendre functions" ${}_sP^m_l$, which satisfy the follow Sturm-Liouville equation
$
\frac{d}{dx}\left(\left(1-x^2\right)... |
I'm trying to write up a small code that, given a set of normal vibrational modes for a molecule, will convert them to localized vibrational modes. To do this I'm following the procedure from J. Chem. Phys. 130, 084106 (2009) where they introduce $\tilde{Q}=QU$ as the orthogonal transformation ($U$) from normal modes (... |
I am looking for a very fast and efficient algorithm for the computation of the eigenvalues of a $3\times 3$ symmetric positive definite matrix.
The algorithm will be part of a massive computational kernel, thus it is required to be very efficient.
I am aware of the algorithm suggested by Wikipedia but I found this st... |
The multiphase particle-in-cell (MP-PIC) method is characterized by mapping particle properties from the Lagrangian coordinates to the Eulerian grid. However, the implementation of this method in OpenFOAM solves an interpolated equation on the Eulerian grid only in one "submodel", the implicit packing model, for which ... |
In Zabusky and Kruskal's paper about solitons, they derive the following update for the Korteweg de Vries equation (their footnote 6):
\begin{align*}
u_{i}^{j+1} = u_{i}^{j-1} - \frac{1}{3} \frac{k}{h} ( u_{i-1}^{j} + u_{i}^{j} + u_{i+1}^{j})(u_{i+1}^{j} - u_{i-1}^{j}) - \frac{\delta^2k}{h^3} (u_{i+2}^{j} -2u_{i+1}^{j... |
I have the following problem:
$
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
\argmax_{\underset{\lambda_k\in \mathbb{R}}{\sigma_q^2(k)\in \mathbb{R}}}
\left[\min_{\underset{q\in \left[q_A,q_B\right]}{n_k\in \mathbb{Z}}}
\sum_{k=1}^N \frac{1}{\sigma_q^2(k)}\left(q-n_k\lambda_k\right... |
When I use BiCGStab to solve a linear matrix system, I use the relative residual to exit the iteration and output the results. For calculating the relative residual I divide the norm of vector $r$ through the norm of vector $b$. Where $r$ is according to the definition of BiCGStab algorithm and $b$ is the right hand si... |
I have been given a convection-diffusion ODE modeling the steady state temperature of a pipe (through which flows a fluid) as
$$-\frac{d}{dz}\left(\kappa \frac{dT}{dz} \right)+v\rho C\frac{dT}{dz}=Q(z)$$.
Here $T$ is the (steady state) temperature and it depends on the space variable $z$. All other parameters are const... |
I'm using cuFFT to do some 2D FFTs on matrices of size 2048x2048 or larger. The FFTs are preceded and followed by various scaling operations.
These scaling operations are memory-bound, so they take as long to execute as the FFT itself. I think the best way to accelerate them is to fuse them with the FFT kernel. However... |
There are many philosophies in different software engineering disciplines about how libraries should cope with errors or other exceptional conditions.
A few of the ones I've seen:
Return an error code with the result returned by a pointer argument.
This is what PETSc does.
Return errors by a sentinel value.
For examp... |
Say I want a QR decomposition of matrix $A$, where orthogonality of $Q$ is with respect to a generic non-degenerate positive-definite bilinear form $\phi$ (in my case, $\phi$ is "defined" by a finite-element mass matrix). This seems like a standard thing one might want to do, so is there a Python implementation out the... |
I already posted it on Physics SE, but maybe this is a better place:
I have a 5D integral being calculated with a Monte Carlo uniform random sampling. The issue is that the region of integration is very small and for 100000 points I get only around 20-30 points every time. The function has to be calculated several time... |
I have a transformation matrix $K$ which transfers elastic constitutive matrix $C$ between two coordinate systems. According to textbooks such as T.C.T. Ting's "Anisotropic Elasticity", the elastic matrix in the new coordinate system $C^*$ should be
$$C^*=KCK^T$$
My question is: If $C$ is isotropic, then $C^*=C$ no ma... |
I need to import data from file in order to describe the structure of a network.
I used the following:
weights = readtable('weights192.txt');
W = weights{:,:};
Now, I need to use matrix W (its elements, its size) in the function ode below. How can I pass the matrix or just the elements I need in terms of arguments in ... |
Some numerical debugging led me to the minimal example below. I'm observing relative error of 0.75 on individual elements.
Is there a way to estimate/bound this error without resorting to higher precision arithmetic?
import numpy as np
x = np.array([[11041, 13359, 15023, 18177], [13359, 16165, 18177, 21995], [15023, 1... |
Let's say that we have the function
$$f(x) = 1- \frac{\sqrt{1 + x^2}}{1 + x^2/2}$$
for small $x$.
What I am asking is the following:
I am going to solve this function numerically for $10^{-10}<x<1$. To have the best precision, should I use the function $f(x)$ as it is and make the computer solve it or should I expand t... |
I want to implement a CUDA solver for the 2D shallow water equations using adaptive timestepping with a Courant number fixed by the user. The algorithm pseudocode looks something like this:
while (t < end_time)
{
evolve_flow_variables();
dt = global_minimum_dt_over_all_elements_in_mesh();
t += dt;
}
I've seen e... |
I'd like to know how Ansys computes the slope (=stiffness matrix) at point x1 in figure. I'm studying the way in which Ansys uses the Newton-Raphson method when there are nonlinearities.
In the slide there is the specification that we don't know the real curve F-x, thus I have some problem to understand which slope is ... |
When I use the newton's method or hybrid solver in the GSL package to deal with 1-D or multidimensional root solving problems, the code frequently crashes when the solver requests function value outside its domain of definition. For example, to solve $f(x)=0$ where $f(x)$ is only defined at $x\geq0$, even when I start... |
Take an image $f$ with some characters on it (below, hjFu3).
Let's apply a filter $h$ on it to obtain a second image $g$ where the text is not visible.
Is there a way to compute what kind of filter $h$ we have applied ?
The aim being that this filter should be applied to decode a new blurred image that was blurred with... |
I need to compute the kinetic energy cascade using a finite volume solution in an equally spaced grid. I wonder if it is more correct to first compute the kinetic energy in the space (or time) domain, $E(x,t)=0.5(u(x,t)^2+v(x,t)^2)$, and then apply the FFT to obtain $E(k)$, or applying first the FFT to $u$ and $v$, obt... |
Background for the question
I am currently working on a Matlab code in which the systems of linear equations $Ax_1 = b_1$, $Ax_2 = b_2$, ... have to be solved. As the matrix $A$ is constant during the simulation, I LU-decompose it once and for all at the beginning and solve the $n$th system as
xn = U\(L\bn);
At this p... |
Many times in fourier approximation we come across integrals such as
$$\int_0^1 e^{-\gamma\int_0^xu_0(\eta)d\eta}dx$$ where $\gamma$ is a constant and the data for $u_0$ is provided as a discretely sampled vector.
How does one perform integration for such numerical integration?
|
I am trying to solve the following problem:
Given a binary matrix $\mathbf{A} \in \{0,1\}^{m \times n}$ and a vector $\mathbf{b} \in \mathbb N^n$, does there exist a binary vector $\mathbf{c} \in \{0,1\}^n$ which satisfies the following requirements?
$\mathbf{c}^\top \mathbf{b} < x$, where $x$ is a given threshold.
... |
I need an efficient way to take square root of a matrix which is a sum of diagonal matrix and rank-1 matrix.
More specifically it's the following matrix
$$A=D-uu'=\text{diag}(u)-uu'$$
Where entries of $u$ are non-negative and $\sum_i^d u_i=1$. This is also known as the covariance of the multinomial distribution with me... |
I am currently working on a remeshing algorithm for Abaqus using Gmsh as part of my Bachelors thesis and I seem to be stuck at some point.
I am able to remesh .geo and .msh files using the script given in Gmsh tutorial "t13".
t13.geo:
Merge "myJob5.msh";
angle = DefineNumber[40, Min 20, Max 120, Step 1,
Name "Param... |
I'm looking at random vectors $z$ of size $d^2$ which can be written as $z=x\otimes y$ where $x$,$y$ are random vectors in $\mathbb{R}^d$ with following second moments known -- $E[XX']$, $E[YY']$ and $E[XY']$. First moments are 0.
Given a new vector $\hat{z}=\hat{x}\otimes \hat{y}$, I need to approximately divide it by... |
I have an unconstrained minimization problem of many variables for which I know the gradient exactly. I turned to the conjugate gradient method contained in scipy.optimize.minimize (which uses the Polak-Ribiere algorithm), but it throws a LineSearchError when I try to converge the algorithm beyond the square root of ma... |
I am searching a solution method for the following equation system of equation systems:
Let $A \in \mathbb{R}^{n \times n}$ be an invertible Matrix, $f, b_1, b_2 \in\mathbb{R}^n$ given vectors and $ C_i \in \mathbb{R}$ constants. I am searching for a numerical method to find the solution vectors $x_1, x_2 \in\mathbb{... |
Most Riemann solvers I've come across can solve the Riemann problem only under certain conditions such as convexity of the equation of state. But what happens if the fluid enters a metastable state or the spinodal region or the fluid state follows a nonconvex isentrope in the p-v diagram? All the approximate solvers de... |
I have a dataset $\{x_i, y_i\}_{i=0}^{n-1}$ where $x_0 < x_1 < \cdots x_{n-1}$ (not uniformly spaced), and, in addition $y_0 < y_1 < \cdots y_{n-1}$. So it feels natural to assume that $y_i$ are samples of an unknown monotonically increasing function.
I would like to interpolate these data, but it is very important tha... |
How can I use BLAS/LAPACK to compute
$$
B^{-1}AB^{-T}
$$
where $A\in\mathbb{R}^{n,n}$, $B\in\mathbb{R}^{m,n}$ is full rank matrix with $m>n$, and $B^{-1}y:=\arg \min_{x} \|Bx-y\|_{2}$.
In theory, one could compute
$$
B=QR
$$
with orthogonal $Q\in\mathbb{R}^{m,n}$ and triagonal $R\in\mathbb{R}^{n,n}$ and then
$$
R^{-1}Q... |
I've done some PCA on my own, and am familiar with the basic concepts of how PCA components are calculated and applied. However, I'm working on a research project and am confused as to how to interpret a common type of graph I've seen across many papers using SPME analysis of volatiles. None of the papers I'd read thro... |
I am making my own finite difference computational magnetohydrodynamic code in Fortran 90. Looking at other codes they appear to calculate for example their $x$-derivatives, bb of their variables, e.g. aa like the following:
CALL system_clock(tstart, count_rate)
DO ix = 1, nx - 1
ixp = ix + 1
DO iy = 1, ny
DO i... |
I am trying to solve a three-dimensional baroclinic transport problem. The hydrodynamic (three-dimensional shallow water) equations are:
\begin{align}
\nabla \cdot \vec{v} = 0, \tag{1} \\
\frac{\partial u}{\partial t} + \nabla \cdot (u \vec{v} ) + \frac{1}{\rho_0} \frac{\partial P}{\partial x} - f_{\text{coriolis}}v -... |
I'm trying to implement Barnes-Hut algorithm, with a binary tree. My initial conditions are a uniform mass distribution in a sphere with radius $R$. How can I create uniform dots distribution in a sphere?
|
My question is about how I can solve a coupled system of ODE's, and print out the variables in a plot.
I am solving for an q value and an e value, seen in this set of coupled ODE's below:
$$
\begin{aligned} \frac{dq}{dt} &= \frac{48}{5\pi M^2}(2\pi Mq)^{11/3}e\frac{1+\frac{73}{24}e^2+\frac{37}{96}e^4}{(1-e^2)^{7/2}},\\... |
I am using the CUSP CG solver and I ran it on a couple of sparse matrices from the University of Florida sparse matrix collection. The solver was able to solve non positive definite sparse matrices. My understanding is that CG solvers can't solve non positive definite sparse matrices? So is how was CUSP's CG solver abl... |
What is the difference between Simulation-based Optimization and PDE-constrained Optimization?
Would studying a text on Simulation-based optimization be sufficient to understand and apply both?
|
I have 5 million items that have 10 features (all continuous and not categorical) each and would like to select a small subset of these items. Ideally, I want to manually specify 10 features of my own up front and find a subset of items in the pool that are all close to the features I specify. By closest, I mean the di... |
It is so confusing, especially when I learns discontinuous galerkin method in broken Sobolev space and weak Dirichlet boundary condition.
If the trial function is chosen with homogeneous boundary conditions, how can I get a linear discrete equation corresponding to test basis functions with DOFs on the boundary? I mean... |
I am struggling a bit with the concept of preconditioners for iterative solvers and how to implement them efficiently. The literature mostly provides methods to create a preconditioner matrix $M$ (incomplete LU, incomplete Cholesky etc.). But the conjugate gradient methods need $M^{-1}$ during the iterations. As invert... |
I have a 7-14 dimensional piecewise linear cost function I'd like to minimize with two quadratic terms of the form:
$$
f(X) = X^tCX + d \sum_i |x_i-x^*_i|^2 + \sum_i P_i(x_i-x^0_i)
$$
$$ \sum_i x_i = 1, 0 \leq x_i \leq 1$$
where $d>0$, $C$ is positive definite and $X^*,X^0$ are fixed.
The $P_i(x_i-x_i^0)$ are conti... |
I know Lax-Milgram theorem is fundamental to FEM. But it did not explain what will happen if coercivity is not met.
My understanding is if it is met, eigen value of the operator (or its corresponding matrix) is always positive (may be degenerated). If it is not, with the refinement of grid, more and more eigen value wi... |
I have read this question and answer – Interpolation of scattered data to a regular grid in python and I am doing something similar as I have temperature values of the atmosphere at different heights defined on a coarse grid and I want to interpolate this to a regular grid in Python and I also need to weight the matc... |
I want to solve a QCQP in Python. It is a problem from finance: maximise return (linear function) given some linear constraints and one quadratic constraint that turns it into a QCQP. Formally,
$$\begin{array}{ll} \text{maximize} & c^T x\\ \text{subject to} & x^T \Sigma x \le \sigma^2\\ & Ax \le b\end{array}$$
The matr... |
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 in FEM without convert it to a system of difference equations. And FEM is a little more complex because of there are two... |
I am working on a 2D unstructured code in C++. I am using gmsh to generate a 2D unstructured mesh and reading it into my program with a library called GMSH_IO. Now that I have the data, I would like to write it to a VTK file for visualization in Paraview.
I could do this manually, but I am curious if anyone knows of a ... |
What scientific problems can be simulated with computers that couldn’t be simulated 10 years ago?
I’m particularly interested in cutting-edge scientific simulations, which wouldn’t have been possible (due to computational constraints, or lack of knowledge) 10 years ago.
Please provide links to software, if possible.
|
Given triples of $n$ floating point values
$$(\min_1, \max_1, w_1), \dots, (\min_n, \max_n, w_n)$$
and a value $V$, what is a good algorithhm to assign values $v_i$ to each of the triples such that the following conditions hold?
$\min_i \le v_i \le \max_i$.
$\displaystyle\sum_{i=1}^n v_i = V$.
$\dfrac{v_i}{V}$ is as c... |
For example, for 1D Burgers equation
$$
u u_x = 0 \\
$$
equivalently,
$$
\frac{dF(u)}{dx} = 0\\
F(u)= \frac{u^2}{2}
$$
If I want to obtain $A_{ij},i\ne j$ for two DOFs ($U_i$ and $U_j$) of two elements ($E_0$ and $E_1$) sharing an internal interface $\Gamma_0 $.
I need to substitute $u =\phi_i$ and $v=\phi_j$ to nonli... |
Connected to this question here on Computational Science, I've posted a follow-up question on how to solve a PDE using an implicit scheme like Crank-Nicholson in general in this question on SO.
But I guess it is better to ask here it is correct to solve a PDE with an implicit step in this way in general and ask the mor... |
Assume one has a triangular sparse matrix and want to solve $Lx=b$ where $b$ and $L$ are known. This can be done easily by using forward substitution when $L$ is a lower triangular matrix. Forward substitution is highly sequential and hard to implement in parallel.
I have read some articles about level scheduling where... |
I'm interested to derive the total energy balance from Chapman-Enskog analysis of lattice Boltzmann equation (LBE). I know, I should go to the second moment of LBE (zeroth moment gives mass conservation and first moment gives momentum conservation). In fact, I derived the main equation for the second moment at convecti... |
This is a problem I am encountering in a research project. I have thought of a naive approach to solve it which relies on many assumptions, is not guaranteed to work, and would be tedious and computationally expensive to implement. Hence, I am wondering if there would be cleverer or more general approaches. Below I wil... |
I am trying to solve numerically a constrained optimisation problem in MATLAB, and I am wondering how the fmincon function calculates gradients when one isn't provided. Does anyone here know, or know how I might be able to find out?
Running the optimisation problem takes more time than I'd like it to, so I was hoping t... |
The Navier--Stokes equations are axially symmetric, so with symmetric boundary conditions, how can features such as Karman vortex streets develop?
I understand that in reality symmetry does never completely hold due to minimal fluctuations of geometries, densities, etc., but in the linked article, vortex streets develo... |
I would like to use automatic differentiation to calculate gradients to function written in numpy.
I've come across a number of packages, including
autograd
tangent
chainer
But none of them seem to support things like numba and numexpr, which I'd normally use to accelerate my python code.
What packages do people use... |
I'm new to SOCP and want to try to get familiar with the format and how to solve it with cvxopt in python. However, for a simple toy example I'm struggling to get the right input format.
The problem I want to solve has the form
$$ \max_x c^T x$$
subject to
$$ \| A_ix + b_i\|_2\le c_i^Tx + d_i, i=1,\dots, m$$
$$Fx = g $... |
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, 13].
I need to select one number from each group so that the difference between the maximum and minimum of the four selec... |
I am trying to sort data following a bivariate distribution into a numpy histogramdd, where each bin should contain the same number of data points (to the nearest whole sample).
I expect that some kind of quantile-approach is required, and have tried scipy.stats.mstats.mquantiles, which according to the documentation t... |
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}\quad
J_T(x) = \frac{3T}{4} \left( \frac{\sin \pi T x/2}{\pi T x/2}\right)^4
$$
So I had to remind myself how these tw... |
I want to do somethings similar to the plot found at the bottom of this blogpost, which I found via this post in ParaView, which seems to have been the original Application used to generate the plot.
I have a .csv-file containing data points of the form $(x, y, z, a)$ where $a$ ranges from 0 to 1 and represents gives ... |
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 "Insertion Sort" algorithm to use circular array indexing:
/* sort ringbuf entries with insertion sort algorithm */
voi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.