instruction
stringlengths
43
28.1k
In some scientific papers I see that authors provide what type of simulation tool and what type of computer was used for computation. For example: The computations were performed using MATLAB in double precision on a VAX 11/780 computer, the unit roundoff $u=2^{-56}\approx1.39\times10^{-17}$. From my understanding Ma...
In the finite element method we need to know a base for the fem spaces. For example, a base for the space $P_1(\hat{K})=<\{1-x-y,x,y,z\}>$ is a typical base for the polynomials of degree less than or equal to 1 on a tetrahedron with vertex (0,0,0), (1,0,0), (0,1,0) and (0,0,1). But, which is the base for $P_2(\hat{K})$...
Before I get to the heat equation I'd like to talk about the advection equation. Descritize that with FD in time and BD in space: \begin{equation} \dfrac{u^{n+1}_i - u^{n}_i}{\Delta t} + v \dfrac{u^{n}_{i} - u^{n}_{i-1}}{\Delta x}= 0 \end{equation} there are higher order terms which were cancelled out so let's bring th...
I am familiar with Cholesky decomposition and LU factorization for solving systems of linear equations. I have a problem where I have large sparse matrices (say, 1000x1000 or larger) where only one or two rows/columns (last couple rows/columns) break symmetry. I understand that Cholesky is nearly twice as efficient as...
is anyone here aware of whether there exist bounds on the optimal bandwidths of 2D/3D FEM stiffness matrices? Edit: more specifically, I would like to have bounds on the minimum bandwidth after optimally reordering the matrix. (This definition of bandwidth is the usual one in graph theory.)
When you're multiplying sparse matrices against other sparse matrices or dense matrices, what is the conventional approach for each? How are the sparse matrices stored? What does matrix multiplication work? My understanding is there are several ways it can be stored: (1) Store the non-zero elements in a hash table wher...
I recently had a software engineering interview and was asked a series of questions that was a bit outside of knowledge realm, and I feel like there's some scientific computing principles here (I took some scicomp courses many years ago, and I got some scicomp vibes when these questions were asked). I am wondering if a...
This question is a follow-up of this previous one. In "Error Control for Discontinuous Galerkin Methods for First Order Hyperbolic Problems" by Georgoulis et al., an error estimator is provided in equation (4.7). It contains the term $$||f -b \cdot \nabla \hat u - cu_h - \Pi(f-b \cdot \nabla \hat u-c u_h) ||_T$$ where ...
I am trying to numerically solve equation (6) of Lakhina 2021 in Python. The equation is $$\frac{1}{2}\left(\frac{d \phi}{d\xi}\right)^2 + S(\phi, M) = 0\, .$$ The Sagdeev potential expression is given by (7). What I want is to reproduce the potential profiles in Fig. 3 of Lakhina 2021. The boundary conditions given ...
The goal is to find vectors $x_u$ and $y_i$, both of the same length $f=64$, and to do this the following loss function is minimized: $$\sum_{u, i} (1 + \alpha \cdot r_{ui})(p_{ui} - x_{u}^{T}y_i)^2$$ The vectors obtained are user-factors and item-factors, used for the purpose of rating calculation in a Recommender Sys...
I am using COMSOL to solve a mathematical model involving thermoelectric hydrodynamic (TEMHD) flow. I am running a very large parameter sweep and using the solutions obtained to make some plots. However, I get a rather strange phenomenon appearing from time to time, in which the solution appears to exhibit strange osci...
I am an amature in python, I wrote a simple code in jupyter. But it is giving an error. I want to plot a function: import numpy as np import math as m #from scipy import random import matplotlib.pyplot as plt y1=np.zeros(10) y2=np.zeros(360) x=np.array(range(10)) print("a") x=np.linspace(0,100,1) d=1...
As we all know, the Additive Schwarz approach can be used as either solver or preconditioner, however, my question is, what is the difference between the two? In other words, how to use AS as solver, how to use AS as preconditioner? I found the below equations which give specific definitions of both, but I do not under...
Context Let's say I am trying to model the spread of mold in a petri dish, using a stochastic cellular automata approach. The petri dish can be thought of as a grid of 1mm x 1mm squares, each called a Cell. Each square has a value for the kind of food that is present there, and the probability of mold spreading into ...
I tried to implement the 2d advection problem with a velocity field, that is not constant in space. My problem is, that the "mass" of my shifted density gets "eroded" or just disappears, i.e. the norm $\|u_t\|$ goes to zero as time progresses. At least I want to minimize its decay somehow. The initial condition has no...
I am trying to reproduce the results from the hp-VPINN paper (https://arxiv.org/pdf/2003.05385.pdf) on tensorflow (v1) for Poisson's equation, particularly the two-dimensional Poisson equation. In one dimension the variational loss is given by $$ L^p = \sum_{e=1}^{N_{el}}\frac{1}{K^{(e)}}\sum_{k=1}^{K^{(e)}}\left|\...
I am trying to estimate parameters, 4 of them, by fitting a system of 3 ordinary differential equations. I am using a model published that was using 3 parameters and gave a good fit to the data, and I am trying to add a parameter to this (without changing the system of ODE, there is just a rate that is used twice, and ...
I would like to calculate the number of floating point operations (Flops) my code is performing in my machine. To do so, I would like to be sure I am counting the operations in the inner-most loop correctly. My understanding is that the relevant number, which are the operations inside the vectorized loop, total $25 N^2...
I have an optimization problem, which is to maximize the following integral over the unit sphere: $$ \max_B \int d\Omega \mathbf{f}^{\dagger}(\theta,\phi) (B^{\dagger} + B) \mathbf{f}(\theta,\phi) $$ subject to: $$ B = Q L^{-1} $$ where $Q$ is an orthogonal matrix, and $L$ is a given lower triangular matrix. The vector...
I'm studying from Guermond lecture notes available at https://www.math.tamu.edu/~guermond/M661_FALL_2019/chap12.pdf (see Lemma 12.8( Discrete trace inequality).) Consider the simple case $p=r$, i.e. we wanna prove that $$||v||_{L^p(F)} \leq C h_K^{-1/p}||v||_{L^p(K)}$$ The proof is really short, as can be seen in the l...
Let $M_n(\mathbb{R})$ denote the set of $n\times n$ matrices with real entries. I have an $n\times n$ matrix $X\in M_n(\mathbb{R})$, and I would like to implement the linear operator $[X, \cdot] : M_n(\mathbb{R})\rightarrow M_n(\mathbb{R})$ as an $n^2 \times n^2$ matrix, where this operator is defined in the following ...
I am trying to compute the area of an 8-node rectangular serendipity finite element from the equation $$ \sum_{i= 1}^8 det \, J(\xi,\eta) \cdot W_i $$ based on Gaussian quadrature, where $$ J(\xi,\eta) = \begin{vmatrix} \frac{\partial x}{\partial \xi} & \frac{\partial y}{\partial \eta} \\ \frac{\partial x}{\partial \e...
I am having trouble implementing a model from a publication. Huang, K-L.; Holsen, T.M.; Selman, J.R. Ind. Eng. Chem. Res. 2003, 42, 15, 3620–3625 scihub link: https://sci-hub.se/10.1021/ie030109q I want to model the diffusion of bisulfate through a nafion membrane using my own cell parameters. The system is two 10 L ta...
I have a system of PDEs describing atmospheric chemistry and transport. I use finite-differences to make my system of PDEs into a system of ~10,000 ODEs. I then integrate the ODEs forward in time with the CVODE BDF method (from Sundials). For my current discretization of my PDEs, the jacobian is approximately banded (b...
I have a solution in search of a problem that some of you could perhaps help me with. Let $L$ be a list of elements. Each element has two inherent properties/attributes ($a$, $b$) that can each be expressed as real numbers. The values of the two attributes of each element are completely uncorrelated. The goal is to re-...
In any asymmetric encryption specifications, there is a step where we need to calculate data ^ public_key mod e to get encrypted_data, and, also, to decrypt using encrypted_data ^ private_key mod e. it's recommended to have keys to be around 2048 bits in length, and considering that we want to encrypt something small,...
I am trying to implement Large eddy simulation for solving air flow simulation with large Reynolds number using Smagorinsky sub-grid stress model. I read that the filter size should be calculated based on the grid size: $\Delta=(\Delta_x\Delta_y\Delta_z)^{1/3} $ Could you please let me know that shall I calculate this ...
I was solving the time independent Schrödinger equation using the shooting method for harmonic oscillator potential. This is the code that I wrote for that with the results (code is written in julia): m, omega, hbar, del_x = 1.0, 1.0, 1.0, 1e-3 function get_eigenfunction(xgrid, V_x, E_n, del_x, m=1; hbar=1, s=1e5) ...
I am studying the numerical resolution of 2d advection-diffusion problems with finite element methods. $$\frac{\partial u}{\partial t} + \beta\cdot\nabla u = \nabla\cdot(\nabla u) \, .$$ It is said in this article on the COMSOL blog that it has been mathematically proven that the condition on the cell Péclet number $$\...
I have learned about the finite element method (FEM) as a method for solving boundary problems given by a PDE. The way I learned it is to approximate the solution by a linear combination of test functions. (I think it is called "Method of mean weighted residuals".) Now when looking for FEM online I see it is used in st...
When solving a PDE numerically by domain decomposition methods, what is the "optimal way" to split the domain? Are there any results stating that a particular partition of the domain yields "better" convergence than other partitions? For concreteness, let us consider the classical Poisson equation $-\Delta u = f(x)$ wi...
Suppose we have a countably infinite $A$ and $F_1,F_2,\cdot\cdot\cdot$ are an infinite sequence of finite sets (denoted $\left\{F_n\right\}_{n=1}^{\infty}$) such that $\bigcup\limits_{n=1}^{\infty}F_n=A$, $F_1\subset F_2\subset \cdot\cdot\cdot$ and $F_t$ is a structure of $A$ where $t$ is between one and infinity. Cor...
Motivation Suppose we have a countably infinite $A$ with order and group structures and suppose $F_1,F_2,\cdot\cdot\cdot$ are an infinite sequence of finite sets (denoted $\left\{F_n\right\}_{n=1}^{\infty}$) such that $\bigcup\limits_{n=1}^{\infty}F_n=A$, and $F_1\subset F_2\subset \cdot\cdot\cdot$ We state that $F_t$ ...
Suppose I want to minimize below objective function $\sum | g(x_i) \cdot I_{g(x_i)<0} |^2$ i.e, the latter penalty terms like $ |g(x_i)|^2 $ are only computed when $g(x_i)<0$. $|g(x_i)|^2$ are convex functions. Is there a way to formulate it? I know sum of convex functions are convex, but if I have added this strange ...
First post. Hi everyone. I’m trying to develop an algorithm to later code that schedules appointments in a way such that the number of hours occupied by the appointments in a given day is maximized. Appointments can be an hour or half hour long and all appointments should have a 15 minute buffer between them. I’m gett...
I am trying to simulate the spread of mold in a petri dish using a cellular automata based approach. Thanks to the answer in my other question Stochastic cellular automata - algorithm limited by 1 cell per timestep, I am attempting a different approach using a priority queue. Context The petri dish can be thought of a...
I am implementing a finite difference method for a PDE with a Neumann boundary condition. I will simplify my question to a single dimension. Suppose I have a PDE $$\frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2} + \text{ (other terms)}$$ on the interval $[a, b]$. I impose on the PDE the Neumann bounda...
I am considering implementing the accelerated inverse power (AIP) method with Rayleigh quotient to speed up eigendecomposition of a real square symmetric matrix. Halton (1996) gives an example algorithm which is listed below Step 1. $\quad \mathbf{M}= \mathbf{H} - \mu \mathbf{I} $ Step 2. $\quad \text{Solve } \mathbf...
I'm curious about the general case, but for ease of explaining lets just take the case of a $P^2(\Omega)$ approximation. For simplicity, let's also just consider the reference element $(0,0), (0,1), (1,0)$. To satisfy the global continuity condition, each edge must have three points on it. Thus to have a conforming FE ...
I am running a sensitivity study on the model $y(t) = x(t - \tau)$ where $y(t)$ and $x(t)$ are 2 time signals and $\tau$ a time lag. Basically I want to study the sensitivity of $y$ to a change in $x$. Note that the model is very simple just for the sake of illustrating my question. What I think about is the derivative...
I am interested in the iterative solution (preferably Krylov-type solvers) of a problem $\boldsymbol{A}x=b$, with $x,b\in\mathbb{C}^{n\times1}$ and $\boldsymbol{A}\in\mathbb{C}^{n\times n}$. $\boldsymbol{A}$ is symmetric, invertible, and its real and imaginary parts are indefinite. This comes from solving a harmonic,...
I am solving numerically the ODE $\ddot x(t)=-c\dot x(t) -\sin(x(t))+F\cdot \cos(\omega t), \;\dot x(0)=x(0)=0$ for $t\in [0,20\pi]$ on an $N=2000$ dimensional grid. I am working on Python, and I replaced the time derivatives by the finite difference operators \begin{align} \dot x(t)&=\frac{x(t+dt)-x(t)}{dt}, & \ddot ...
Given $A\in\mathbb{C}^{n\times n}$, I want to use LMI or SDP to find feasibility of $x>0$ in the following inequality: $$(I-A^*A)+x(\frac{A+A^*}{2})\prec0,$$ where $D\prec0$ means that $D$ is negative definite matrix. Let $A_1=I-A^*A$ and $A_2=\frac{A+A^*}{2}$, then we get an LMI: $A_1+xA_2\prec0.$ Example 1: Let $A=\...
Context I have an array of objects (or a list of dictionaries), sorted in order based on a property of each object, say, time. In JSON, it would look something like this: [ {'details': 'some details', 'time': 69}, {'details': 'some details', 'time': 79}, {'details': 'some details', 'time': 107}, {'details': 's...
I am trying to better understand the FAS multigrid algorithm for Euler equation in FV discretization. The usage of the modified residual (the residual with forcing) inside the different cases: Unsteady computations : referring to the Jameson's paper I understand that it is used in the dual time step computation that a...
I am writing a proof-of-concept implementation of Newton's method for minimizing the negative log-likelihood term in a logistic regression model. I'm comparing the performance of a native python implementation and a fortran implementation where I link via f2py. Surprisingly, the Fortran version is slower than the Pytho...
I wish to solve a linear system $A x =b$ in which $A$ is dense but not too large, say no larger than $10\times10$. However, I am not interested in the full solution vector $x = [x_0, x_1, \dots]$, rather I only care about accurately determining $x_0$. I know that Cramer's rule can compute $x_0$ directly, but this requi...
Suppose I have a square matrix $\mathbf{A} \in \mathbb{R}^{n\times n}$ and a vector $\mathbf{b}\in\mathbb{R}^n$. In my application I need to accomplish two things. I need to find the solution of the linear system $\mathbf{A}\mathbf{x}=\mathbf{b}$. I need to compute the log-determinant of $\mathbf{A}$. Naively, I coul...
Question is mostly related to literature or suggestions. Given a semi infinite domain: $x=[0; +\infty);y=[0; +\infty)$. Willing to transform it to computational domain of: $[0,1]\times[0,1]$. I did find the $(-\infty, +\infty)$ to $[-1,1]$ transformations, though looking for mapping operators from semi infinite to fini...
I'm currently solving incompressible Navier-Stokes system of equations with periodic flow and high viscosity. Is there any outlet boundary types that avoids the reflection of flow from the outlet back into the computational domain? (Neumann is not sufficient). Update: Left: $u = C sin (\alpha y + \beta t) + u_0$ Top: ...
I am trying to calculate the best set of cuts for some wood cutting to reduce the waste. So: Given a set of numbers, the goal is to find the best matches below a limit (size of wood beam). Example of the set of numbers: const input = [ 4, 13.5, 17.5, 18.5, 20, 26, 43.5, 44.5, 45, 46, 54, 54.5, 55, 60, 61, 62, 70.5...
I'm trying to calculate the 2 perpendicular versors (unit vectors), $\vec{n_1}$ and $\vec{n_2}$, that define a plane whose normal versor (unit vector) is $\vec{n_n}$. For example, assuming that the versor of the normal is $\vec{n_n} = <1, 0, 0>$, the two perpendicular versors that define the plane whose normal i...
I've been working on modelling the NS equations in order to simulate shock waves. The equations are set up on the form: \begin{equation} \frac{\partial U}{\partial t} + \frac{\partial F(U)}{\partial x} = S(U) \end{equation} where \begin{equation} U = \begin{bmatrix}\rho\\ \rho v\\E\end{bmatrix}, F(U) = \begin{bmatrix}...
I'm working on a project for which I have inherited some FEM code. This implemented FEM calculates, given some force field, displacements on a discretised square using square elements and assumes a homogeneous isotropic and linear material. I want to do away with the assumption homogeneity. I would like to assume a spa...
Overview and Prior Research I am looking for a way store a (in principle arbitrarily) large "3D-table" for interpolation/ lookup in combination with python. I have considered CSV files, but, as far as I know, I will run into file size issues starting at 2GB Pytables: as I understood it, it is close to a proper databas...
I'm trying to fit a simple logistic growth model to dummy data using Python's Scipy package. The code is shown below, along with the output that I get. The correct output is shown below it. I'm not quite sure what's going wrong here. import scipy.optimize as optim from scipy.integrate import odeint import numpy as np i...
I work in the medical field. Sometime we receives MR images that have been acquired along the same direction, however when looking up the direction cosine matrix, the values are slightly different (up to a certain precision). The scanner only stores the first 6 values of the matrix, the last 3 values are computed using...
Let $\mathbf{P}$ be a permutation matrix (i.e. a matrix that is all zeros except for a single one in each row). Is there an efficient algorithm for computing the determinant of such a matrix?
I have the two following algorithms for GMRES(m) and left preconditioned GMRES. GMRES(m) Left preconditioning I would like to know if anyone could explain why steps 10 through 12 are not used in the left preconditioned GMRES. Are they lost, or is it implicit that these need to happen? If not, am I correct to assume t...
I hope this is the right place for my question. I am a university student who designed a pea-pouring machine.Now I‘m really interested in simulating the behavior of those peas. Basically, they are inside a tank that is closed by a slider. When the slider opens up, the peas fall out due to gravity. I have a license for...
import numpy as np import matplotlib.pyplot as plt Fs = 200 # sampling rate Ts = 1.0/Fs # sampling interval t = np.arange(0, 1, Ts) # time vector f_f = np.arange(30, 80, 0.001) a = np.arange(0, len(f_f), 1) y2 = 0.0 for i in range(len(f_f)): y2 = y2 + n...
Is there a formula which enables the computation the tensor of curvature knowing the following at each vertex and cell of a triangulated mesh: Normal vector Two arbitrary vectors in the tangent space Mean and Gauss curvature I am trying to script it using vtk/python. The final goal is to compute the principal directi...
I’m trying to to obtain the values of the tortoise coordinates (Eddington-Finkelstein Coordinates) integrating the expression: $\frac{dr^*}{dr} = (1 - rS/r)^{-1}$ using the GNU Scientific Library (GSL). I know that the analytical expression is $r* = r + rs·ln(r/rS - 1)$ so I can compare both results: analytical and int...
Is there a library of some programming language (MatLab, C, Python, R, etc.) that includes a function for efficient calculation of convex-convex quadratic fractional programming problems of the form $$ \begin{align*} \sup& &\frac{x^TQx}{x^TPx}\\ \text{s.t.}& &A^Tx \leq b\\ &&x\geq 0 \end{align*} $$ where $Q\in\mathbb{R...
Considering page 10 of Jos Stam's GDC tutorial on stable fluids, the function project() first obtains the divergence of the velocity field: ¹ div[IX(i,j)] = -0.5*(u[IX(i+1,j)]-u[IX(i-1,j)]+ v[IX(i,j+1)]-v[IX(i,j-1)]) / N; p[IX(i,j)] = 0; then subtracts a curl-free part from the original velocity f...
One more question about Jos Stam's GDC tutorial on stable fluids: in the advection step on page 8, the timestep for each dimension is implemented as dt * N, where N is the height or width of the grid. This corresponds to a position update: $x_{prev} = x - \frac{\Delta t}{h} \cdot v_x$ where $h = 1/N$. But why is $h$ in...
I want to solve the thermal expansion of solid by using FEM approach. When I developed the model based on the the principle the minimum potential energy, the solutions for thermal expansion are not correct, although the results of static bending problems under external mechanical loads shows good results. The basic equ...
I am trying to understand how cell to cell communication is studied using a discrete modelling framework. Could someone please suggest suitable references or libraries which already have implementations of this? I have come across continuum-based approaches which treat tissue mass as a homogeneous medium but I am looki...
I'm trying to use solve_ivp from scipy in Python to solve an IVP. I specified the tspan argument of solve_ivp to be (0,10), as shown below. However, for some reason, the solutions I get always stop around t=2.5. from scipy.integrate import solve_ivp import numpy as np import matplotlib.pyplot as plt import scipy.optimi...
I would like to determine the stability of a system of periodic delay differential equations (a seasonal host-parasite model). I've tried to implement the method described in Lemma 2.5 in this paper: Liang, X., Zhang, L. & Zhao, XQ. Basic Reproduction Ratios for Periodic Abstract Functional Differential Equations (wit...
I'm looking to compute the value of the following integral, for small values of $|a|$. $$u_n(a,b)=\frac{1}{2}\int_{-1}^1 x^ne^{ax^2+bx}\mathrm{d}x$$ In this equation, $a,b \in \mathbb{R}$ and $n \in \mathbb{N}$. It's easy to show that: $u_0(0, 0) = 1$ $\frac{\partial}{\partial b} u_n = u_{n+1}$ $\frac{\partial^2}{\par...
In this post, they mentioned that C++ and FORTRAN are low–level programming languages. However, In other references, they consderd these language as a high-level programming languages. Which one is correct?
I have been doing a lot of reading on the development of finite element methods and their analysis using, e.g., functional analysis. I am clear on the formulation of the weak form of a PDE and properties defined on the bilinear form. However, for my research I am pursuing the solution of nonlinear PDEs using Discontinu...
Strong Scaling and Amdahl's Law Strong scaling is a measure of how, for a fixed overall problem size, the time to solution decreases as more processors are added to a system. An application that exhibits linear strong scaling has a speedup equal to the number of processors used. Strong scaling is usually equated with A...
I am trying to figure out the exact formula for a three convoluted exponential gaussian probability function from the software Igor Pro, from my research. Unfortunately all I the closest equation from the software is the coding for it, which is below: w[0]+(w[3]/w[4])*ExpGauss(t-w[2],w[4],w[1])+(w[5]/w[6])*ExpGauss(t-w...
I want to compute the eigenvalues and eigenstates of a quantum well with different effective masses of electron in the barrier and in the quantum well. As can be seen [1]: https://github.com/mholtrop/QMPython/blob/master/Finite%20Well%20Bound%20States.ipynb [1], the mass of the electron is constant, therefore the Hamil...
Suppose you have a trigonometric polynomial of the form \begin{equation*} x(t) = \sum_{k = 0}^N a_k \cos(2 \pi k f_0 t). \end{equation*} Using Clenshaw algorithm, one can evaluate this polynomial in $O(N)$, just as an ordinary polynomial via Horner's rule. Now: Is it possible to evaluate $x(t)$ in less than $O(N)$ in ...
I'm trying to write a program that can simulate a rainbow. So far I've got figured out how to determine the change in the refractive index depending on the wavelength, the angular deviation of the scattered ray depending on the number of reflexions inside the water droplet, and so on. The only thing I'm still uncertain...
If I have 3 lists: points, faces and cells that represents a mesh, where: points is a list of x,y,z coordinates, for example [-0.05, -0.05, 0. ], [-0.05, 0.05, 0. ], [ 0.05, -0.05, 0. ], ... faces is a list of list of points, where each row is a list of point indices that represents a face [ 1, 4, 8, ...
I would like to implement a givenRotation algorithm without having matrix-matrix multiplication. Matrix-vector is fine or just for looping. I am to decompose a rectangular (m+1)xm Hessenberg matrix. I found an algorithm here but it appears to be for square matrices. With matrix-matrix multiplication I have made the fol...
Wave equation. Mixed BC. Applied Neuman boundary condition ($\frac{\partial u}{\partial x}\big|_N=0$) to the RHS of the domain You may observe the sharp edge in the middle of the string in the image attached. I do understand it bouncing at Dirichlet BC, but for some reason, it bounces off the Neuman Boundary on the rig...
I am looking for a manufactured (or analytical if it exists) solution to the 2d boundary-value problem $$\frac{\partial u}{\partial t} = \mathbf{a} \cdot \nabla u + D \nabla^2 u \quad \quad \mbox{in } \Omega $$ $$ u \ \mathbf{a} \cdot \mathbf{\hat{n}} + D \ \nabla u \cdot \mathbf{\hat{n}} = 0 \quad \quad \mbox{on } \p...
In Galerkin methods, we seldom can measure the accuracy of an approximation by tracking the value of the residual. For example, take the wave equation: $ u_{tt} = u_{xx}$, $(x,t) \in (0,L) \times (0,T)$ with approximation $u(x,t) \approx u_N(x,t) = \sum_{i=1}^N\phi_i(x)q_i(t)$ The residual for this approximation is def...
I'm continuing the research of a former Ph.D. student in my group requiring the solution of a system of ODEs. On a technical note, they wrote: The system of Boltzmann equations behaves numerically stiff. This means that it is advisable to use an implicit method for its numerical solution to achieve acceptable step siz...
I'm trying to understand the notion of relative error for vectors in $\mathbb{R}^n$, but it's not "clicking" somehow. $$\operatorname{\varepsilon-rel}(x_\text{approx}, x) = \frac{||x_\text{approx} - x ||}{||x||}$$ The intuition I have for the relative error between two positive real numbers is that it's the approximati...
I'm trying to solve $-u''=\cos(2 \pi x)$ with boundary conditions $u'(0)=u'(1)=0$ and the constraint $\int_{0}^1 u = 0$ I have to use linear finite elements, so let's assume that I have $M$ degrees of freedom. Since the contributions from the Neumann data on the r.h.s. vanish, the weak formulation is to find a $u_h \i...
In order to undergird a theoretical model concerning many body physics, I want to have exponentially large eigenvalue spectra from the random matrix GOE ensemble. its properties are mainly (i) a semicircle distribution, (ii) a level repulsion between the eigenvalues. These are met in some physical systems, so it is nat...
I want to build an application for Material Point Method (and probably other meshfree methods too) in Julia and I am looking for library for direct and iterative solvers that can help me with it. One of the most common library used for such applications is PETSc and I do know that it has bindings to Julia. But I am als...
I have an ODE for an unknown $x(t):[0,\infty)\to\mathbb R^n$ of the following form: $$ x_i'(t)=a_i^\top x(t) + x(t)^\top Q_i x(t), $$ for $i\in\{1,\ldots,n\}$. Here, the vectors $a_i\in\mathbb R^n$ form the columns of an $n\times n$ negative semidefinite matrix $A\in\mathbb R^{n\times n}$, and $Q_i\succeq0$ for all $i...
I'm calculating the entropy production of a shockwave by utilizing the equations: \begin{equation} \sigma = J'_q\frac{\partial}{\partial x}\left(\frac{1}{T}\right) +\frac{1}{T}\frac{4\eta}{3}\left(\frac{\partial v}{\partial x}\right)^2 \end{equation} and \begin{equation} \sigma = \frac{\partial \rho_s}{\partial t} +\fr...
I would like to generate the most unique string (20 long, primer) of a defined length that does not occur in a much larger string (6.4 billion long, human genome). Of course, there could be many unique strings, but I want to avoid string with any mismatches/deletions/insertions that could occur in the larger stringer...
I am reading some optimization methods and I am facing some issues with two terms "asymptotic and non-asymptotic convergence". What is the difference between them?
What is the best method to do a Monte Carlo Integration of a multidimensional integral where the integration limits depend upon other variables? I am interested in getting a numerical value of a 5 dimensional integral, the limits look like this: $$\int_{0}^{a^2} dS_{12} \int\limits_{S_{12}}^{a^2} dS_{123} \int\limits_0...
In my computer vision course, we are working on extracting a 3D surface from a chain of 2D images taken under several conditions. This procedure is known as Photometric stereo. Prior to extracting the surface $f(x,y)$ numerically, we have to perform what's called a test of integrability : $$ \frac{\partial^{2}f}{\parti...
My question is specific to algorithms and models of computation. I would like to write code to evaluate the following expression quickly and accurately: $$\log \left( \sum_{i=1}^{\infty}{I_{\nu+i}(2\lambda)} \right)$$ Where $I_\nu(x)$ is the modified bessel function of the first kind. I have limited experience with num...
I have a staircase/step function $n(E)$. I know the points $\{E_i\}$ at which each "step" occurs and all steps are of constant height 1. I need to fit a line $a + bE$ to this function and find the least-squares deviation. In particular, I have to calculate the quantity $$ \Delta = \min_{a,b} \int_{E_i}^{E_f} [n(E) - a ...
I'm newbie here. I'm wondering if it's possible to generate $(X_i, Y_i, Z_i)$ from my own distribution function? I know that there is a way to make own class for 1D variable. But what about 3D case?
What is typically the best way to multi thread the assembly loop in a finite element code? Does anyone have experience with implementing this, that they can share? I can think of a couple of ways of doing it: Divide the mesh into different cell sets, where the elements in each set does not share dofs, such that the th...
I'm interested in how digital beamforming works and I can not find an answer for a lot of time. I googled, asked teammates, and couldn't get it. Let me describe my question. From my understanding, the beam means the area in the space where waves from a number of antenna elements are in superposition which means, in tur...
I am aiming to get a numerical value for a five-dimensional integral using Monte Carlo Integration. I am getting good results using the Mean Value Method, but I would like to try to use Importance Sampling to get even better results. My main source gives me an example of how to do this method using a one-dimensional in...