instruction stringlengths 43 28.1k |
|---|
In deriving a Newton scheme, I end up with a Jacobian matrix of the form $J=I+ab^T$ where $a,b$ are vectors. For practical reasons, I want to approximate it by a symmetric positive definite matrix. Symmetrizing is easy: replace it by $J \approx I+\frac 12(ab^T+ba^T)$. But the (now real) eigenvalues may still be negativ... |
C++ eigen library does vectorization for different architecture, like SSE, NEON etc. In their documentation they mentioned that, Eigen vectorization is not compiler dependent. But most modern compilers like gcc does the vectorization automatically if the vectorization flag is enabled using -O3 flag.
So my question is,... |
If I have an equation given by
$$\displaystyle Y = \frac{a^2}{d^2}\frac{(1-c^2\frac{c}{a})}{(1-b^2)}$$
and I expand $a,b,c,d$ in a Taylor series, where $a$ is truncated at the $A^{th}$ order, $b$ is truncated at the $B^{th}$ order, $c$ is truncated at the $C^{th}$ order, and $d$ is truncated at the $D^{th}$ order, how ... |
I am teaching a basic course on computational physics and for the last part of the course I will introduce freshman physics undergraduates to finite-element modelling methods.
I am preparing a COMSOL model that solves for the eigenfrequencies and shape of the eigenmodes of the unperturbed 3D geometry of e.g. a tuning f... |
I am a little confused about the truncation error and what it actually means. So, For example I have an explicit approximation to the heat equation
$$\frac{u_{j}^{i+1}-u_{j}^{i}}{\delta t}=\frac{u_{j-1}^{i}-2u_{j}^{i}+u_{j+1}^{i}}{\delta x^2}$$
Now, I pick a point $(x_j,t_i)$ and do the Taylor approximation of each gri... |
I have a two-dimensional mesh generated by triangle (the mesh generator software is not relevant). This software generates a perfect mesh for approximate the solution by piecewice linear functions (P1 mesh).
For example, for the unit square [0,1]x[0,1] in 2D I have a file with the coordinates of its nodes (for example,... |
I need to process some polygons in 3D. They are typically loaded from an OFF or STL file. Then I need to do some transformations (rotation, move, resize), I'd like to check whether points are inside the polygon or not, whether polygons overalp, and I'd like to merge several polygons into one. I'd also like to have raw ... |
We have a system of equations, wherein the BC of one PDE is coupled with the source term of another PDE.
We have a regular 2D unit grid in x and y.
There are two PDEs to be solved
The first PDE (elliptic diffusion problem) is defined only at $y = 1$, acting along the x-axis (i.e. it acts in the x-direction and only a... |
I have a sizable model (~5000 lines) written in C. It is a serial program, with no random number generation anywhere. It makes use of the FFTW library for functions using FFT - I do not know the details of the FFTW implementation , but I assume the functions therein are deterministic also (correct me if I'm in err).
Th... |
I am trying to determine the order of my numerical method for resolving a fluid-structure interaction problem using the immersed boundary method. I am using Crank-Nicolson to resolve the fluid equations and the immersed body is updated in time using an explicit operator splitting + projection method. The CFL condition ... |
Basically, I am trying to compute the SVD of a large Hermitian matrix $H$ using Lanczos iteration, while $H$ consists if a Toeplitz kernel $K$, which should be able to help speed up the matrix-vector computations(using FFT) over conventional Lanczos algorithms.
$$
H(i,j) = P_i * K_{ij}(i-j) * P^*_j
$$
In summary, I nee... |
more specifically, $C x \log_2(x)- K = 0$, where $C$ and $K$ are constants ($\log_2$ means log base 2).
I was solving a topcoder problem, SortEstimate, which requires us to solve the aforementioned equation.
(Side question: can it be called a polynomial? No? Then what is the name of such an equation?)
I used Binary sea... |
I am pretty new to the CFD and I wanted to start with Chorin's projection. The starting problem is just a free jet flowing in the investigated area. I got terrible oscillations almost immediately and I think it is due to the wrong treated boundary conditions for intermediate velocity $u^*$. There is just a noob mistake... |
In this bit of code, the X and Y arrays should be identical but for some reason, that I CANNOT figure out for the life of me, X[0] is always 1 rather than 0. I have tried initializing the whole array to 0, putting X[0]=0 in directly, using a constant, and no matter what it is always one and the problem doesn't occur fo... |
I am looking for an algorithm that fits a parabola to a set of data points. However, no data point may be below the parabola. All points must be above the parabola. Is there an standard algorithm for finding that parabola?
This is a 2D problem. I have about 20 points.
|
I don't think I've ever seen any scientific computational software that I would consider "good" in terms of software design. I don't mean in terms of functionality, but in terms of good high-level design, coding standards, readability, etc. Most things I've encountered have some degree of bad code smells.
What are some... |
I have been running a finite-element simulation where, for the sake of convergence, I chose to stay in small deformation hypothesis (in comsol, include non-linear geometry box not checked for who that may concern).
Now, my simulation is made-up so that geometry actually undergoes very large deformations.
Under comsol,... |
I am looking for a mesh partitioner, where I can specify overlap, for example h = 3.
I have looked into metis, but I wasn't able to find such a functionality.
Is there any other package which provides this functionality?
|
I am trying to calculate the three-term connection coefficients
$$
Λ_{l,m}^{d_1,d_2,d_3} = ∫_{-∞}^∞ φ^{(d_1)}(x) φ^{(d_2)}_l(x) φ^{(d_3)}_m(x) dx
$$
for Daubechies wavelets numerically using Python. This report (p. 20) gives a nice overview of how to calculate them.
I wrote a (well documented) implementation in python ... |
I would like to know some GNU libraries or lists of downloadable Tersoff potentials. I couldn't find that many of them, and I also would like to know if there is a reason as to why this is the case.
|
Consider linear equation $Au = f$.
We want to solve it with iterative method (assuming $A$ is good).
First order iterative method is:
$$
u^{k+1} = u^k - \alpha_{k+1}(Au^k - f),
$$
The second degree method is:
$$
u^{k+1} = u^k - \alpha_{k+1}(Au^k - f) - \beta(u^k - u^{k-1}).
$$
For both methods we can define iteration ... |
I have an objective function $E$ dependent on a value $\phi(x, t = 1.0)$, where $\phi(x, t)$ is the solution to a PDE. I am optimizing $E$ by gradient descent on the initial condition of the PDE: $\phi(x, t = 0.0)$. That is, I update $\phi(x, t = 0.0)$ and then have to integrate the PDE to compute my residual. That mea... |
I am new to machine learning and statistical analysis and am having trouble figuring how I should go about a problem I have. I believe that I understand the gradient descent algorithm and how it optimizes the parameters of a function.
However, so far I am have mostly seen examples of gradient descent being applied to, ... |
I have a system of PDEs in cylindrical coordinates that needs to be solved:
1. Continuity equation
2. Incompressible Navier stokes ( in r & z coordinates)
3. Heat transfer equation with both conduction and convection terms
Is it possible to solve these equations using PDE toolbox?
This is the link from the MATLAB websi... |
I have measurements of a quantity on a 3d grid. My measurements are distributed on four x-y planes similar to what is shown in the image below. The measurements roughly follow a Cartesian grid but have varying spacing and gaps. The measurements are more sparse in the z-direction but I expect the quantity to vary by an ... |
I have a quick question regarding Rigorous Coupled Wave Analysis (RCWA) for numerically solving problems (in optics). I am trying to simulate a device which is non-periodic in x, y directions (but is longitudinally homogenous in z-direction). Is this possible? If so, would you be able to point me toward some readings o... |
I have some code that does exactly this, but I do not like to use things I do not understand. Here is the code
N1=N+1;
cheb=cos(pi*(0:N)/N)';
unif=linspace(-1,1,N1)';
if N<3
x=cheb;
else
x=cheb+sin(pi*unif)./(4*N);
end
P=zeros(N1,N1);
%N1xN1 zero matrix
xold=2;
%eps= epsilon!
while max(abs(x-xold))>eps
xold=x;... |
I have a large matrix, side-length is about $n\geq 1000$. I need to do element-wise multiplication of this matrix with another matrix many, many times. I make this process by:
Vectorizing (through armadillo) this matrix, i.e., flattening it in a single array.
Splitting this array over many cores. Each core will take a... |
My problem at hand pertains to choosing a distance measure for use in locally weighted regression. In my particular problem, I have a data set that is upwards of 10 dimensions, where the variables have different units (think distances, speeds, angles).
The way I am formulating the problem is along the following lines:
... |
Is it pointless to use gradient based optimization algorithms if you can only provide a numerical gradient? If not, why provide a numerical gradient in the first place if it is trivial to perform finite differentiation for the optimization library itself?
[EDIT]
Just to clarify, my question indeed is in a more general... |
I'm supposed to integrate differential equations for $r$ and $\theta$ in order to simulate orbital motion. The differential equation I used for $r$ is second order and $\theta$ is first order. The end goal is to graph $r(t)$, $\theta(t)$, which I'll probably do with matplotlib in python. I was wondering if anyone with ... |
In 2D, the hat functions are the usual function basis for the finite dimentional space $\{v\in \mathcal{C}:v|_T\in P_1(T)\,\forall T\}$: set of continuously functions that are polynomials less than or equal to one over each element (triangle) $T$ of the mesh.
But, which are the function bases for $\{v:v|_e\in P_k(e)\,\... |
I am trying to find points of a surface whose normal is parallel with the 3 dimensional axes (i.e. local maxima, minima and saddle points in x, y and z dimensions).
The function of the surface is defined as $f(u,v)$ which is continuous and gives a 3D vector indicating the position of the surface for a given set of para... |
I know of at least two ways of dealing with Dirichlet boundary conditions in finite-difference schemes (and, to a lesser extent, finite-element schemes). Here I'm thinking of solving Poisson's equation $\Delta u = f$, but the question is more general.
Treat the function values at boundary nodes as further unknown vari... |
Suppose $A\in\mathbb{R}^{n\times c}$,$u\in\mathbb{R}^n$,$n\gg c$.
The time complexity of eigenvalue decomposing directly for matrix $AA^T+\text{diag}(u)$ is $O(n^3)$. And it is easy to avoid $O(n^3)$ for matrix $AA^T+I$. So can we avoid $O(n^3)$ for matrix $AA^T+\text{diag}(u)$? Thanks.
Regards.
Jay.
|
I am working on a project involving steady solutions for the Navier-Stokes Equations. In the past I've only worked with the unsteady Navier-Stokes, so some of this is new to me.
In particular, at each iteration for some problems, one may need to resort to a relaxation parameter at each iteration, so letting $\tilde{\bo... |
I'd like to solve the elastodynamics equation for a problem with fast scales from an impact (although no shocks).
$\rho\ddot{\mathbf{u}} - \nabla \cdot \sigma(\mathbf{u}) = \mathbf{f}$
In structural dynamics, this equation is typically solved with the Newmark scheme with Lagrange elements for the spatial domain discret... |
In a particular implementation(Finite volume advection using upwind) of adaptive mesh refinement the error square estimate for a cell C is given as
$$
\sum_{i = x,y,z} vol * \frac{1}{12} * h^{2} * (\frac{ds}{di})^{2}
$$
where $vol $ is the volume of the cell, $h $ is the size of the cell and ${ds}/{di} $ is the deriva... |
I am wondering is there any robust, well-tested, accurate open source FEM solver package for Windows? I would like to use to power the engine of my structural engineering application.
The FEM package should come with
Meshing algorithm
Static solver
Modal Analysis
Everything that is standard for structural engineering ... |
I have managed to make my model converge fairly well and achieve large displacements and deformations. It exhibits stress and strain good continuity by solving it under small displacement and deformation assumption. In other terms, engineering strain is computed instead of Green Lagrange strain, stress tensor is Cauchy... |
I was trying to implement a moving mesh algorithm using Gauss Seidel, so:
I have a pde like this (Hamilton - Jacobi eq)
$\begin{cases}\phi_t+H(\phi_x)=0 & [-1,1]\times [0,T]\\\phi(x,0)=\phi_0 & t=0\end{cases}$
and I do this each step:
a) Use a standard solver to approximate solution (one step more in time)
b) Do 5 Gaus... |
I want to approximate the rotation in SO(3) (ie. 3D rotation) that minimizes some objective function.
I'm looking for a SO(3) rotation representation that lends itself to energy minimization. I'm writing a framework that performs minimization on shape parameters, where the goodness of the fit is given solely based on s... |
Background: My PhD was in 'Computational Science'. My dissertation was on the analysis of X-Ray Diffraction Data and analysis of thermally perturbed nuclei in the overall dynamic analysis of the molecular electron density for solid state physics. The takeaway? It was very much based in science.
In my opinion Computatio... |
(Variant of Stats Exercise to Protect the Innocent).
Starting for $x = 0$ I can do one of two operations $\pm 1$ or $\pm 4$. Let $T$ be one iteration of this step.
What is the mean and standard deviation after 10 steps mod 10 ? i.e. the distribution of $T^{10}(0) \mod 10 $
What is the mean and standard deviation aft... |
I am working on block preconditioning and seemingly it is common to write customised Krylov solvers for them. Within each solver, the individual block linear system with preconditioners are approximated by a few runs of AMG V-cycle or a Gauss Seidel sweep.
These methods are however used as smoothers in scipy, or even ... |
I am trying to understand the stability of a finite difference equation on the staggered grid.
I could understand the Von Neumann stability analysis for the collocated grid for a simple acoustic equation as explained in this tutorial and in this Von Newman stability analysis for 2D acoustic wave equation explicit.
Ho... |
I am making a code in C that requires the equivalent of Matlab's '\' command for a linear system of the form AX=B where A is an NxN matrix and X, B are Nx1 vectors- i.e a code that performs X=A\B that is optimized to recognize it will be receiving a symmetric positive-definite sparse matrix. I was wondering if there is... |
I want to make sure I am clear with all the reasons why oscillations and how wild they get. I will summarize what I understood from the books with respect to the application of the Crank-Nicolson to the parabolic PDE. Consider the PDE
$$u_t=au_x+bu_{xx}$$
and some initial data $f(x)$. Assume there are some boundary con... |
I have used the free, multibody dynamics software MBDyn for a while now. It is a good program and also fits my needs. There are good manuals, basic tutorials and examples to be found. There is also a mailing list. The plotting program I had to write myself but there are even suggestions for how to do that.
But as I get... |
I have some data in the form of:
X Y Z Amplitude
0 0 0 0.00
1 0 0 0.00
2 0 0 0.00
3 0 0 0.00
...
27 30 8 0.25
28 30 8 0.25
29 30 8 0.25
30 30 8 0.25
and I want to show them in a 3D plot, with Amplitude either sho... |
Consider an ODE of the form:
$$ u'(t)=-\frac{1}{\varepsilon}u(u-\frac{1}{2})(u-1) $$
with the initial value
$$ u(0)=u_0. $$ Here $\varepsilon>0$ is a constant.
It is easy to verify that $u\equiv0$ and $u\equiv1$ are two stable equilibriums for the ODE. And the ODE has the property:
if $u_0<\frac{1}{2}$, then $u(t)\rig... |
I am facing a problem as follows: I have a box full of points with a certain unknown distribution and I would like to calculate its Voronoï Diagram. The problem is that the number of points is so huge that this may be impossible to do for the full distribution.
Therefore, I have planned to do that for just a region ins... |
This is a follow-up question to How do I form the Chebyshev differentiation matrix in MATLAB? The goal of the following code is to solve the Poisson problem:
function [PerInfError]=Poisson2Dn0dc1sev12(N)
%Solve -nabla^2u=f(x,y) on Omega=[-1,1]^2, with u(Gamma)=x^3, leading
%to I(U) =int(0.5(nabla.u)^2-fu)dxdy
%Exact s... |
I have a robust RNG that generates random 32-bit (unsigned) ints. As is probably well known, for metropolis MC simulation, a random number between 0 and 1 is needed to determine acceptance/rejection of a move, so I need to convert my 32-bit int into a (double-precision) floating point value.
My question is what is best... |
To randomly permute a list one has to select one of $n!$ possibilities, which quickly goes outside of the capabilities of conventional PRNGs. Even Mersenne Twister fails with a list of length greater than 2080 entries, and probably fails much sooner in practice because there's no guarantee that its state is used in a ... |
It's common parlance to say that Linux is faster, and for good reasons. But as stated in the title, how much does choice of OS matter for performance of scientific computing code? For something things which the operating system is more directly involved (such as playing games or video rendering), sure there can be a di... |
I have measurements of magnetic field on a 3d grid. My measurements are distributed on four x-y planes similar to what is shown in the image below. The measurements roughly follow a Cartesian grid but have varying spacing and gaps. The measurements are more sparse in the z-direction but I expect the magnetic field to v... |
I want to discretize and numerically solve the equation:
\begin{equation}
v(k)\dfrac{\partial f}{\partial z} + F(z)\dfrac{\partial f}{\partial k} = \alpha f(z,k) \,\,.
\end{equation}
Discretization with central differences,
\begin{equation}
v(k_j)\left(\dfrac{f(z_{i+1},k_j) - f(z_{i-1},k_j)}{2\Delta z}\right) +
F(z_i)\... |
I have recently come across the Strang splitting and have some questions. For the differential equation of the form
$$ dy/dt = (L_1 + L_2)y$$
Strang splitting implement the time splitting as
$$
\begin{eqnarray*}
\tilde y_1 & = & e^{L_1 \Delta t/2} y_0,
& & \bar y_1 = e^{L_2 \Delta t} \tilde y_1,
& & y_1 = e^{L_1 \Delt... |
My program uses a lot of ellipsoid shaped polygons in 2 and 3 D. So far, I create them by the simple, well-known parametrization about two angles.
Now I'd like to have my ellipses a bit dented and distorted. Currently, I just need some sort of non-perfect ellipsoids, later I'd like to tune it to realisitic production d... |
In this paper, on page 243, we have
$$d_{jk} = \frac{a_j}{a_k(x_j - x_k)}$$
where $$a_k = \prod_{l = 0;l\neq k}^{N}(x_k-x_l)$$
Now, $a_k$ requires evaluating N multiplications. Why does the author say, "$N^2$ operations are required to compute $a_j$"?
|
I am doing a nested integral via quadrature. To give a definite example, lets say:
$$
\int_0^2dx \left[x + \int_0^x dy \, 2y\right]
$$
So effectively I'm integrating $x + x^2$ from 0 to 2 (although obviously my actual problem can't be analytically solved like this). Its implemented in code something like this:
inner(x)... |
When I use Matlab's surf function, I notice that I can't re-perform its interpolation, which produces unreliable results. Do you know what does surf do under the hood?
The following code compares spline and surf interpolation:
z= linspace(-1,1,4001);
x = linspace(-2*pi,2*pi,150);
sharp_gausian = @(y,sigma) exp((-y.^2)... |
I'd like to find numerically a solution to a sparse system of 2000000 polynomial equations of degree 3 with 50000 variables and integer coefficients (or at least to decide whether or not a solution exists).
Question: Is there an algorithm and a supercomputer for which this computation is tractable today?
|
I have a real valued function, let's call it $f(\mathbf{x}, \mathbf{y})$, which I would like to maximise with respect to $\mathbf{x}\in\mathrm{R}^d$ and minimise it with respect to $\mathbf{y}\in\mathrm{R}^q$. After a while I realised that I am looking for a solution that is a saddle point. I have no experience with su... |
I am using the open-source CHLOMOD (as here http://faculty.cse.tamu.edu/davis/suitesparse.html) in order to solve a linear system Ax=b (performing A/b=x) in my domain decomposition code but I am unsure how to use it in my C serial code on a regular CPU rather than a GPU. Could someone give me an example of how to impor... |
I find it kind of counter intuitive, that the result of an advection gets more smeared out at the borders when decreasing the timestep (which should make it more accurate).
Let there be a equally spaces grid $x_1, \dots, x_n$ with a constant 1D advection $v=1$. Let the initial values be
$$u^0=[0, 0, 1, 1, 0, 0]$$
with... |
Given a $M\times M\times M$ 3D cube grid $C$, how can I map the 3D grid-coordinates to 1D coordinates such that every cell's nearest neighbors can be represented by a continuous range of corresponding 1D values?
One of the 3D-to-1D mappings could be Z-indexing, but I don't know how to access the neighbors in the way I ... |
There are lots of higher order time splitting method as shown by the list with real and complex coefficients $a_i, b_i, c_i$:
$$
[e^{c_s \Delta t \hat C}] e^{b_s \Delta t \hat B} e^{a_s \Delta t \hat A} ... [e^{c_1 \Delta t \hat C}] e^{b_1 \Delta t \hat B} e^{a_1 \Delta t \hat A} u
$$
It is not clear which one shou... |
I am not sure if my question is on topic or not and if not please let me know. I have regularly spaced gridded data(output of a weather forecast simulation software) and I have latitude and longitudes as 2D arrays along with geopotential height(2D array). The data is in netCDF or GRIB format. Ultimately I am looking... |
I have discrete time series emerging from the numerical simulations.
It means that the time series can be slightly noisy.
The time series should "obey" to the following formula:
$$ \psi(t) = \sum_{i=1}^{N} a_i \exp(\alpha_i t) \sin (\omega_i t + \phi_i) $$
where $N$ is not known in advance (it can be 1, 2, or 20) depen... |
I'm currently trying to approximate the following type of wave equation (in weak formulation):
Let $\Omega \subset \mathbb{R}^d$ ($d=2$) be some polygonal domain. We seek a function $u \in L^2\left(0, T; H^1_0(\Omega)\right)$ with $u' \in L^2\left(0, T; L^2(\Omega)\right)$, $u'' \in L^2\left(0, T; H^{-1}(\Omega)\right)... |
I am given 2 unstructured (i.e. do not posses any special sparsity pattern like banded/triangular/etc.) sparse matrices $A$ and $B$ of dimension ($n$ x $n$) and density $d$ each (thus each matrix contains $n^2 d$ non zero elements).
In terms of probability, for any element $A(i,j)$,
$p (A[i,j] \neq 0) = d$ and independ... |
I am trying to find some package of Discontinuous Galerkin (DG) method for solving hyperbolic and parabolic equations.
In my research, I focus on designing new schemes for some very simple equations and boundary condition and doing numerical analysis. Thus, I need the package which is easy for me to do possible modifi... |
I was reading about TR methods and there are some terms, which are confusing for me.
It says, method is globaly convergent. What does it really mean? Converges to global minima, or converges for sure to local minima, if there is any?
thanks for clarification!
|
Can you recommend a good book that discusses several methods for the numerical solution of time-dependent and time-independent Schrödinger equation? I have searched the internet several times but could not find good references.
It would be very helpful if the book also contained matlab/python examples.
I am trying to ... |
We know shock tube problem will give discontinuous solution of primitive variables ($\rho$, $v$, $p$). Will it give discontinuous result in flux terms?
$F =[\rho u, \rho u^2 +p, \rho e_v]^T$. I tried that on one FORTRAN code of analytical solution on shock tube problem. I have plotted $\rho u$ in the following figure
... |
I am trying to solve for the allowed wavefunctions and energies for a 1D quartic potential well.
To do this I am using the patching method (https://engineering.dartmouth.edu/microeng/otherweb/henning/papers/jap-sub95.pdf). I integrate from x = 0 to x = patch and from x = patch to x = end with the Numerov method. I the... |
The scheme is given by
$$\frac{v_m^{n+1}-v_m^{n-1}}{2k} + b\frac{v_m^{n+1}+v_m^{n-1}-v_{m-1}^n-v_{m+1}^n}{h^2} = 0$$
where $v_m^n$ is the numerical solution at the $m^\text{th}$ spatial coordinate and $n^\text{th}$ time step. It approximates a solution to
$$\frac{\partial u}{\partial t} - b\frac{\partial^2 u}{\partial ... |
I have 3 variables I am considering: time (t), 1-dimensional space (x), and intensity (I). I would like to plot the intensity in the z-axis as a function of t and x (the latter two variables would form an xy-plane). With the current data I have, these variables themselves are 2-dimensional arrays where each correspondi... |
Kahan's summation algorithm is a method to compute sums:
$$\sum x_i$$
with many terms, without significant error.
I want to do this with very large numbers, and instead of the numbers themselves, I am given their logarithms, $\log x_i$ ($x_i > 0$), and instead of the sum, I want to compute the logarithm of the sum,
$$\... |
I've implemented a version of the double-shift QR algorithm featured in this report from ETH Zurich (Begins on page 77). The algorithm takes advantage of the Implicit Q theorem by applying an orthogonal-similarity transformation to our original matrix (in Hessenberg) form. This introduces a 'bulge' which we then chase ... |
To make stability proofs simpler, I can consider an explicit scheme written as
$$V(n+1,i)=aV(n,i-1)+bV(n,i)+cV(n,i+1)$$
and one can show that if $a,b,c\ge 0$ and $a+b+c\le1$, then the explicit method is stable.
And for implicit, the scheme can be written as
$$aV(n+1,i-1)+bV(n+1,i)+cV(n+1,i+1)=V(n,i)$$
and if $a,c \le 0... |
I want to compute an expression of the form:
$$L = \ln\sum_i e^{x_i}$$
Suppose that there are many small terms, say $e^{x_i} \approx \epsilon$. If there are $N_\epsilon$ such terms, their contribution to the sum is $\approx \epsilon N_\epsilon$.
In the usual logsumexp trick, we let $a=\max x_i$ and compute
$$L = a + \... |
Assume we have a positive semidefinite matrix $A$ with $A\in\mathbb{R^{n\times n}}$. Clearly a cholesky decomposition $A=B^TB$ exist with $B\in\mathbb{R^{n\times n}}$. For my research it would be interesting to know, if we can construct a rectangular decompostion so that $A=B^TB$ with $B\in\mathbb{R^{m\times n}}$ and ... |
Can anyone write a Python implementation of a set of particles interacting in 2D according to a short-range particle-particle force and evolving in time under a Metropolis algorithm, which randomly chooses a particle and proposes a random spatial move? I can write such an implementation using the naive approach of upd... |
I'm relatively new in numerical methods for PDEs, so I have a question about solving the following PDE numerically for $W(x,p)$ in the phase space:
$$-p\frac{dW}{dx}+x\frac{dW}{dp}+\frac{d}{dx}\left(xW \right)+2 \frac{d}{dp}\left(pW \right) + \frac{d^{2}W}{dx^{2}} +\frac{d^{2}W}{dp^{2}}-\frac{d^{2}W}{dxdp} = 0.$$
What ... |
I've got two inverse problems,
$$A_1 ~ x = b_1 \qquad A_2 ~ x = b_2$$
So far I've been solving them independently using Tikhonov Regularization and getting two estimates for $x$. However in my case $x$ represents the same solution in both equations. Is it possible to do a 'simultaneous' solve? Ideally I would be findin... |
Consider an advection-diffusion problem
$$u_t+au_{xx}+bu_{x}=0,\quad x>0.$$
Now I want to remove the drift and rewrite the problem for the new domain. I use the change of variables $y=x-bt$, and the equation can be rewritten as
$$v_t+av_{yy}=0$$
but what is the new domain in terms of variables $t$ and $y$?
Assume $b>... |
I am working on a domain decomposition code in C that uses CHOLMOD to approximate grid values for a PDE in each sub-domain. The issue I have is that the methods use Matrix Market format, which is not an issue in general, but I already have a method that computes a 2D array which is the sparse matrix A in the Ax=b solve... |
Let $\Sigma$ be positive definite and the $D_i$ positive diagonal. Let the $X_i$ be unknown square matrices. Consider the system of equations:
$$(I+\Sigma D_i)X_i=\Sigma\hspace{5mm}\text{for}\hspace{5mm}i=1,...n.$$
Is it possible to numerically solve all of these equations without having to completely recompute the L... |
I came with a the following code to evaluate a double integral using Gauss Legendre quadrature in MatLab
m=100;
%generate weights and abscissas
[wx,xx]=leg(-1,1,m);
[wtheta,xtheta]=leg(0,2.*pi,m);
%define function
psi=@(x,theta) hypergeom(-3./4,1./2,x.^2.*exp(1i.*theta));
%integrate with respect to x
intx=zeros(1,m... |
I need to calculate the inverse CDF for a probability distribution, however there is no closed form approximation available in the literature.
The distribution I am working with is the Normal Inverse Gaussian distribution, however I would like to make my question more general than this. Of course, mathematical analysis... |
For a graph $G=(V,E)$, recall that the unweighted Laplacian is $L:=D^\top D$, where $D\in\{-1,0,1\}^{|E|\times|V|}$ is the graph "gradient" operator that subtracts adjacent vertex values onto edges.
I'm writing an algorithm that adds/removes edges one-at-a-time to a graph. In each iteration, I need to apply $L^+$ to ... |
I am modelling a seismic wave equation using FEM. In the few papers that I read, I understand the following: (Kindly correct me if you disagree)
A shear (secondary wave - no change of volume) is more important to model than the compression (primary wave - no rotation) as it brings more devastation than the latter.
The... |
I have the following curve, which is calculated on a large number of points and shows smooth behaviour when viewed from distance.
However, the derivative (shown below) exhibits artificial oscillations which are inevitable due to complications in my method of numerical calculation. I know about the correct result and i... |
If $w$ is the vector of conservative variables, $f=f(w)$ the flux function, I think have read somewhere (I can not find it anymore) that the inflow boundary $\Sigma$_ is characterized by:
$\Sigma_{-} = \left\{x, \nabla_{w}f \cdot \mathbf{n} < 0 \right\}$.
What is the exact definition of $\nabla_{w}f$ and is it not $\... |
I'm doing PML simulation, and while I was looking for correct geometry for my layers of propagation, I got a question.
My device has two vibration sources, and this vibration will propagate through the medium and diminish.
I am trying to draw my medium as a cylinder or hemisphere, but since there are two vibration so... |
For two given vectors, not necessairly the same length, $x=(x_1,\dots,x_N)$ and $s=(s_1,\dots,s_M)$ I would like to compute the following term as efficiently as possible in R. For $j=1, \dots, N$
$$ H_j:=\sum_{i=1}^Ml_i(x_j)$$
where
$$l_i(x_j)= \prod_{l = 1,l \not= j}^M \frac{x_j-s_l}{s_i-s_l}$$
below is some test co... |
In computational physics, the vast majority of papers has the following structure
They propose some new algorithm, or improvement to an existing one
They give numerical examples, ideally comparing relevant characteristics of their new method with existing methods
I am wondering which journals would publish a theoreti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.