instruction
stringlengths
43
28.1k
I am trying to optimize a non-linear least squares problem with scipy.optimize.minimize. I have simplified my actual problem down to the case where I am just computing the top 'principal components' like in a PCA analysis and the method reports failure to converge (as it does for my full model). However, the result mat...
I want to numerically solve the following equation for $\phi$ on $\mathbb{R}_+^{*2}$: $$ \partial_t \phi (w, t) = \int_0^{+ \infty} k(\alpha w + \beta w', w') \phi(\alpha w + \beta w', t) \phi(w', t) ~dw' - \int_0^{+ \infty} k(\gamma w + \delta w', w') \phi(\gamma w + \delta w', t) \phi(w', t)...
Let $f \in C^0[0, 1]$, and suppose $f \ge 0$. How can I compute $\sup f^{-1}(0)$ efficiently?
I am dealing with a coupled ODE. I have already plotted the solutions out using odeint, but I want to get the value of equilibrium. The ode looks like this: IN,EnN,c,l,XN,N_init,Bx_init=0.1,0.01,0.1,0.1,0.1,0.4,1 init = (N_init, Bx_init) def model(init,t, IN, EnN, c, Qn, l, XN): N_prime = IN - EnN - c*init[1]*init[...
How can I compute the Big O complexity of the Branch and cut algorithm? I am solving an integer linear program using MOSEK that includes $M$ binary variables, but I do not know how to calculate the exact complexity. Is it just O($2^M$)? or are there problems solved at each branching node that have extra complexity to b...
For unums, there is good evidence (see figure 5) that accuracy is better than IEEE floats. (Note: I use the term "unum" broadly to refer to any of the various iterations and revisions to the format.) However, generally we regard "stability as more of a constraint than accuracy". Are there numerical algorithms which can...
I'm endeavouring to use cuSolver to solve a sparse linear system. But when I run my code, it fails with CUSOLVER_STATUS_INTERNAL_ERROR. What's going wrong? How does one debug this error? My MWE follows and uses two data files (chosen somewhat arbitrarily): mat65k.mtx - Manually remove the lines beginning with % rhs650...
I am contacting research and I came across an algorithm in FORTRAN, with which I am not familiar. For the code above I have two questions: What does "DO 1 (...)" mean? I see that there is a "1" on the left of line 6. Does that mean it references line 6? Shouldn't DO statements close with "END DO" ? Thank you in ad...
I am new to understanding pseudorandom number generators and sometimes feel daunted by them. For some time I have used the following approach in my work: In one file, I'd have import numpy as np np.random.seed(1) my_random_process() In another file, I'd have import numpy as np np.random.seed(2) my_random_process() an...
I am trying to compute a matrix-matrix product of N stacked complex double N x N matrices. For simplicity, I assume N = 512. I have written code in C++ parallelized with OMP and using OpenBLAS for the matrix-matrix product. This is the code: #include <iostream> #include <complex> #include <chrono> #include <openblas/cb...
#include <stdio.h> #include <string.h> int main() { float s=0; int i, n; printf("Quantity of terms:"); scanf("%f", &n); for(i==0; i<=n-1; i++); { s=s+1/(i+1); } printf("Sum: %f", s); return 0; } Hi. I'd like to sum up the series $1+1/2+...+1/n$, but I always get the sum zero... Could someone help me? Thank you...
I am attempting to create a python function to assist in calculating the following numerical integration of the Huygens Fresnel integral in the form of def fresnel(x_,y_,x,y,z) where x_ and y_ are $x'$ and $y'$ coordinates. $$E(x,y,z)=\frac{1}{i\lambda}\iint_{-\infty}^{+\infty}E(x',y',0)\frac{ze^{ikr}}{r}dx'dy'$$ where...
I am currently performing optimization onto a quadratic function by manually coding the algorithm: $$\min f = x^T v x - r^T x\\ \text{subject to } x \geq 0\, .$$ Here, optimizing the function without the constraint above is not a problem at all. However, if I want to add this inequality constraint, I do not know how ca...
Edit on May 3rd: I have found the problem. Because the difference of between $k_1$ and $k_2$ is huge, a very small time step need to be chosen so that the right green part can "feel" the heat from the left. Otherwise the temperature profile in the green region would barely change. However, this requres a lot of computa...
I have a set of points of $\mathbb{R}^2$ which is organised in subsets: $$ \cup_{0\leq i<N} \left\{ P_i^j \in \mathbb{R}^2, 0\leq j<M \right\} $$ For all $(i,j)$, I want to find $P_k^l$ in another subset (with $k\not= i$) so that $d(P_k^l,P_i^j)$ is minimal. And "of course" (*), many points with $k=i$ are in general mu...
I come across the following operator in a paper $\mathcal{I}\psi = \psi_{xxxx} + (r~\psi_x)_x$, where $\psi=\psi(x)$ and $r=r(x)$. Periodic boundary condition is employed. It claims that the operator $\mathcal{I}$ is symmetric. Suppose I use finite difference to discretize it, then the first part $\psi_{xxxx}$ is obvio...
I want to decrease the computational time for solving a large number (>1000) of least-squares problems. Given a matrix, the system matrix for each least-squares problem is a submatrix of the given matrix. My idea is to precompute a matrix decomposition of the given matrix, then reuse it for each least-squares problem. ...
I would like to solve the Navier-Stokes equations for the unsteady problem of the flow around a circular cylinder. I would like to understand how to write mathematically the boundary condition for the pressure on the surface of the cylinder (essentially the circle). The domain of the problem is shown in the image below...
Is there a mathematical algorithm that can determine whether a problem is parallelizable? Possibly similar to how the definition for "computable" works out: https://en.wikipedia.org/wiki/Computable_function So a parallelizable program is a program that ...?
I want to fit this data. I have the following model functions. Classic gaussian: def gauss_model(x, mu, sigma): return np.exp(-0.5*((x-mu)/sigma)**2) And a gauss-hermite parametrization, taking account for skewness (parameter h3) and kurtosis (parameter h4) of the distribution: def losvd_param(v, v_rot, v...
I know this is trivial but I don't seem to understand it. In which step of the FE formulation do we enforce the global continuity of the solution? Or in other words, how the construction of the local basis functions on each element allows to glue the solution with continuity across neighbouring elements? To explain wha...
I have been reading the neural ODE paper and I understand that neural ODEs have a continuous depth model structure. And I understand the fact that they are especially very useful for time-series data. But from the benefits of neural ODEs stated in the paper, I can't understand what they mean by adaptive computation. Ca...
I am trying to educate myself on the lattice Boltzmann method to see if it may be useful for simulating some problems in plasma physics that I am interested in. One thing that strikes me is the (seemingly) universal adoption of BGK-style collision operators. Is the method intractable with more sophisticated collision o...
Consider the problem $$u_t - \Delta u = f \text{ on } \Omega\times (0,T)\\u=0 \text{ on } \partial \Omega\times (0,T) \\ u(x,0)=g(x) \text{ on } \Omega$$ with $g$ NOT vanishing on the boundary. If I use a FEM discretization in space, what is the best a priori error (considering both space and time) that I can hope for...
Consider a domain $\Omega \subseteq \mathbb{R}^{2,3}$ which is non convex and with $C^2$ boundary. Could you recommend a good reference where it is explained how: without needing isoparametric elements with a triangulation of simplices one can obtain: some space of linear finite elements $S^h_0$ which vanish on $\p...
I have an integer quadratic program of the form, \begin{align} \underset{x}{\max}&\;\;\|Ax-b\|_2^2\\ \text{subject to}&\;\;x\in{\bf Z}\geq0 \end{align} I'm currently using the (admittedly crude) convex approximation which relaxes the integer constraint, and then recovers a feasible point by rounding each component of $...
I am currently interested in billiards and their trajectories. I would like to simulate a billiard inside a water-tight mesh. A mesh basically consists of a list of points in 3D space (vectors with 3 entries) together with a list of 3 vectors of natural numbers, which specify the corner points of each triangle. Now, I ...
At the Top "right", there is the 2D-density plot of the recorded data (actual), fewer in number. Recorded data has been sampled a on the 8 arms of a regular octagon. These 8 arms are placed along x and y axes and along the diagonals. On the top-left is the interpolated data (thin-plate) of the actual data, i.e. large...
I am solving the equation $$ \frac{\partial \phi}{\partial t} = \frac{\partial}{\partial x} \left( D \frac{\partial \phi}{\partial x} + v\phi \right) $$ using finite differences. I want to include Robin boundaries, that is, boundaries that are closed to both advection and diffusion. I read this excellent question on it...
Note; No special knowledge of Pykrige is needed to answer the question, as I already mention examples in the question! Hi I would like to use Universal Kriging in my code. For this I have data that is structured as follows: Latitude Longitude Altitude H2 O18 Date Year month da...
I am looking in ways to include energy dissipation while propagating a coherent wavepacket in a 1d TDSE. for example I use the split step method: exp[Δt(D+V)]≈exp[ΔtV/2]exp[ΔtD]exp[ΔtV/2], and subtract some epsilon value from the kinetic energy term every step. What other ways can I dissipate energy from the system so ...
I am interested in using a numerical wave tank (NWT) to study the performance of various water wave dampers using MATLAB. I am looking at nonlinear water waves. My current NWT (2d, periodic) is based on the Zakharov/Craig-Sulem formulation, where the Dirichlet-Neumann map is represented via Cauchy integrals and spatial...
I am trying to solve the following PDE by using finite difference \begin{eqnarray*} \Delta u&=& f ~~on~~(0,1)\times(0,1)\\ \frac{\partial u}{\partial y}(x,0)&=&0=\frac{\partial u}{\partial y}(x,1)~for ~x\in[0,1]\\ u(0,y)&=&u(1,y)~for ~y\in[0,1]\\ \end{eqnarray*} For a uniform spacing $h$, I got the following equat...
This is related to my question here https://math.stackexchange.com/questions/4447383/lax-wendroff-scheme-stability-analysis-for-a-linear-system-of-conservation-laws . Consider the numerical scheme given by the finite difference equation: \begin{align*} Q_{i,j,k}^{n+1}&= \Big(I- \frac{\Delta t^2}{\Delta x^2}A^2-\f...
How would you describe the Galerkin method to solving the 3D wave equation $$u_{tt}= c^2\Delta u$$ to someone who wants to implement it immediately? More precisely, we want to solve the Cauchy problem $$u_{tt}= c^2\Delta u , \\ u_t(x,y,z,0)= g(x,y,z) , \\ u(x,y,z,0)= f(x,y,z)$$ where $f, g$ are given compactly support...
I would like to convert this problem into a QP (Quadratic program). $$\text{Maximize } \sum_{k=1}^{K}\sum_{n=1}^{N}log2(1+p_{kn}b_{kn})\\ \text{subject to } \sum_{k=1}^{K}\sum_{n=1}^{N}p_{kn}\leq P_{0}\\ p_{kn}\geq 0, \forall k,n$$ The variables are $p_{kn}, \forall k,n$ Since the optimization variables are continuous ...
I am new to solving PDEs, but have been looking at different implementations of finite difference and finite volume schemes. One thing I have noticed in different implementations is that some implementations use sparse matrices while other implementations--of the same algorithms--use basic loops. I can understand that ...
So I am trying to solve two equations simultaneously. The goal is to find values for $\frac{de}{dt}$ and $\frac{d}{dt}$ which are the rates of change of the variables $a$ and $e$. I am then progressing the system through time by multiplying the rates by a certain time step and adding this to the starting values to obta...
I'm hoping that this type of question is on-topic, and I have put in a little hunting to make sure it isn't a flat out repeat. If it is either of the above, I apologize in advance. I'm an early career computational mathematician who is at least minimally capable with C++, and pretty proficient with something like MATLA...
I would like to know if Taylor-Hood elements $P_2$-$P_1$ form a stable pair for the mixed approximation of Darcy's equation ( or Poisson's equation) with Dirichlet B.C. In the literature I only find them only in the context of the Stokes problem.
This is the $2$-dimensional wave equation $$ u_{tt} = u_{xx} + u_{yy} $$ with initial condition $u(x,y,0)=f(x,y)$ and $u_{t}(x,y,0) = 0$. The inverse Fourier transform used is $$ u(x,y,t) = \iint \hat{u}(\omega_{x}, \omega_{y}, t)e^{(2\pi) \omega_{x} i x} e^{(2\pi) \omega_{y} i y}d\omega_{x} d\omega_{y} $$ this is also...
I am currently making use of a 2D vector field that I would like to be able to describe and characterize. I thought of a few metrics that I could use, but they seem limited for both a qualitative and quantitative analysis. I believe that the divergence and curl of the field would be interesting. The vector field could ...
I need to place a given finite set of points within maximum distance of each other on 2D, constrained by a convex boundary, on Python. Honestly, I'm kind of lost. I have the explicit function to be minimized, but I'm not sure which algorithm I should use to adjust the points recursively. I thought of experimenting with...
Suppose I have a PDE in a rectangular domain that I am solving numerically via a finite difference method. How do I answer the question, "How fine do I need to make the grid to so that my solution is within $\epsilon$ of the true solution?" We can assume some basic interpolation scheme is used to fill in the points out...
I'm trying to implement a numerical method used in quantum chemistry from scratch. I'm using this paper as a reference. It's also available on Sci-Hub. So, the method requires calculating integrals of each spatial dimension (x, y, z) using recursive relations but I got completely lost on how it can be implemented in th...
I am looking for a way to sample points uniformly around a particular point on the unit sphere. Working on spherical coordinates we can express any point on the unit sphere as $(\sin\theta \cos\phi, \sin\theta\sin\phi,\cos\theta)$. Say the initial point $r_0$ has coordinates $(\sin\theta_0 \cos\phi_0, \sin\theta_0\sin\...
I have a spline-based model where I have a set of control points in 3D space. I want to compute pairwise distances between every point on a regular 3D grid and these control points. Is there an efficient algorithm to do this in terms of space (i.e. not having to calculate the full distance matrix)? One thing is that th...
$C=F^TF$ is called the "Right" Cauchy-Green tensor, and $b=FF^T$ is called the "Left" Cauchy-Green tensor. I suppose in $C=F^TF$ the non-transposed $F$ stands on the right, and in $b=FF^T$ it stands on the left, but I guess there's gotta be more to it? Is there any reason for why they are called "right" and "left" spec...
I would like to compute the material derivated of a tensor quantity, in the context of the finite volume method (FVM): The equation is: $$ \frac{\mathrm{d} \textbf{T}}{\mathrm{d} t} = \frac{\partial \textbf{T}}{\partial t} + \vec{v} \cdot \nabla \textbf{T} = \underbrace{\frac{\partial \textbf{T}}{\partial t} + \nabla \...
To my frustration I am struggling to implement leapfrog integration for the time dependent Schrödinger equation. To the best of my knowledge this was first explicitly done in "A fast explicit algorithm for the time‐dependent Schrödinger equation" in 1991 (see https://aip.scitation.org/doi/abs/10.1063/1.168415). I'm fol...
I am currently working on a project where I have used an RK4 integrator to attempt to solve the three-body problem. An interesting result that I found, was that decreasing the size of the time steps only improved accuracy until a certain point where the accuracy started to decrease. Is this normal for RK4 integrators o...
Do you think that the RobOptim optimization library (which I read about in C++ library for nonlinear constrained minimization) could be used for real-time optimization for the velocity control of a robot? Being more specific, I have a distance function that I want to minimize between a point of the robot and an obstacl...
I have a system of conductors for which there are two dense matrices of the (complex) mutual admittances, $Y_A$ and $Y_B$, which are symmetric. Then, an equivalent nodal admittance matrix $Y_N$ is calculated by the following: $$ Y_N = A^T \cdot Y_A \cdot A + B^T \cdot Y_B \cdot B $$ where $A$ is a directed incidence ma...
I am writing an Alternating-Directions Implicit Method for simple 2D diffusion ( \begin{equation*} \frac{df(x,y,t)}{dt}=D\Delta u \end{equation*}). Tridiagonal matrices are solved via Thomas algorithm (LU decomposing). def calculateADI(u,delta_t, delta_x, size, D): a1 = np.ones((size), dtype=np.float64) b1 = n...
I need some clarification regarding the time step used in the molecular dynamics simulations. In the first simulation the time step was 1 nanosecond and in the second simulation the time step in 10 ns. Now I want to compare the results of these two simulations. For example take mean-square displacement. $$ MSD(1ns) = \...
The R package rmarchingcubes implements a marching cubes algorithm. Given a voxel contructed from a function defining an isosurface, it returns a 3d mesh with some vertex normals. When I plot this surface, it is incredibly smooth. If instead of the rmarchingcubes normals, I use the classical normals obtained by averagi...
I have the following problem. I must sample from a discrete distribution that is changing at each sort. Let me explain, with a "vivid" description, I draw a color ball from a bag. The probability associated with each color is different (for this part I could choose an alias method, for example, the Vose's algorithm). B...
Given a rectangular finite elastic sheet $ABCD$ containing an arbitrary horizontal cut (or discontinuity) $EF$ in its interior. The edge $AB$ of the sheet is tethered but $CD$ is stretched by $\Delta$ such the horizontal cut is pulled down and "stretched open" as shown below. I would like to determine the function $x ...
In basic lectures on finite elements theory, people always assume $H^2$ regularity of the solution in order to derive $O(h^k)$ a priori estimates in the norms $H^{2-k}$, $k=1,2$. For simplicity let's restrict to the usual Poisson equation. I would be interested in a reference of what rates can be expected, in both norm...
I am trying to solve for the order parameter ($A$) in the Ginzburg Landau equations. I had asked on the math SE site but was recommended to ask here. We are trying to solve the following equation, (with the implied sum over $j$, for each component identified by $\mu$, $i$), $K_i$, $\beta_i$, and $\alpha (T)$ are known ...
Having a single parity bit gives a Hamming distance of 2, so only one single bit can be corrupted to reliably detect an error. The next step I know of would be a Hamming code, which uses at least 3 parity bits. However, is there a method which uses two parity bits and performs better than just a single parity bit? I do...
I am pretty new to using FE solvers. I am trying to solve a system of (up to) 9 complex equations. We write these as a matrix equation (here), (with the implied sum over $j$, for each component identified by $\mu$, $i$), and known parameters (or at least constant wrt position): $K_i$, $\beta_i$, and $\alpha (T)$; $$ K_...
I am trying to mesh a geometry using the gmsh python api, however it seems like my algorithm selection option (i.e. gmsh.option.setNumber("Mesh.Algorithm", 8) ) is being ignored. Can anyone tell me if this is a bug or if I am simply making a mistake. This code replicates the problem: import gmsh import sys h=1.0 ...
I'm dealing with the numerical resolution of advection-diffusion-reaction equations. I've encountered references on CFL conditions for conservation laws as well as advection-diffusion equations. I'm wondering if any references exist on CFL conditions involving reaction as well. I don't have any preferences on the numer...
A linear space in mathematics is a set whose elements (vectors) have operations of addition and multiplication by a scalar defined in such a way that certain properties are satisfied (commutativity, associativity etc.), and the result of those operations belongs to the same linear space, i.e., the linear space is close...
In high energy physics we oftentimes encounter the following problem. For a given parametrized matrix $\{H_{ij}(\Lambda)\}$, we know that in the limit $\Lambda\to\infty$ some of its entries become large: $$ \text{For some $(i,j)$: }H_{ij}(\Lambda)\to\infty\text{ as }\Lambda\to\infty. $$ We also know that in the limit ...
I'm comparing two optimization algorithms for deep neural networks. To that end, I train a network with the same data and starting rom the same initial weights using two different optimization algorithms. Then, I visualize the optimization trajectory within the loss landscape using this method. Besides the qualitative ...
I'm interested in mixed discretizations of the diffusion (and related) equations: $$\begin{align} \frac{\partial h}{\partial t} + \nabla\cdot \mathbf q & = f \\ k^{-1}\mathbf q + \nabla h & = 0 \end{align}$$ where $h$ is a scalar field representing thickness or hydraulic head and $\mathbf q$ is a vector field represent...
Maybe that is not the best place for the following question, if such, let me know and sorry. I would like to model the flow of expanding bentonite in a fracture following the given reference. In order to take into account the swelling pressure, they modified the Stokes equation (momentum equation) by adding the swellin...
The SDP problem is $$ \min_{Z \in S^{n},Y \in S^{m}} {\rm trace}(Z) +{\rm trace}(Y)\\ {\rm s.t.} \begin{bmatrix} Y & X\\ X^T & Z \end{bmatrix} \succeq 0\\ X \in C $$ Where $C$ is a convex set.But I have some difficulty in transforming it to the standard form: $$ \min_{X}\operatorname{trace}(CX) \\ \text{s.t.} \ \operat...
In my optimization problem there are elements consisting of a time and a value, i.e. $(t_0, v_0)$. These pairs are stored in a vector $v = [(t_0, v_0), (t_1, v_1), ... , (t_n, v_n)]$. The vector $v$ serves as an input to an optimization function $f$ that computes a cost value from the input. Is it mathematically common...
How do I find the first derivative of a coordinate set using Python? I have a list of (x,y) coordinates (plotted below in red) representing a dotted-line perpendicular between two points (connected in blue). For each red point along the dotted-line, I can get the grayscale value of the pixel over which the dot runs, a...
Crossposted on Mathematics SE CVXPY is a famous software as a solver for optimization problems. Nowadays, I use it to run a program presented in a paper, the Example 7.1, and the program runs as follows (I haven't found out how to insert my codes here, otherwise I would post them) all matrices are $4 \times 4$: $O_0$ ...
The author of the SIAM News article "Optimization Theory and Perspectives on the Field of Machine Learning" mentions: ... For unconstrained convex optimization, GD (gradient descent) convergence rates do not depend on the space’s dimensionality. In other words, if we measure a notion of how close we are to the global ...
I am trying to replicate a finite element analysis given in a research paper titled On the Detection of Stress Singularities in Finite Element Analysis 1 by G.B.Sinclair et. al. The geometry of the problem is given in Figure 1. and boundary conditions are $$ (x, y) = (D/2 < x < L + D/2) \hspace{0.5in} \sigma_y = -p, \...
I'm trying to understand autodiff better, and specifically the connection between autodiff and dual numbers, and why dual numbers are needed in the first place. The pytorch help pages about autodiff [1][2], for example, does not mention dual numbers at all. The wikipedia page, as well as other sources, suggest that it ...
I'm numerically solving a system of coupled ODEs where time is the independent variable. At each time, I can solve for the equilibrium values of my state variables where their respective derivatives go to zero and classify the equilibria as stable or unstable. For one of my variables, the equilibrium value is stable at...
When solving non-linear systems of equations, @Arnold Neumaier suggested in How can I precondition a non-linear problem before linearization? to use an approximate LU decomposition of an approximate Jacobian at the starting point to precondition nonlinear conjugate-gradient to minimize $\|F(x)\|_2^2$. Can anyone point ...
I'm trying to implement the scheme he describes on his book "Computational Fluid Mechanics and Heat Transfer" on Chap.9 and I'm having trouble imposing BC. I don’t get how he imposes them. I get up to the point where, following the Beam and Warming scheme and after linearizing each flux vector with the flux vector U, h...
I have cumulative data for concentration versus time. I would like to fit the following model to the data: $$\frac{1}{\Gamma(n) \bar{t}}\int_{0}^{\frac{n t}{\bar{t}}}z^{n-1} e^{-z}dz$$ $n$ and $\bar{t}$ are the variables that I would like to fit. I tried to make a function with integral included but I wasn't successfu...
I am working on a primitive 2D DIY magnetic "FEA" solver for a class project. It's really just a big NumPy array where each element in the array can be one of the following: Air Current carrying wire with current into or out of the screen (Biot-Savart applied to every other element in the array) A permanent magnet (cu...
I am interested in an optimization problem of the form $$\min_{\boldsymbol z} \max_j \vert f_j(\boldsymbol z) \vert = \min_{\boldsymbol z} \Vert f_j(\boldsymbol z) \Vert_\infty. $$ Here, the optimization/decision variables are $\boldsymbol z \in \mathbb C^{N} $ and $f_i: \mathbb C^N \to \mathbb C$. The $f_j$ are essent...
Suppose I have an $m \times n$ matrix $A$ that is only accessible through matrix-vector products $Ax$. These are expensive, is there a way to approximate vector $x$ of $n$ column norms of $A$ by using less than $n$ calls to the matrix-vector product? $$ \begin{aligned}a_{1}=\left[ A\right] \begin{pmatrix} 1 \\ 0 \\ 0 \...
I am wondering what are the standards for convergence of Lyapunov exponents (and Kaplan-Yorke dimension)? For example, I have a MATLAB code to calculate Lyapunov exponents for the classic Lorenz attractor using QR decomposition: clear all; close all; % parameters par = [10; 28; 8/3]; % initial conditions x0 = [1; 1; ...
Preliminary definitions: I have a code that uses TEBD (https://en.wikipedia.org/wiki/Time-evolving_block_decimation) to perform time evolution of a given Matrix Product State (MPS), lets call it $|\Psi\rangle$. I am starting from a product state (Neél state) $|\uparrow,\downarrow,\uparrow,..,\downarrow\rangle$ for a ch...
Moore-Penrose inverse for an arbitrary matrix $X\in \mathbb{R}^{n \times p}$ is defined by a matrix $X^\dagger$ satisfying all of the Moore-Penrose conditions, namely \begin{align} (1) \;\;\;& XX^\dagger X=X \\ (2) \;\;\;& X^\dagger X X^\dagger = X^\dagger \\ (3) \;\;\;& XX^\dagger = (XX^\dagger)^T \\ (4) \;\;\;& X^\da...
The 1D diffusion equation with a chemical source term has the following form: $$\frac{\partial Y}{\partial t} = D \frac{\partial^2 Y}{\partial x^2} - k Y,$$ where $Y$ is the molar concentration of the diffusing species (mol/m³), $D$ is the diffusion coefficient (m²/s), and $k$ is the reaction rate coefficient (1/s). Th...
I have a 3D grid in real space of grid spacing $L$ and say 21 grid points in each direction, containing e.g. a charge distribution. This is stored as a numpy array of shape (21, 21, 21). The grid points themselves are of course vectors and so are stored as a numpy array of shape (3, 21, 21, 21). I also have a set of pl...
I want to develop a finite element method to solve for $u(x,t)$ the PDE: $$u_t+c u_x= \frac{-c}{x}u$$ where $c$ is a constant. so I am trying the following ( as Rothe's method? ) : Letting $k= t_n- t_{n-1}$ ( we begin by time discretization? ) we can write $$\frac{u_i^n-u_i^{n-1}}{k}+ c\left(\frac{u_i^n-u_{i-1}^{n}}{...
I was working on a problem recently (calculating all flows in a network given input and output flows, basically what Hardy-Cross tries to achieve) which can be formulated as a well-determined system of $N$ equations (with $N$ variables), of which $M$ equations are linear and $K$ are non-linear (so $M + K = N$, and gene...
I am looking for possible numerical methods to solve the PDE $$u_t+c u_x= \frac{-c}{x}u$$ I am particularly interested in a Finite elements method, although I am also curious if you can expose some other methods.
Suppose we define $A^{*}$ of positive definite $A=X'X$ using following two steps: let $B=A^{-1}$ scale columns of $B$ to obtain a matrix with $1$'s on the diagonal For the case of singular $A$, we could use a tiny amount of Tikhonov regularization: $A^*=\lim_{\epsilon\to 0}(A+\epsilon I)^*$ Is there a name of this op...
I would like to do a 2D projection from a 3D geometry saved in a stl file and know the distance between the two projected planes. In order to explain better the concept I will start with an almost ideal model or simple example: Let's say I have a minimal cube model such as the vertex are comprissed between x=-+1, y=-+...
Suppose $X$ is a dense $m\times n$ data matrix and we seek to find $w$ by approximately iterating least-squares filter equation: $$w = w - \mu (X'X)^{-1}X'(Xw-b)$$ What are known approaches for $10^9<m<\infty$ and $n\approx 10^6$? This setting comes up in Machine Learning and people tend to invent their own techniques...
Consider the problem $$\partial_t u-\Delta u = f\\ u(\Sigma_1)=f_D\\ \partial_\nu u (\Sigma_2)=f_N\\u(0)=u_0$$ where the sides of the space-time cylinder $\Sigma_i$ are disjoint (one of them could be empty, so as to recover a non-mixed problem). Do you know of any reference where a priori estimates using finite element...
I am trying to compute the integral of a 2D hemisphere dataset $f_r \, (\theta, \phi)$ where $\theta \in [0, \pi / 2[$ and $\phi \in [0, 2\pi]$. I am making the measurements myself, so I can choose the number of values and their coordinates. My first idea was to use the different points to triangulate my definition set...
I tried many formulas to find the components of the second Piola Kirchhoff. I need help to derive equations 27-29 on reference 1. [![enter image description here][1]][1] we have $$ \mathbf{C}=C_{11} \mathbf{T} \otimes \mathbf{T}+C_{12}(\mathbf{T} \otimes \mathbf{N}+\mathbf{N} \otimes \mathbf{T})+C_{22} \mathbf{N} \oti...
I want to solve electrostatic problem for potential. Charge density and medium permittivity are known, so is the potential of a grounded surface. I know how I can implement that. But I would like to add an ideal conductor (of unknown potential) to the system. How can I introduce an equipotential surface/volume? I g...
I want to mathematically describe a vector containing a series of time points. The time points must lie on an equidistant time grid of 15 minutes of a day. Thus, elements of the vector can contain values that occur at times $[t_1 = $ 00:00$, t_2 = $ 00:15$, ..., t_n = $23:45$]$. Example: vector $\pmb{t} = [$00:00, 01:1...
I've been working on a code to solve the Tolman-Oppenheimer-Volkoff (TOV) equations for a while and recently I've got it right but only for one specific equation of state, the bag model, which is not what I need since it should run for any hadronic equation of state. The code has given only wrong results for any EoS ot...