instruction
stringlengths
43
28.1k
I have a quadratic binary optimization problem of the form \begin{align} &\max x^TQx \cr &\text{subject to }x\in\mathcal{X}\subseteq\{0,1\}^n, \end{align} where $\mathcal{X}$ is the feasible area defined by linear constraints and binary requirement on the variables. I can assume that all entries in the matrix $Q$ are n...
I am learning C/C++ for Scientific Computing and I have a question regarding the usage of scientific libraries for basic operations. Suppose I have to write a small program in C for a bioinformatics project: for some operations I need to use matrices and very basic computations on them (LU for instance). I went through...
I'm pretty new to translating simulation to reality so please forgive the perhaps naive approach I'm taking here. If we have a (quasi-2D) experimental video of a certain concentration changing with time, and we wish to determine the diffusion coefficient by comparing the video with a simulation, one can use the discret...
I am using an FEM code written in Fortran which I did not design. For a particular problem, the program complains that the determinant of the Jacobian matrix is inferior to zero. I vaguely understand that the Jacobian matrix is related to the shape functions and that it must be inverted to map shape function coordinat...
My goal is to compute the k smallest eigenvalues of large symmetric sparse matrices. For this purpose I use python scipy's eigsh method in shift-invert mode which uses ARPACK. The matrices usually have around 900,000-1,000,000 rows. Now the computation time for these matrices on my system is normally around 30 minutes....
I have been trying to solve Time Independent Schrodinger's equation in one dimension using Numerov Method as discussed in this excellent lecture notes I found on net. The Numerov method can solve an equation of the following kind: $$\frac{{d^2}y}{dx^2}=-g(x) y(x) +s(x) $$ We can compare this with out Time Independent...
I am trying to make a code for 1D shallow water equation (nonlinear without source terms) using the MacCormack method for sinusoidal wave propagation. My issue is that the wave fluctuates and does not produce a smooth result. I think there might be an issue with my boundary conditions as I am giving boundary condition ...
Cross-posted from Math Stackexchange: https://math.stackexchange.com/questions/2421964/approximating-solutions-to-quadratic-recurrence I have a branching process problem that has been reduced to solving a system of recurrences defined for $0 \leq i \leq T$, for some large positive integer $T$ and fixed constants $d, \m...
I have a numerical optimization problem that I am trying to scale appropriately, in order to allow for the solver to achieve faster and more accurate results. I found a paper here that had a short section on nondimensionalization on page 44, that simply stated the following: In order to nondimensionalize a quantity, j...
I'm in the context of this publication: http://www.gilbertbernstein.com/resources/booleans2009.pdf I applied quantization to my point coordinates: All coordinates are integer lying in [0, 2 power 20]. The C++ type representing a coordinate is int64_t. A plane p is represented in integer homogeneous coordinates (a, b, c...
I want to solve \begin{align} \nabla^4\psi+\alpha\nabla^2\psi+\beta\psi=F(x,y);\quad \nabla \psi\cdot \hat{n}=\nabla^3\psi\cdot \hat{n}=0\quad \text{on boundaries} \end{align} with a 2d FEM scheme. With the biharmonic operator, linear test functions are ruled out. I can integrate the first term by parts twice, so that...
Let's say I have a matrix $\mathbf{A}\in\mathbb{R}^{n\times n}$, and its associated inverse, $\mathbf{A}^{-1}$. The elements of $\mathbf{A}$ are given in IEEE single precision, i.e. 23-bit mantissa, and I use the lapack routines $\texttt{sgetrf}$ and $\texttt{sgetri}$ to compute $\mathbf{A}^{-1}$ through a single-preci...
Let's say I am running a FDTD simulation of a wave-equation to determine a transfer function of an LTI system: \begin{equation} H(f) = \dfrac{Y(f)}{X(f)}\ \end{equation} where $Y(f)$ and $X(f)$ are Fourier transforms of signals measured at some point in the FDTD grid for a grid with an "obstacle" inserted and an empty ...
I am looking for an alternative and robust alternative to Gram-Schmidt orthogonalization, but with one constraint: I have a unit vector $\mathbf{v}_1 \in \mathbb{R}^d \,\text{s.t.} \,\|\mathbf{v}_1^T\mathbf{v}_1\|=1$ and I want to find a set of $d-1$ vectors $\{\mathbf{v}_2\cdots \mathbf{v}_{d}\} \perp \mathbf{v}$, ort...
A solution to the 1D consolidation problem is given by $$\frac{\partial}{\partial t} p = c_{v} \frac{\partial^{2}}{\partial y^{2}} p$$ where $p$ is the pore water pressure, $c_v$ is the consolidation coefficient, $t$ is the elapsed time and $y$ is the height of the column. Further background is provided by this docume...
I'm looking for an image filter that does the following operation: In my first image, I have two spheres. After applying the filter, I'd like to have them "glued together" which something that kind of resembles surface tension. Remarks: The image will be 2D/3D, with the signed distance to the surface of the spheres en...
I am given the data about nodes and elements of a tetrahedral mesh. What algorithm do I use to find the boundary faces of the mesh?
Has anybody ever managed to simulate even the simplest form of life by merely simulating the interactions of the molecules of the organisms body? What would be the theoretical minimum number of molecules to build such a numerical simulation?
Using NumPy and attempting to multiply matrices together sometimes doesn't work. For example import numpy as np x = np.matrix('1, 2; 3, 8; 2, 9') y = np.matrix('5, 4; 8, 2') print(np.multiply(x, y)) can return Traceback (most recent call last): File "vector-practice.py", line 6, in <module> print(np.multiply(...
I work in a field (elasticity reconstruction) that frequently uses standard Finite Element methods to solve the first order PDE, where we are given u and solve for mu and lambda: $$ (\mu(u_{i,j} + u_{j,i}))_{,j} + (\lambda~div~\mathbf{u})_{,i} = -\rho \omega^2\mathbf{u}_{i} $$ known as the Navier-Lame equation. Here we...
I was able to draw to the outer airtight boundary of hole. Now I would like to implement interior flood/fill algorithm. To get an internal seed, only one method comes to my mind which is testing neighbors of red cells for ray casting. However, I would like to know is there a faster method.
Suppose i have a bunch of 10 data points and i have to conclude whether the increase is $n^2,n^3,\cdots,2^n,3^n, e^n,\cdots$. For example i have the image:- Now the increase is either polynomial or exponential. First question is how to decide that? Case 1: increasing polynomially, i.e., $n^c$ Then how to find constant...
I'm wondering if this is a valid methodology to find the best regression equation for a given data set. User provides a rang of estimated value for some set of variables. Th algorithm uses the given range to randomly generate a large number of regression equations like the one bellow. Price = actualValue1* estimate...
I was wondering whether there is a smart and efficient way in Matlab to compute the kronecker product of several 1D arrays. What I mean is something like this A = [a1, a2]; B = [b1, b2]; C = [c1, c2]; K = f(A,B,C) = [a1*b1*c1, a1*b1*c2, a1*b2*c1, ... ] One possible way it is to use the kron(X,Y) function, but it has t...
I'm facing a non-linear programming problem which currently I'm solving with fmincon function of MATLAB. However, I'm not very happy with computation times and solution convergence since it only converges when setting the algorithm option to 'active-set' and computation times depends heavily on the initial condition. I...
The naive summation of a Chebyshev series \begin{align*} f(x) = \frac{c_0}{2} + \sum_{k=1}^{n-1} c_{k}T_{k}(x) \end{align*} which employs the three-term recurrence for evaluation of the Chebyshev polynomials is known to be numerically unstable near $x=\pm 1$. For this reason, Clenshaw presented an algorithm which avoid...
I have a mesh with irregular hexaedra and I need a fast way to interpolate values at points inside these cells. I know that trilinear interpolation does not work well for large skews. Barycentric coordinates work for tetrahedrons. Is there any equivalent method for hexaedra, which is really efficient, possibly parallel...
Some reference in adaptive techniques say that when the solution $u$ is smooth enough we can use p-refinement instead of h-refinement. And when we have for example singularity, we should use h-refinement. I can not understand it. why? When we use a higher order polynomial for approximation we can get smoother solutio...
I am assigned to compute eigenvalues and eigenvectors in MATLAB of a 2x2 matrix: $$ A = \left( \begin{matrix} 3 &0\\ 4 &5\\ \end{matrix} \right) $$ I know that the textbook's solution states that eigenvalue 3 corresponds to an eigenvector $(1 \; -2)$, and eig 5 corresponds to $(0 \; 1)$. This is what I do. Why am I not...
When calculating a type-II DCT with FFTW, you create an fftw_plan, via fftw_plan plan = fftw_plan_r2r_1d(size, in_ptr, out_ptr, FFTW_REDFT10, FFTW_ESTIMATE); As I understand it, the plan precomputes the twiddle factors so that the plan can be efficiently reused for multiple calls to fftw_execute_r2r(plan, in_ptr, ...
I see images of steel connections, concrete dams, and other complicated 3D objects in papers which finite element analysis has been performed on them. My questions are: How these objects are created in MATLAB? Should we give all the points ourselves? How can we create mesh for them to perform finite element analysis? ...
I am attempting to use an iterative solver to solve $p$ in $$ Jp = -r $$ where $J$ is an $m\times m$ matrix ($m$ is in the order of $10^5$ and never explicitly stored). $J$ is a dense matrix representing a Jacobian for a certain function, and, in general, is not symmetric. Unfortunately, this is an ill-posed problem an...
I'm trying to approximate an unknown, non-linear function $f: A \to \mathbb{R}$ (in my case: $A = B \times B$ where $B$ is an infinite but compact subset of $\mathbb{R}$). That is, evaluating $f$ is costly and I'm looking for an easy-to-evaluate function $g$ such that $f$ is close to $g$ on $A$. Given an error bound, h...
Is there something like a rule of thumb for an adequate time-step size when solving Maxwell's equation for the interaction of light with matter? I guess a single wave oscillation has to be resolved within at least ~10 steps, which would give a time-step below 1 fs for visible light? I really hope it's not that bad. Wha...
I have the following optimization problem: Given is a set of $n$ points $x_i, \ldots, x_n$ with $x_i \in \mathbb{C}, \|x_i\| < \infty$. Note that $n$ is usually not large, i.e. $n < 1000$. We want to find a point $c \in \mathbb{C}$ such that $\max_i \| x_i + c \|$ is minimized Currently, this problem is solved by means...
I am trying to solve a system of non-linear index-1 DAEs in which the derivatives of the state variables, $x(t)$ are corrupted by additive noise, $w(t)$ (whose covariance matrix is known). $\dot x(t) = f(x(t),t,u(t)) + w(t)$ Is there a known (open source) solver/library/package/toolbox in MATLAB/Python/Julia (with or w...
I have written an 2d N-body simulation in Python which allows collisions between the bodies. A body is modeled as a circle whose area is proportional to its mass. Each time the sim advances by one time-step, I identify which bodies have overlapping radii and I replace them by one particle (respecting conservation of mo...
In FEM, to discrete the weak form, elements are needed to build the FE approximation basis space. FE method involves integration of the weak form. Due to discretization, the solution is an approximation close to the exact solution. I have a doubt that if FEM discretization error is mainly the error when us integrating...
As described in this Wikipedia article, a discrete laplacian matrix can be made for a 3D regular grid using Kronecker products. I'd like to use the same methodology for $(n-1)\times n$ matrices of the form $$ \begin{bmatrix} -1 & 1 \\ & \ddots & \ddots \\ & & -1 & 1 \\ \end{bmatrix} $$ Given 3 of these matr...
I am modeling the structure of a crystal and need to find what the "lowest energy structure" is. There are three free parameters (let's say, $a$, $b$, and $c$) to change, and the search space, $E(a,b,c)$ is convex. What is the best way to set this up so I vary $a$, $b$, and $c$ to find the combination that yields the m...
I'm writing a small numerical library for 2x2, 3x3, and 4x4 matrices (real, unsymmetric). A lot of numerical analysis texts highly recommend against computing the roots of the characteristic polynomial and recommend using the double-shifted QR algorithm. However, the size of the matrices makes me question whether or no...
I'm trying to understand the passage through this equation can be written for easily solved with the fortran alghorithm in particular i don't understood the meaning of L_x and L_xx ... what (-1,0,1) stands for ? could somebody explain me ? thanks a lot ! the equation is reported here (explicit scheme is clear .. obviou...
I have the following set of equations: $$ x(t) = x_0 \psi, \qquad y(t) = \kappa \ln \psi - x_0 \psi +1,\qquad z(t) =-\kappa\ln \psi,$$ with $$ t- t_0 = \int ^\psi_{\psi_0} \frac{d\eta}{\eta(1+\kappa\ln \eta + x_0 \eta)}. $$ Here $t$ represents time. I would like to plot these equations in Python for the time range $t...
Consistent variation occurs in papers multiple times when reading . So what does it really mean from a maths view? I searched online and found an answer for it. Someone explained it as ‘Solution is consistent if when you plug it to the strong form, the solution satisfies it. For example, a penalty method is not consist...
I have to repeatedly calculate a function which contains a sum of a large number (~100) of exponential terms: $f(x) = \sum_{r=1}^{100} C_r e^{b_r \cdot x}$ There is no relation between the $C_r$ and $b_r$ (i.e. something like $C_{r+1}$ = 2 $C_r$). Does anyone know a fast way to determine a numerical approximation for ...
I have taken a course on undergrad scientific computing which discussed nonlinear algebraic equations about half-way in, and PDEs at the very end, but never discussed nonlinear PDEs. However in my research work, we have to use a solver that deals with a nonlinear coupled system of time-independent PDEs and I'm trying t...
I am implementing a Kalman filter (for a linear ODE system for now). My model represents a physical device that has 6 "parameters", i.e. those values of the device do not evolve over time (within a time-domain simulation environment for now). I have 100 such "slightly differing devices", i.e. whose parameter values di...
I've got a data set of points $M_O .. M_N$ for time points $t_0 .. t_N$, where $N$ is approximately 10-20, and the spacing of time is not uniform (i.e., $t_{i+1}-t_i$ is not constant for all i). It is believed that this data should be able to be modeled by a differential equation of the form $\frac{dM}{dt} = -k (M - M_...
I posted a similar question yesterday but I deleted it since I think that I had to reformulate it after some insights. I want to calculate $$ \exp(-i\Delta t\,\mathcal{H}) = V\,\mathrm{diag}(\{\exp(-i\Delta t\,\epsilon_k\})\,V^{-1} ~~~~~~~~~~~~~(*) $$ where $\mathcal{H}$ is a hermitian matrix (the hamilton matrix) and...
I have a set $N$ points in $d$-dimensional space, $\mathbf{x}_i \in \mathbb{R}^d ~~ \forall i=\{1,2,...,N\}$. How to choose $n$ points from the set such that it maximises $$ f = |\mathbf{S}|^{-n/2} \exp\left[-\frac{1}{2} \mathrm{tr}\left(\mathbf{S}\boldsymbol{\Sigma}^{-1}\right) - \frac{n}{2} (\boldsymbol{\mu} - \mathb...
In my problem, I have a lattice with a stochastic cellular automaton. In order to simplify a bit, let's say it is 1D. In my system, each node can be type A, B or C. A way to represent the system and operate fast over it is using an integer 64-bit variable, working bitwise. Let me give an example of implementation for a...
I am trying to simulate an ODE, like $ \dot{x} = \xi(x) $ that should have a stationary distribution (a la Stat Mech). Assuming that my ODE algorithm generates time samples of my system state $ x $ like $ x^{(0)}, ..., x^{(t)}, x^{(t+1)}, ..., x^{(n)} $, I would like to verify that the samples generated from the ODE nu...
I'm working through the book Approximate Dynamic Porgramming by Warren B. Powell. Currently I'm solving exercise 3.3 and 3.5. Let me state the exercise (I'm summarizing the text from the boook) We have the following Markov Decision Problem. We have a two-stage Markov chain with one-step transition matrix $$ P= \beg...
Consider the BVP: find $u = u(x)$, for $x \in (0,1)$ that satisfies \begin{align} u'' + u u' = f, \\ u'(0) = g_n, u(1) = g_d. \end{align} To derive the weak form for this BVP, we multiply the first equation by a suitably smooth test function $\Phi = \Phi(x)$ and integrate both sides. This leads to \begin{align} - \in...
I am trying the implement the following odeint solver example but my differential equations are different. https://github.com/headmyshoulder/odeint-v2/blob/master/examples/stiff_system.cpp The system I have is stiff so the rosenbrock method is a good fit for that. However, the solution process is really slow, often tak...
According to the answer here, large condition number (for linear system solving) decreases the guaranteed number of correct digits in the floating point solution. Higher order differentiation matrices in pseudospectral methods are typically very ill-conditioned. Why is it then that they are still very accurate methods?...
I'm trying to solve/implement a system of linear equations of the following form/structure: $$ Ax=b$$ $$A = \begin{bmatrix} * & * & 0 & * & -1 & 0 & 0 & 0 \cr * & * & * & 0 & 0 & -1 & 0 & 0 \cr 0 & * & * & * & 0 & 0 & -1 & 0 \cr * & 0 & * & * & 0 & 0 & 0 & -1 \cr 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \cr 0 & 1 & 0 & 0 & 0 & 0 ...
I am interested in understanding how to perform stability analysis for coupled (to keep things do-able, lets say linear) PDE's In the case of a single PDE, i understand the logic behind the VN analysis: mode expansion and look at the amplification factor of any given mode. However for coupled PDE's it seems like you wo...
We start off with a unit vector $\mathbf{v}$ randomly oriented in 3D space and we want to generate another unit vector $\mathbf{w}$ so that $$ \mathbf{w}\cdot \mathbf{v} = \cos \beta $$ where $\beta$ is a given fixed angle. The new vector $\mathbf{w}$ must be randomly oriented, so that on average the cross product $$ \...
Does the CFL condition play any role in a pure Stokes flow, i.e. convective term is neglibile, or vanishing? If not, what is the "equivalent" condition for stability? I have read something about the diffusional time scale but it's quite vague. Anyone with in-depth insight? And a quotation from a paper [1]: "The time st...
Cross-posting from math.stackexchange, since there might be people here familiar with this topic. Assume working in floating point arithmetic with finite precision, bounded exponent and rounding to nearest. Let $x,y$ be positive. It is not hard to find examples such that $$(x+y)-x > y$$ In order to construct a test fo...
I've written a C++ function that multiplies a sparse matrix (stored in CSR format) by a dense vector. Here's the code: VectorXd csrMult(VectorXd x, vector<double> Adata, vector<int> Aindices, vector<int> Aindptr, int numRowsA) { VectorXd Ax = VectorXd::Zero(numRowsA); for (int i = 0; i < numRowsA; i++) {...
I have been following Toro's book on Riemann solvers to implement a finite-volume scheme for computational fluid dynamics. The Riemann solvers presented in the book seem to be fairly tightly coupled to the equations in question. There are papers on how to construct the schemes for various sets of equations such as the ...
Assume that we have a 2D electromagnetic field (in the sense that: $E=(E_x,E_y,0)$, $B=(0,0,B_z)$, and all derivatives with respect to $z$ are $0$), and that we are considering a system made up of two walls at $x=-b$ and $x=b$, held at fixed potential $\phi(y)$, with a third wall at $y=0$ also held at a fixed potential...
Why do active set methods or the simplex method pivot only one variable at a time? Ostensibly, we could add multiple columns to the basis during pivoting, but the standard presentation of the methods don't do this. Likely, something breaks, but I don't understand what. If something more concrete would help, on page 4...
I hope someone knows an efficient computational approach to the following 2D problem: Given two vectors $\mathbf{A}$ and $\mathbf{B}$, find all grid points that lie within the parallelogram spanned by these vectors. This feels like it should be a "known" problem, but I lack the vocabulary to search for the right terms...
Is an error indicator an index for size measurement of something? And how is the relationship between the error estimator and error indicator? Is the error indicator just used for the (e.g. derivative) recovery based error estimation? If the solution of strong form has low regularity, such as including a discontinuous ...
I am trying to plot a figure similar to the one attached here,I tried searching how to do a similar kinds of plot and i found about 'colormap','colorbar' in MATLAB. Actually I want to plot this situation - There are $1000$ cars indexed by $i=1,2,3,...,1000$ and the position changes as a function of time,now i plot ind...
I searched online about the way optimal is defined mathematically,but without any information acquired? How to prove whether a numerical method, e.g. FEM, has an optimal convergence rate or not? Anyone sheds a light on this?
Suppose we are given a set of symmetric, positive definite matrices $A_1,A_2,\ldots,A_k\in\mathbb{R}^{n\times n}$. Is there any numerical method or reduction to a known problem (e.g. eigenvalue computation) that can solve the following problem? $$ \begin{array}{rl} \min_{v_1,\ldots,v_k\in\mathbb{R}^n} & \sum_{i=1}^kv_...
We have a 2D electromagnetic field (in the sense that: $E=(E_x,E_y,0)$, $B=(0,0,B_z)$, and all derivatives with respect to $z$ are $0$), and we are considering a system made up of two walls at $x=-b$ and $x=b$ held at fixed potential $\phi(y)=e^{-y}$, with a third conducting wall at $y=0$ held at $\phi(x)=1$. The curre...
The polyMesh format used in OpenFOAM is an intelligent format for which 'cells' file, i.e. the file giving list of nodes that make a cell, is not needed. The way to reconstruct geometry data such as cell centroids and cell volume is by using divergence theorem an therefore only face data is needed. If the OpenFOAM is u...
I want to look at time evolution of the density matrices of some, very simple, spin systems, but I am having trouble with my approach. I want to use a simple for-loop time-stepping method, not as ODE solver like ode45 as this is supposed to be a demonstration code. I work in Matlab (numerical calculations), so I will i...
I am trying to locate suitable computational algorithms for a optimization problem that requires repeated solution of transient 2D incompressible Euler equation on a 2D domain (say rectangular). My question is whether an off-the-shelf PDE solver can solve incompressible Euler equations on 2D domains in a robust manner,...
Background: The solution space of original problem (which requires a fine enough mesh to resolve the microstructure) can be split into a macroscale solution space and microscale solution space. This can be based on variational Multiscale Method (VMM) proposed by Hughes in 1998. By doing this, we can derive a multiscale...
Calculus of variations problems are generally cast in in the following simple form: find $u(t)$ that satisfies some boundary conditions and minimises $$ F[u] = \int_{t=0}^{t=t_f} f(u(t),u'(t),t) dt. $$ I have run into a far more general problem. I have a functional $F[u]$ that is substantially more complicated. Given $...
I haven't been doing math in years and I'm facing the following problem. I'm trying to implement in Java a linear regression under a set of inequality constraints. Sorry in advance for all the approximations while trying to formulate this problem... More precisely, I have a linear function $f_\Theta:R^n->R$ defined as ...
Suppose I have a nonlinear second order Cauchy PDE $\dfrac{\partial p(x,t)}{\partial t}=N(p(x,t))$, where $N:L^2(\mathbb{R})\rightarrow L^2(\mathbb{R})$, and a known fixed point $u(x)$. Mathematically, the only boundary condition known is that any solution $p$ decays to 0 as ${x\rightarrow\pm \infty}$. From physical re...
Let me illustrate the issue with an simplified example. Suppose we want to solve the following problem with finite difference method (FDM): $$\frac{\partial u(t,x)}{\partial t}=\frac{\partial^2 u(t,x)}{\partial x^2}$$ $$u(0,x)=x(1-x),\ u(t,0)=0$$ $$t\in[0,1],\ x\in[0,1] $$ One boundary condition (b.c.) is missing, but ...
I am working on developing a Dissipative Particle Dynamics (DPD) model of a colloid in a bulk fluid. I essentially want to ensure that the perturbations of my meshed colloid are completely uncoupled from the duplicated copies of itself that are present as a result of using periodic boundary condition. This includes any...
Can the following strictly convex optimization problem be reformulated into a standard form that is also a strictly convex problem? $$\begin{align} &\text{Minimize }\frac{1}{2} x^T Q x + a^T x + c^T|x| \\ &\text{subject to } Gx \leq b \end{align}$$ where $Q$ is positive definite matrix, $c^T \gt 0$ and the rest are vec...
I am investigating various methods for adaptive-step integration of stochastic differential equations and trying to implement them. All of the papers that I've seen (e.g. H. Lamba, J. Comp. App. Math. 161(2), 417–430 (2003)) mention in some form that one has to always preserve the sampled values of the Wiener process. ...
While implementing in Matlab the Frobenius norm of a matrix $$\| A\|_{\text F} := \sqrt{ \sum_{i=1}^m \sum_{j=1}^n a_{ij}^2 },$$ a problem arises when numbers are too big or too small: If a number in the matrix is too big (but within bounds of Matlab), taking its square will result in “infinity”. Adding anything else...
In an Eulerian frame of reference, the CFL number is defined as $$\sigma=\frac{u \Delta t}{\Delta x}$$ with $u$ the magnitude of the fluid velocity. A restriction such as $\sigma<1$ for time integration then roughly means that the initial information travels at most over one cell-width during one time-step. In an Arbit...
I would like to understand how division of round-off errors can lead to large errors??? I am using a method to measure the frequency dependent dissipation in simulations performed by Discontinuous Galerkin(Finite element based) Time Domain method on wave propagation problems. To this end, I excite my domain with a Gaus...
I am responsible for assisting with certain error measurements for an FE program. The idea is to set up some benchmark comparisons which we can use for future development of the program. To simplify the task I chose to look at a simple finite difference scheme for the equation of a parabola. Consider discrete values of...
Computing an axis aligned bounding box of a point set is trivial. Computing a bounding sphere of a point set is also trivial when the center is known. Computing the center of the bounding sphere is not-so-trivial, as far as I see. So my plan is to approximate the center of the bounding sphere by the center of the bound...
I need to add to an existing FEM solver some embedded reinforcement element. This would give me the possibility to model/solve concrete structure (reinforced with steel rebar) taking into account the bond slip. What is allready implemented (no bond-slip) In the current model, the steel rebar are taken into account wit...
Is there any modern online resources which compares the most popular finite element method libraries/packages/languages?
I have solved a simple problem on Openfoam, which is a 3D rectangular parallelopiped, filled with rectangular hexahedrons as mesh elements. The structured, mapped mesh was made in ICEM and solved in OF. But the mesh and data, are in unstructured format i.e. they are represented with connectivity. I now want to convert ...
I am implementing an arbitrary bits random number generator (in [$0,2^n$)) and also want to ensure that the generator always generate unique numbers until all possible numbers generated, so I implement it using LCG (I also considered the linear feedback shift register method, but it cannot be scaled to arbitrary number...
Background I am trying to analyse fourier characteristics of a derivative. For example if I have a first order derivative approximated as following: $$\frac{\partial \Psi(x)}{\partial x} = \frac{\Psi_{i+1}-\Psi_{i-1}}{\Delta x}$$ to get its fourier characteristics, substitute $\Psi(x)= e^{j\, kx}$ in LHS, and its dis...
I am a Computational Biology master's student and I would like to study differential equations (both ODEs and PDEs). I tried to have a look at the available textbooks but what I found is either too theory-oriented or too applications-oriented. I do not want to waste time proving theorems but I do not want to simply sol...
Here, $n$ could be a few hundreds, or even thousands, so it is not possible to pregenerate a list of $$\{0, 1, \dots, 2^n-1\}$$ and shuffle it. Because it is traversal, no number should be visited twice. I want the process of generating the next number as fast as possible. I was trying to use LCG, but it was too slow ...
I have found the following example which is produced as documentation for RS3 geotechnical FE software. This is a validation document that goes through an analytical verification of triaxial testing for modified cam clay material model. It relies heavily upon the p-q stress representation of the model to make its argum...
I have a linear elliptic PDE (unfortunately not allowed to be shown here) with a constant parameter $\epsilon$ giving the stable solutions qualitatively shown by the functions below. As we smoothly increase $\epsilon$, the solution changes "qualitatively" from the viewpoint of the number of extrema relating to the sol...
Cross posted in mathematica.SE. Question : I want to test the solution which is given below is right by Matlab/Maple/Mathematica. Please look the post in mathstackexhange or Please look below. Q: Solve the following heat equation on the semi-infinite rod $$u_t=ku_{xx}$$ where $x,t>0$ and $u_x(0,t) =0$ and $u(x,...
I have a question concerning the branch of successive iteration methods (Newton, Runge-Kutta). I definitely know (or can read in Wikipedia) the implementation of these methods. But I was wondering about the precision in special case. I have a function $$ D(\omega)=det(L_{m,n}(\omega)), \omega = \omega'-i\omega'' $$ and...
I implemented as an exercise a program to sample the statistics of the escape time of a Brownian particle in a potential well. I used the Euler-Maruyama method to numerically integrate the trajectories of the solution of the Ornstein-Uhlenbeck equation. For each trajectory I stored the escape time from the well. #inclu...
For using any programming language, a mathematical formula should be written in the corresponding code. I wonder if there is any service (for any programming language, Matlab, Mathematica, Python, etc) to directly translating a mathematical formula (e.g., written in TeX) into the programming code. Input: a mathematical...