instruction stringlengths 43 28.1k |
|---|
Natural neighbor interpolation is defined here, it is an intriguing method that uses voronoi diagrams. Notably it is smooth almost everywhere whereas linear interpolation is only piecewise linear. I was using it for my research but after some playing around it seems to just be... worse than linear. Here is a pic of nat... |
Let $X$ and $Y$ be two given $k\times n$ real matrices. If $A$ is a $k\times k$ real matrix then $AX - Y$ is a $k\times n$ real matrix. Applying the Frobenius norm $\| AX - Y \|$, we get a non-negative real number. Let $\mathcal M_k$ be the space of all $k\times k$ real matrices. We have a continuous map $\mathcal M_k\... |
I appreciate this might be an easy question, but I've managed to get myself quite thoroughly confused
I'm trying to solve a system of physics equations that look as follows
$$
\frac{\partial \mathbf{E}}{\partial t}=-\alpha \mathbf{j} \\
\frac{\partial \mathbf{j}}{\partial t}=\beta\mathbf{E}+\gamma\mathbf{j}\times\math... |
I am following along Rourke's book and I am trying to do the excercies mentioned in this SO post:
Min supporting line for a set of points
Design an algorithm to find a line that:
has all the points of a given set to one side
minimizes the sum of the perpendicular distances of the points to Assume a hull algorithm is... |
I have been trying to understand the recently proposed Sparse Identification of Nonlinear Dynamics SINDy. Despite several attempts, I seem to fail to understand the difference between SINDy and the standard methods used for parameter identification in the field of system identification. The PNAS paper neither discusses... |
I have a system $\vec{x}_{i + 1} = \vec{x}_i + W_i$ where $W = N(\vec{\mu}, \Sigma)$. For some matrix $H_i$, let $y_i = H_i$ and let $z_i = y_i + R$. Where $R$ is some random variable. We are given $pdf(y_i | z_i)$. Using this, I can calculate the mean and the covariance of $y_i$ conditioned on the observation $z_i$ (I... |
How could one calculate the KKT conditions in the case of bound-constrained optimization?
In the general sense, given an objective function $J$ and design variables $x \in \mathcal{R}^n$, we consider the following optimization problem:
$\min\limits_{x\in \mathcal{R}^n} J(x)$
with the following bounds for $x_j$
$x_j -1 ... |
For many linear operators, it is easy to express them as a function. For example, to blur an image, simply compute a weighted sum of neighboring pixels (or even easier, import gaussian_filter from scipy.ndimage). To reverse this process, it is useful to represent this function/linear operator as a matrix, because matri... |
Recently, I've been struggling to understand the limitations and capabilities of the successive over-relaxation (SOR) method for boundary value problems which are ill-posed, such as, for instance, boundary value problem (BVP) in form of Poisson equation with pure Neumann boundary conditions ($\nabla^2u=f$ and $\frac{\p... |
In passing I was told by someone that $K^{\prime}\in\mathbb{R}^{n\times n}$, will be easier to solve by an algebraic multigrid preconditioned conjugate gradient (CG-AMG) solver than $K$, where $K$ is a discretized elliptic (2nd order) differential operator, that is symmetric positive definite, and
\begin{align*}
K^{\pr... |
Poisson disk or blue noise sampling consists of finding a random, maximal set of points $\{x_i\}$ in a domain $\Omega$ such that $\|x_i - x_j\| \ge r$ for some fixed radius $r$ and for all $i$, $j$.
There are several algorithms for efficient blue noise sampling, for example Bridson's algorithm.
Blue noise sampling is u... |
I am trying to solve a boundary value problem on $[0, \infty]$, using scipy's scipy.integrate.solve_bvp and I am seeing that the solutions are not converging even with high number of iterations, and that they depend strongly on my initial guess.
The problem I have is complex but persists even in the following minimal e... |
I am trying to solve with high precision the following coupled system $(f,h)$ on $[0,\infty]$:
$$-h''-\frac{1}{r}h'+\lambda_c h(f^2-1)+4\lambda_h h^3=0$$
$$-f''-\frac{1}{r}f'+\frac{1}{r^2}f+ f(-\lambda_f+2\lambda_c h^2)+\lambda_f f^3=0$$
where $\lambda_h, \lambda_f, \lambda_c $ are positive constants, and with boundary... |
This may be an easy question to answer but I am really stuck.
In several topics (especially that of quasicrystals) the Fibonacci chain's Fourier transform and diffraction pattern is mentioned. Despite the chain not being periodic, its diffraction pattern shows sharp peaks (a hallmark of quasicrystals). See for example ... |
I'm trying to model some two-dimensional waves, and am unsure how to combine my boundary conditions with spectral methods. The PDE I'd like to explore resembles the equations for damped, driven bending-mode waves in a thin disk or beam:
$$\ddot w(\boldsymbol x,t) = -c \nabla^2 \nabla^2 w(\boldsymbol x,t) - d \dot w(\bo... |
I have seen finite difference methods for fluid equations (Stokes and Navier--Stokes) that solve a pressure problem first and then a fluid problem. That is, although they solve two different problems, they are two smaller problems, which from a computational point of view is a tremendous advantage compared to solving o... |
I'm looking for a way to implement the regular Coulomb wave function in python. This function is a solution to
\begin{align}
\frac{\text{d}^2\,u}{\text{d}z^2}+\left(1-\frac{2\eta}{z}-\frac{\ell(\ell+1)}{z^2} \right)u(z)=0
\end{align}
The regular Coulomb wave function is given by
\begin{align}
F_\ell(\eta,z) = C_\ell(\e... |
TL:DR
How can one implement a bifurcation diagram of a seasonally forced epidemiological model such as SEIR (susceptible, exposed, infected, recovered) in Python? I already know how to implement the model itself and display a sampled time series (see this stackoverflow question), but I am struggling with reproducing fi... |
Suppose I want to solve an overdetermined linear least squares problem
$$
x = \operatorname*{argmin}_{x\in\mathbb{R}^n} \| Ax - b\|^2
$$
where $A \in \mathbb{R}^{m\times n}$ has full column rank. I make no assumptions that this system is nearly consistent.
Suppose I know a have access to a matrix $P\in\mathbb{R}^{n\tim... |
Assume that $f$ is defined as a composition of functions:
$$f=f_2 \circ f_1$$
where $f_1:\mathbb{R}^n \rightarrow \mathbb{R}^{m_1}$ and $f_2:\mathbb{R}^{m_1} \rightarrow \mathbb{R}^n$. We can compute the Jacobian $J_f(x)$ using the chain rule:
$$J_f(x) = J_{f_2}(f_1(x))J_{f_1}(x)$$
and we can also compute the Hessian $... |
I read somewhere that the Measn squared error loss function acts as L2 norm of the paramter vector. I would like to know if I am using binary cross entropy loss function, do I need to calculate the norm seperately? or the BCE loss function also acts as a norm? As an additional question I would like to know that is grad... |
I have working on 2 ways of training a neural network. The first method uses gradient descent updates the model with Adam optimizer. the second method minimizes the norm of the gradient of the functions and updates the network. What is the difference between the two? does normal gradient descent guarantee minimum norm... |
I am interested in computing integrals of the form $\iint_{P\times P} Q(x_1,x_2,y_2,y_2) dxdy$ where $P$ is a polygon and $Q$ is a polynomial. The coordinates $(x_1,x_2)$ are in the plane of $P$. Of course $(y_1,y_2)$ represent again coordinates in the plane of $P$, possibly different from previous ones.
The above inte... |
How should I modify the following matrix formulation of a finite element (FE) approximation of Poisson equation at the (internal) interface denoted by the nodes $i-1$ to $i+1$ having a continuous 1st derivative $\epsilon_1 \nabla\cdot U_1 = \epsilon_2 \nabla\cdot U_2$ at the internal interface nodes (say from $i-1$ to ... |
I have a distributed matrix in block cyclic layout. Is there an efficient way to out/in place transpose a distributed matrix with scalapack?
Context: I am trying to diagonalize the transpose of a distributed matrix with pzheevd
EDIT: Thanks to Ian Bush, It fixed the problem. Bit curious if there is a nice way to do it
|
I am just starting my MSc and we have been given an assignment in which we must model two-dimensional, laminar, incompressible Poiseuille flow in a channel. We are supposed to use a VELOCITY INLET inlet boundary condition and two different outlet boundary conditions - the OUTFLOW boundary condition and the PRESSURE OUT... |
I'm new to Gmsh and after browsing many sites I haven't found the answer for this silly error.
Using the native language of the software, I'm assigning a value to the Transfinite property of a bunch of lines (with no consecutive ID's) in my model, using this syntax:
value = 10;
For i In [81, 83, 85, 87, 72, 73, 75, 77,... |
I'm starting to look at ways to analyze the output of a mass spectrometer. My first searches led to some white papers far from what I'm looking for (complex molecules vs simple atoms for me). With mass spectrometers being over a century old I'd thought it'd be easy to find algorithm to extract data from the spectra, bu... |
I'm searching for an algorithm that can generate a set of 500 to 2000 characters from the alphabet a-z, A-Z, 0-9 (no interpunctuation) where the set has the following properties:
highly compressible with gzip, ideally compressing 2000 characters input to 200 characters output, and
generated text looks "random enough" ... |
I am trying to solve the following problem:
$$ \frac{d^2y}{dx^2}=\sinh(y) $$
Where the boundary conditions are: $y(0)=-1$, and $ \frac{dy(x\rightarrow \infty)}{dx}=0 $. Through central difference approximation, this can be simplified to:
$$ y(x_{i+1})-2\cdot y(x_i)+y(x_{i-1})=h^2\cdot \sinh(y(x_i)) $$
Where $h$ is the ... |
I am interested in computing the dispersion / phase error(s ?) of an (explicit) Runge-Kutta method when applied to a linear system of ODEs
$$ u'(t) = A u(t). \tag{1} \label{1} $$
To begin, consider the linear test equation
$$u_t = \lambda u = (x + iy) u \tag{2}$$
and a $S$-stage Runge-Kutta method with stability polyno... |
I'm soon going to start a job as a Scientific Computing software developer. My responsibilities as discussed with the manager are as follows:
Analyzing/understanding the existing functionalities (numerical algorithms and physical models) in the 2nd version of the code, written in Fortran.
Acquiring skills and knowledg... |
I'm looking at the solution to a structural mechanics problem that is modeled with first-order elements and then as a comparison with second-order elements. It is clear that the first-order elements behave as very stiff elements and give very different displacements compared to the second-order elements. But shouldn't ... |
LAPACK.gglse allows me to solve
min x^T Q x
s.t. A x = y
(in my present use case, $Q$ is symmetric positive definite)
without having to think about the numerical stability, computational efficiency, and bug potential of my own attempts of wiring up the solution
x^* := L y
where L := Q^{-1} A^T (A Q^{-1} A^T)^{-1}
Doe... |
recently I need to solve a 2D steady state PDE equation.
It’s not time dependent, and the only two independent variables are z and r direction.
So far for this solution, I was thinking using Method of Lines (MOL) to semi-discretize only the r radius direction and source term, leaving the spatial z coordinate and Tempe... |
I am looking for advice on what numerical methods to consider to solve optimization problems like the following, ideally with as few evaluations of the objective function as possible.
I am looking to maximize a one-variable function $f(x)$ on an interval $[a, b]$.
The function is a black box and cannot be computed out... |
I have an oscillatory data generated vs time as shown below. Essentially, I want this data to be averaged and free of any oscillations. I am not satisfied with the results from a simple moving average algorithm. Which moving algorithms or approaches are worth trying?
|
Please, someone tell me what is wrong in my code it does not give any outputs ( No plot nor print).
The code is as below:
from scipy.integrate import solve_ivp
import numpy as np
import matplotlib.pyplot as plt
from math import sin, cos, pi
def f(t,p):
# assigning each ODE to a vector element
r,θ,ϕ,x,y,z = p
... |
I have multiple set of input (5 parameters) and output from an unknown function. But I know this is a polynomial function.
What method can I use to optimize to find the polynomial variable that can fit those parameters? A lot of optimization method that I know need a known function.
I have tried optimizing the polynom... |
In a current research project, I have a number of matrices with coefficients in ℚ[] for which I want to understand how their rank depends on the value of the parameter .
These matrices are:
sparse (a typical example is a matrix of size 160x200 with less than 10 non-zero entries per row),
rather 'regular' (each entry i... |
Recently I have obtained a csv value form and experiment I have computed. However, I was trying to understand how each individual component being calculated. The image attached shows sample point deformation with time as each row represent a time step (I am not sure if I can upload the csv file here as there is no uplo... |
I am running a program that uses [a lot of] looping to perform a type of bootstrap analysis. The computational step - PCA - can take a long time (60+) seconds, which means that collectively this program could take almost a week to run serially. I have tried using multiprocessing on a high performance cluster - using co... |
Do you suggest any references (papers, monographs, books) about the philosophy of computational science?
Recently, I found out about the following two:
Winsberg, E. (2009). Computer simulation and the philosophy of science. Philosophy Compass, 4(5), 835-845.
Winsberg, E. (2010). Science in the age of computer simulat... |
as I have to design a reactor and therefore have to get its length x, I have to solve the following differential equations:
$$D_{eg}\tfrac{d^2A_g}{dx^2}-u_g\tfrac{dA_g}{dx} = k_la_b\left(\tfrac{A_g}{H_A}-A_l\right)$$
$$\frac{}{}D_{el}\frac{d^2A_l}{dx^2}-u_l \tfrac{dA_l}{dx}+ k_la_b\left(\tfrac{A_g}{H_A}-A_l\right) = (1... |
Where can I find a source code for the SSOR method with Eisenstat's trick?
The original paper includes pseudo code but also seems to have minor typos. For that reason, I would be very happy to see an implementation somewhere. Unfortunately, I haven't any in the common libraries (perhaps the code is hidden to deep).
|
I am trying to compute $\mathbf{X}\mathbf{u}$ for many times in my algorithm, where $\mathbf{X}\in \mathbb{R}^{n\times m}$ and $\mathbf{u} \in \mathbb{R}^{m}$. The problem is that, during the computational process of the algorithm, $\mathbf{X}$ is a constant, however, more and more elements in $\mathbf{X}$ can be chang... |
I already asked this question on StackExchange Mathematics, but it seems too domain-specific. Searching where to put Computer Vision related questions it was suggested to use Computational Science since there is no specific CV StackExchange branch.
With the direct linear transform, one can calibrate a camera and receiv... |
I was reading a book by Simon Haykin on neural networks when I came across the following strong statement (on the pdf's page 188):
"However, we still have a computational complexity that is
$\mathcal{O}(W^2)$, where $W$ is the size of weight vector $\mathbf{w}$. Quasi-Newton methods are therefore
computationally imprac... |
What are the most prominent use cases for Java in scientific computing?
I've viewed the domain heavily C/C++, Fortran and possibly Python dominant, but what about Java?
|
Software like Diamond and VESTA allow users to build a supercell by extending the structure along the basis vectors of the latttice. However, I'd like to do something more general and build a supercell from an arbitrary integer matrix transformation. For instance, if I want to convert a primitive hexagonal unit cell in... |
I am developing a model to represent a dam, shown in the picture below. The geometry in the white circle is the curtain, which is required to be curved. I extruded this 2D face (including the indicated by the cut white line) at a distance $z_0$ to the back, resulting in the shape in the red circle.
Given some constrain... |
Context:
I am trying to reproduce a figure from Keeling 2007 that illustrates time lags that can occur between the peaks (maximum) of the infected solutions for two subpopulations of a metapopulation model that uses deterministic $SIR$ equations (where $X=S$ and $Y=I$). The equations that model the subpopulation dynami... |
Problem description
We have a graph $G=(V,E)$. $V$ is the set of nodes. $c_{ij}$ is the profit of traveling through edge $(i,j)$. $T=\{1,2,3,...\}$ is the set of discrete time steps.
At each time step, we have a set of packages that we need to transport to their destination. $d^t_{i,j}$ is the maximum number of package... |
I am trying to solve a simple working example, a linear system $Ax=b$, where $A$ is sparse SPD and $b$ is dense, using CHOLMOD.
#include <cmath>
#include <iostream>
#include <vector>
#include "suitesparse/cholmod.h"
int main()
{
cholmod_sparse *a;
cholmod_dense *x, *b;
cholmod_factor *L;
cholmod_common... |
I am trying to solve a discontinuous ODE using the lsode solver. I tried setting the t_crit parameter to specify the time where the discontinuity is present, but it didn't help.
The analytical solution of the ODE looks like the following, where the discontinuity appears at $t = -0.433$, which is the value I set to the ... |
VTK has had support for visualizing arbitrary-order Lagrange elements for a while now, but there aren't many resources out there (as far as I know) facilitating their use. Notably, these elements rely on a particular "onion-like" node ordering which many solvers (including mine) don't use by default. This means that pe... |
I wish to compare the value of the normalized concentration (c+), between two contour plots (one is experimental and another is a simulation). If I don't have a c+ value from the same point on both plots, how can I compare? (A few data points and interpolation generate them). I want to know which turbulence model per... |
I want to solve the compressible 1D Euler equations numerically.
Theory says that for subsonic inflows, one can prescribe two variables, e.g. pressure and temperature. Density can then be computed with the equation of state, but how is the velocity calculated?
For subsonic outflows only one variable can be prescribed. ... |
Let $x$ and $y$ be representable floating point numbers. I'm looking for a unit test which can ensure that my user's compiler has not made the reciprocal approximation $\mathrm{fl}(x/y) \approx \mathrm{fl}(x)*\mathrm{fl}(1/y))$ as an optimization. However, I have been unsuccessful in coming up with a compelling example... |
I've been working with TensorFlow and I'm very impressed with its automatic differentiation capabilities. I'm wondering what the state of the art in automatic differentiation for finite element methods (and other pde solvers) is. Has automatic differentiation rendered adjoint methods for computing sensitivities of obje... |
Is there a fast method to compute an orthogonal complement of an arbitrary matrix $U\in\mathbb{R}^{m \times n}$ in BLAS / LAPACK?
Specifically, I want any matrix $V\in \mathbb{R}^{m \times (m - \text{rank}(M))}$ such that
$$
\text{rank}(U|V) = m.
$$
The singular value decomposition methods in LAPACK can do this if call... |
I want help with my Octave code regarding the unsteady heat equation.
My geometry and mesh are generated with FreeFEM++, so there is no problem with that (I tried it with the steady problem with no for loop and it worked just fine).
But when I introduce the for loop to iterate with the time step and try to visualize th... |
I need to compute the logarithm of the binomial coefficient,
$$\log\binom{x}{y} = -\log\mathrm{B}(y + 1, x - y + 1) - \log(x + 1)$$
accurately, where $\mathrm{B}(x,y)$ is the Beta function.
I'm aware of packages computing $\log\mathrm{B}(x,y)$ accurately, but even using these I get some cancellations in the above formu... |
I've got some code that I need to squeeze every bit of both time and space out of. I'm looking for a better solution to the following problem.
For reasons outside of the scope of this question, I wrote a non-native data type Z2 that effectively wraps an array of three int8_ts and defines some operations over them. Most... |
I want to calculate the total time taken for a fixed code run using an NVIDIA GPU (for instance, Tesla K40). The code has to run 1 million single-bit comparisons. All the comparisons are independent of each other. There is no memory access involved during the execution of the code since the complete data (2 bits per co... |
Me and one of my colleague are trying to simulate the three-body problem with a C++ program in order to compare different integration schemes. At the moment we are trying to use the Euler's method, but we're stuck on a divergence problem.
Using the attached code we obtain the result in the figure below, in which the th... |
Recursive least squares can be implemented using the Sherman–Morrison formula to avoid resolving, however, have better methods without $n^2$ cost been developed? I'm interested if there is a good randomized approach here.
|
first of all thank you for all the answers you gave me yesterday for the integration via Symplectic Euler's method of the three-body problem.
We managed to implement both Euler's and Runge Kutta 4's method using C++, but the results are distinct. Since the three bodies move chaotically, we cannot understand which of th... |
In the paper [1], author has discussed a distinction between the 3 types of computations: numeric, combinatorial, and geometric. The author says that Geometric computation is one that has elements of both combinatorial and numeric computation. That is:
Geometric Computing = Numerical + Combinatorial Computing.
Numeric... |
I have a bit lengthier ODE function which was simulated by using Scipy solve_ivp function. During this simulation I calculated many parameters but as the output, I am taking out put only some other parameters in return function.
But now I need to get some values of some other variables I used during the intermediate st... |
For solving a linear system,
$Ax = b$.
If $A$ is a dense but symmetric $n \times n$ matrix, how much memory is required?
$A$ is symmetric, which means only the upper (or lower) triangular part of $n \times (n+1)/2$ entries would be necessary. Does $A$'s memory requirement have to be 8 bytes $\times n \times n$ or can i... |
I am struggling with this assignment.
I have to write an upwind scheme for the following PDE:
$$u_t+a Du=0 \quad\mathrm{on}\;(-1,3)$$
$a$ is said to be positive, the initial condition is $\sin(2\pi x)$
and periodic condition on the inflow border.
It seemed easy to me so I wrote this on Matlab but I am struggling with c... |
Could someone please point me to an understandable definition of the Kolmogorov n-width? I'm having a hard time figuring out what is the output of the definition - is it an integer?
Edit: I realize that my question was not well-posed. This paper defines the Kolmogorov n-width as
$$
d_n(\mathcal{M})= \inf_{\mathcal S_n}... |
How to efficiently convolve the function $h(t)=H(t)e^{-t}$ with a function $x(t)$ sampled non-uniformly, i.e. $\{x(t_0), x(t_1), ..., x(t_{N-1})\}$?
$H(t)$ is the Heaviside step function, and the Fourier transform of $h(t)$ is $\tilde{h}(\omega)=(1-i\omega)^{-1}$.
What I have done
If $x(t)$ is sampled uniformly, I can ... |
This is not a homework, but a hobby project, and maybe not all terms I use are correct - please help to fix.
Imagine there are K vectors in n-dimensional space. I would like to:
validate whether they can correspond to K+1 planes enclosing a volume (is that called a polytope?)
validate whether a given further vector is... |
I have experience with classical linear algebra packages in C++ like Eigen, Blaze, etc.
I have never wrote my own PetSC back-end solver but I used/modified several of them.
In a new project I would like to use Tpetra with CUDA acceleration (by kokkos?) for a dense linear algebra problem.
The initial version of my code ... |
Given the Algebratic Riccati Equation (ARE) $$A^T X + XA + XRX + Q = 0$$ where $A,R,Q \in \mathbb R^{n \times n}$, we are interested in the matrix $X$ that solves this equation. If we define the $2n \times 2n$ Hamiltonian matrix $$H = \begin{bmatrix} A & R \\ -Q & -A^T\end{bmatrix}$$ and let $X = X_2 X_1^{-1}$, then $H... |
I have just learned Geant4 and recently I tried to simulate photons emitted into lead. After I collected the data and figured out the transmission of photons. I found my data is bigger than the transmission data from XCOM.
Here's my PhysicsLists
void PhysicsList::ConstructParticle()
{
G4BosonConstructor pBosonCons... |
I am trying to use the Kramers-Kronig algorithm to transform the real and imaginary contributions to the anomalous scattering factor from a diffraction anomalous fine structure (DAFS) experiment.
I have fit a smooth curve to my experimental data using the lmfit package, and the following function:
def intensity(en, phi... |
I am trying to solve a coupled system of ODE's using the solve_ivp function from scipy. The general form of the equation is given via
$$\dot{y}(t) = M(t)y(t).$$
The time dependence of matrix is basically sourced by a sum of weighted cosines, and each term (should) be shifted by some random phase factor. The input signa... |
I am looking up celestial navigation, and according to
https://youtu.be/-ARXW8InStY?t=3320
a specific sun angle reading (sun angle above the horizon) will be the same on a small-circle with the centre point where the sun is at its zenith on earth.
I would like to convince myself about that using Stellarium, but I would... |
I just for the first time saw the function softmax() in this SO answer to How do I use a minimization function in scipy with constraints and was intrigued.
Another way of weighting variables where the sum of the weights is constrained to equal 1, is to use minimize with no constraints, initialize with near-zero values... |
I've recently started looking into writing a finite-differences-based solver for the Poisson equation of the form
$$\nabla\left(\varepsilon\nabla\varphi\right)=\rho$$ in 2D for arbitrary geometries (some additional details can be found here). However, I've soon discovered that upon imposing pure Neumann boundaries the ... |
I have a problem that consists of a linear hyperbolic differential equation with some boundary and initial conditions which leads after discretization in space using finite elements to the following second-order system:
\begin{equation}
\boldsymbol M \ddot {\boldsymbol d} + \boldsymbol C \dot {\boldsymbol d} + \boldsym... |
Given the discrete Lyapunov equation $$AXA^T - X + Q = 0$$ how can I solve for $X$ as a function of the eigenvectors of some matrix $H$?
More precisely, in the case of the continuous Lyapunov equation $$AX + XA^T + Q = 0$$ This equation can be re-written as
\begin{align}
AX + XA^T + Q &= 0 \\
\begin{bmatrix} X & -I\end... |
I am trying to write a code for 9 point discrete laplacian. I would like to write a matrix and solve the linear system $AU=F$ with gradient conjugate method.
I wrote the matrix this way
I=speye(M-1,M-1);
E=sparse(2:M-1,1:M-2,1,M-1,M-1);%matrice con 1 sulla sotto diagonale
T=E+E';
B=-1/6*(T+4*I);
D=1/3*(2*T-10*I);
A=(-k... |
I would like to collect some test-problems for nonlinear hyperbolic PDEs (Euler Equations, Shallow Water Equations, Ideal MHD, Acoustic Perturbation, ...) for which analytical solutions are known.
A famous example of this is the isentropic vortex advection by Shu for the 2D Euler equations.
For the Euler equations, som... |
I was trying to understand more in detail how a blocking MPI all to all really work. Of course, the actual all to all traffic is pretty straightforward, what I can't understand is how it is able to "keep" blocking until the collective is done.
I currently have two theories:
For each rank the call is blocking until it ... |
When using the backward and forward Euler methods to solve a certain stiff differential equation, what criteria does one look at before drawing the conclusion that one is more stable than the other?
|
I am trying to numerically solve a differential equation but I am having trouble getting the convergence test to run properly. The problem is as follows:
Consider an ODE
$$y'(t) \enspace = \enspace f(t,y) \quad , \qquad y(0) \enspace = \enspace y_0 \quad . \tag{1}$$
Let now $y^{h}$ be a numerical solution to $(1)$ wit... |
I am currently working on writing a MATLAB code for running a finite element simulation of a hyperelastic material in 2D. Since I am building this simulation as a part of a fluid-structure interaction analysis, the 2D assumption is usually carried out using plane strain conditions. I started from Kim's textbook since h... |
My colleague and I are trying to study the three-body problem, with different integration schemes, starting from the two-body problem. We implemented the symplectic Euler scheme and the Runge–Kutta 4th order in C++, and the trajectories obtained are the following.
As we can see, they are almost elliptical with Euler ... |
I am going to solve this advection equation regarding the flow simulation of an energy tower
\begin{equation}
Y_t+ v(t) Y_x =0
\end{equation}
with the following boundary conditions which depend on the direction of the flow
\begin{align}
Y(x,0) = Y_0
\end{align}
And
\begin{align}
Y(0,t) = Y_{bot} \text{ if }v(t)>0 \\
... |
I've noticed that a fairly significant number of cycles in one of my programs are being consumed by the logistic function:
$$f(x)=\frac{1}{1+e^{-x}}$$
Is there a good approximation I can use to reduce the cost of this function?
|
Suppose I have 4 processes and each process has $n_i, i=0,1,2,3$ elements. In particular, with rank $0$, we have loc indices list $[0,1,\ldots, n_{0}-1]$ and $1$, we have loc indices list $[0,1,\ldots, n_{1}-1]$ and so on.
Now, I want a global list that is a combination of the above local indices. And it should look a... |
Consider the following linear PDE:
$$\nabla_q V(q) - M_d(q)M^{-1}(q)\nabla_q V_d(q) = 0,$$
where $V(q)$ and $M(q)$ are known and $M_d(q)$ is a grey box function (e.x., $M_d(q)$ is fitted using a neural network). The goal is to find $V_d(q)$.
I am able to find a solution for $V_d(q)$ using physics informed neural networ... |
This specific question was raised from optimizing parameters of column experiments in the hydrogeological context. I want to optimize a parameter of interest (in this case $D$), based on experimental data (which is a breakthrough curve, an array of $c$ at the efflux-end of the column with corresponding $t$) and some fo... |
I am trying to numerically integrate a differential equation using scipy.integrate.RK45 and/or scipy.integrate.LSODA.
Now, I am trying to fix the integration step sizes of both solvers. This, however, does not work out. I have tried the following:
1.) Setting the "h_abs" method to my desired step size BEFORE every call... |
I am trying to implement a cloth simulation in c++ using verlet integration and I'm getting some odd issues that I can't seem to explain, the points in the cloth seem to fly around and have weird behavior.
to investigate I tried to simply place 2 dots next to each other horizontally with a single constraint and to pin ... |
I have a cubic lattice $L_1\times L_2 \times L_3$ with the periodic boundary condition.
I have to construct the Laplacian matrix in the sparse format. My matlab code is like this
L = 30;
dim = L^3;
COO1 = zeros(2, dim*6);
ss = 0;
for s1 = 0: L-1
for s2 = 0: L-1
for s3 = 0: L-1
ss = ss + 1;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.