instruction stringlengths 43 28.1k |
|---|
Problem statement:
Assume that I have an objective function $f(x)$ which takes as input a $D$-dimensional vector $x\in\mathbb{R}^D$, and that $f(x)$ is sufficiently smooth. Assume further that I have a set of $N$ samples $\{x_1,x_2,...,x_N\}$ for which I know the output of the objective functions $\{f(x_1),f(x_2),...... |
I have a linear system where I am given 2 matrices, $A$ and $B$, and 2 vectors, $v$ and $c$, and I need to solve for the vector $x$. $A$ is $n\times n$, $B$ is $n \times n \times n$, and the vectors $v$, $c$, and $x$, are all $n\times 1$. I need to solve for $x$, which is complicated as you'll see below by the right mu... |
I've been reading Albright's Orbital Interactions in Chemistry. In the chapter on solids, he provided a general approach to find the band structure of a solid state system
Now if we are to model a one dimensional hydrogen chain, let $|1s(r)\rangle$ denote the $1s$ orbital centered at $r$. The band energy at each $k$ ... |
Last week, I have learned the details of the robust iterative methods of PCG, MINRES, GMRES, which will converges to the exact solution $x^*$ of nonsingular system within $N$ steps for $A\in \mathbb{R}^{N\times N}$:
$$
Ax=b.
$$
And the requirements for the matrix is: SPD matrix for PCG, symmetric matrix for MINRES, no... |
I am developing a solver that gets a CAD model as entry and does the topological optimisation calculation on it. My solver is inspired by the open-source codes presented in the literature.
Since it is just a solver I need to do the pre-processing and post-processing using a third-party code. I create my geometry and me... |
A maximization problem reads as
$$ J(y) = \sum_{k=1}^{K} \sigma_k(y)^q \mathop{\rightarrow}^{y} max$$
where $q \in [1,\infty]$ is a user-defined parameter and functions $\sigma_k, k=\{1,\dots,K\}$ satisfy these two conditions for any given $y$:
$$ \sigma_1(y) \geq \sigma_2(y) \geq \dots \geq \sigma_K(y) \geq 0.$$
and
$... |
The quadratic knapsack problem (QKP)
$$\max_x x^TPx$$
$$\mathrm{s.t.}\;\;w^Tx\leq c,\; x\in\{0,1\}$$
where $P\geq0, w\geq0$ elementwise, is well studied and has existing solvers.
My problem below seems closely related to QKP, but I can't find a way to transform it to a QKP to use existing solvers.
$$\min_x x^TPx$$
$$\m... |
I have to calculate in numpy the matrix-product of many matrices (~400). Are there common practices to increase numerical stability?
If this is relevant, the matrices are $300\times 300$ orthogonal projection matrices.
|
Consider a square $N \times N$ block-matrix $\mathbf{A}$, where each $n \times n$ block $\mathbf{A}_{ii}$ is either a dense block or a zero-block. So, $N$ denotes the number of blocks, $n$ denotes the size of each square block.
Random example for illustration:
$$
\mathbf{A}=\left[
\begin{array}{ccccc}
\mathbf{A}_{11}... |
This semester, I study the Krylov subspace iterative methods (about Ax=b) using the book H. A. Van der Vorst. Iterative Krylov Methods for Large Linear Systems,
volume 13. Cambridge University Press, 2003.
About choice of the basis of the Krylov subspace, I have some doubts about the saying in this book (section 3.3) a... |
I need an explicit Runge-Kutta 14th order formula. If you know about some reference that discusses at least 10th order (or higher, since I'm looking for the 14th) of Runge-Kutta and there is information about the whole formula like
$$y=y+\frac{h}{C}\left(c_1 k_1+ c_2 k_2+c_3 k3+\cdots +c_n k_n\right)$$
with defined coe... |
I'm trying to educate myself on modelling solute flows through pipe networks.
This is a follow up of my previous post here
$$\frac{\partial C}{\partial t} = - v\frac{\partial C}{\partial x}$$
While modelling flow through pipe junctions, I understand that the junction is
assumed to have complete mixing, negligible volum... |
I've been reading this paper recently, which talks about using Lattice Boltzmann methods and two way coupling. Specifically, it outlines fluid solid coupling, and solid fluid coupling, and how simply using both results in two way coupling. The force from the fluid on the ridgid body makes sense, what doesn't make sen... |
Suppose I have
$$f=\frac x 3+ \frac y 3 +\frac z 3$$
And I want to use
collect(f, 1/3)
And I wish it will displays
$$f=\frac1 3(x+y+z)$$
But it doesn't work.
|
The above graph represents reduced viscosity as a function of reduced temperature for several values of the reduced pressure.
I am writing a code which will estimate the viscosity, in the following steps :
Calculating critical viscosity($\mu_c$) by using the formula,
$$ \mu_c = 7.70M^{0.5}p_c^{2/3}T_c^{-1/6} $$
... |
On a desktop scale computer, what are the most important bottlenecks (RAM vs. CPU, single vs. multithread) for numerical calculations? I'm specifically most interested in exact diagonalization and other methods (DMRG, DMFT) for strongly-correlated condensed matter systems. What computational resources would pose the st... |
What is a good way to sample parameters for performing global sensitivity analysis? Some methods are defined using integrals, some are use Monte Carlo. How do these compare?
|
I'm looking to find a computationally efficient solution to a large system of nonlinear equations. I'm trying to maximize the following function:
$$ f(\vec{x}) = \sum_i^N C_i (x_i-A_i)x_i^{\epsilon_{ii}} \prod_{j\not = i}^N x_j^{\epsilon_{ij}}$$
Subject to the constraints:
$$ C_i > 0 \quad\forall\: i$$
$$ x_i > A_i > ... |
I would like to numerically solve the following equation: $$\frac{\partial \rho (z,t)}{\partial t} = B(N_D \rho (z,t) + \rho(z,t)^2) + D \frac{\partial^2 \rho (z,t)}{\partial z^2}$$
with the boundary conditions being:
$$D \frac{\partial \rho}{\partial z}|_{z=0} = S_f \rho (z=0,t)$$
$$D \frac{\partial \rho}{\partial z}... |
Recently, I have studied how to construct an orthonormal basis for Krylov subspace to solve $Ax=b$, where $A\in \mathbb{R}^{n\times n}$ is nonsingular. As we know, there are usually 4 ways to construct an $m$ dimensional Krylov subspace $\{v,Av,...,A^{m-1}v\}$ as follow:
standard Gram-Schmidt (G-S);
Modified Gram-Schm... |
I have looked at the FEniCS tutorials and documentation but I cannot find any mention to the possibility of implementing an immersed boundary method (IBM) for fluid dynamics.
In particular, I want to develop a solver for the incompressible Navier-Stokes equations of internal flows with elastic walls. I am thinking of ... |
After reading Prof. Saad' Book, "Iterative methods for Sparse Linear Systems, 2nd version", I want to do the numerical examples about the Krylov subspace methods not only to reproduce the results in his book but also to guarantee me really understand the idea of Krylov subspace methods, but I have some trouble.
First, ... |
I know two methods to simulate a PDF from random data samples using MATLAB :
1) Using a histogram where I use this command
histogram(data,'Normalization','pdf'), it gives PDF like bins.
2) Another one is using kernel density estimation
From (1) I get a PDF in bin format and from another (2), I get a continuous(smooth) ... |
I have a nonlinear least squares problem, in which I am trying to minimize residuals which can be divided into four classes:
$$
\min_x ||\epsilon(x)||^2 + ||\xi(x)||^2 + ||\delta(x)||^2 + ||s(x)||^2
$$
The parameter vector $x$ can be naturally divided into four classes of parameters, $x = \left( x_1, x_2, x_3, x_4 \rig... |
I want to solve a thermal analysis using finite elements. The governing equation is $$C \frac{dT}{dt}+K T = Q$$.
When using backward differencing for time, the resulting equation is quite straight forward.
When I now try to solve this equation for a number of time steps, I can see that the results can oscillate a lot... |
I am trying to solve a transport equation of the form for the variable $\psi(t,r)$
\begin{equation}
\partial_t\psi-\alpha(r)\partial_r\psi-\beta(r)^2\psi-f(t,r)=0
,
\end{equation}
where I am solving for the function $f(t,r)$ from another PDE (a wave equation-so the amplitude of $f(t,r)$ oscillates in time and space). M... |
I am reading a paper which compares algorithm A versus algorithm B.
It shows that algorithm A is faster than algorithm B via benchmarking that shows the CPU time.
What is the point of this? Any benchmarking is going to be dependent on the particular implementation. The benchmarking says nothing about the intrinsic spee... |
Multibody Systems modeling is a very systematic approach usually results in large sparse Jacbian matrix. I am working to model a system consisting of 11 bodies and 63 constraint equations as soon as i finished the assembly of the system`s Jacobian matrix I got a very ill conditioned matrix even I reviewed the model sev... |
I am solving a system of non-linear equations using the Newton-Raphson method in Python. This involves using the solve(Ax,b) function (spsolve in my case, which is for sparse matrices) iteratively until the error or update reduces below a certain threshold. My specific problem involves calculating functions such as $x/... |
My problem seems simple but I can't find an algorithm that will do that for me for any 3D complex surface.
I have a really complex shape 3D surface and a closed curve on it defined by some points (see picture below, that black curve is the closed curve). My purpose is to detach that bulge from the rest of the surface b... |
About the analysis of Full Orthogonalization Method (FOM) in Prof. Saad's book, wrote as follows:
Algorithm 6.4 (FOM):
\begin{array}{l}
r_0=b-Ax_0,\beta=\|r_0\|_2,v_1 = r_0/\beta\\
Define \quad H_m = \{h_{ij}\}_{i,j=1,\dots,m}, Set\quad H_m=0;\\
For \quad {j=1,\dots,m}\\
{\quad w_j = Av_j\\
\quad\quad For\quad{i=... |
I want to solve numerically the one-dimensional time-dependent Schrödinger equation $$i \psi_t(x,t)=-\frac{\hbar}{2m} \psi''(x,t)$$
My issue is that I don't have the physical background to understand what are the correct boundary conditions/initial state and I don't know how to know if the solution I get is the correct... |
While simulating the diffusion of a substance in 1D,
$$
\frac{\partial C}{\partial t} = \nabla \cdot (D \nabla C).
$$
I'd like to compute the diffusion time
In this link, the diffusion time is given by
$$t_D = \frac{l^2}{2D}$$
Say, l = 10 and the x-direction is discretized in steps of $\Delta$x = 1.
i.e. xmesh = 0:$\De... |
So I've found some interesting linear algebraic research areas that's both pure-ish, with a numerical bent to it, too -- e.g. inverse eigenvalue problems have both interesting theoretical and computational aspects, spectral graph theory seems pretty cool (found through Yale's applied math course description ...), combi... |
I am learning FEM from KJ Bathe's textbook and it is mentioned that for a general FEM solution, nodal and element equilibrium is satisfied. The explanation takes steps that I don't understand.
At any node, the sum of the element nodal point forces is in equilibrium with the externally applied nodal loads (which includ... |
I have been trying to numerically solve the Rayleigh-Plesset equation for a sonoluminescence bubble in Python. You can read about this phenomenon here: https://iopscience.iop.org/article/10.1088/0143-0807/34/3/679.
The Rayleigh-Plesset equation is a non-linear ODE, which can be solved to find the Radius of a bubble su... |
Methods of Weighted Residuals (MWR) [1] usually include Galerkin, collocation, method of moments, least-squares and subdomain methods.
Spectral methods [2] usually include Galerkin, tau and pseudospectral methods. Pseudospectral is another name for collocation and the tau method is the same as the method of moments [3... |
One approach is the brute force method of evaluating at all points at fixed intervals and when it nears zero write value, this can be combined with adaptive step size. Another approach is approximating it with a polynomial of a certain order and using common methods like Newton-Raphson or bisection to find its roots, a... |
In 1D problems, tridiagonal systems of equations are obtained when we use finite-difference or finite-volumes in a structured mesh. A wide solver is the TDMA algorithm here. In two-dimensional modelling, we achieve a block tridiagonal systems of equations. However, I found a lack of codes dealing with those block matri... |
I'm supposed to solve the following partial differential equation in python using Runge-Kutta 4 method in time.
$$
\frac{\partial}{\partial t}v(y,t)=Lv(t,y)
$$
where $L$ is the following linear operator
$$
L=\left(\frac{\partial^2}{\partial y^2}-\alpha^2\right)^{-1}\left\{-i\alpha(1-y^2)\left(\frac{\partial^2}{\par... |
Anyone have an idea for a DCP (disciplined convex programming) representation of the concave function $x\sqrt{1-x}$, which is has domain $[0,1]$?
The Taylor series about $x=0$ is
$$x - \frac{x^2}{2} - \frac{x^3}{8} - \frac{x^4}{16} + O(x^5)$$
which is DCP. However, I'm trying to find a DCP representation for the func... |
About the flexible GMRES (fgmres), we know that it is a variant of right preconditioned gmres. And the robust command gmres in matlab as follows:
>> help gmres
gmres Generalized Minimum Residual Method.
X = gmres(A,B) attempts to solve the system of linear equations A*X = B
for X. The N-by-N coefficient mat... |
The computation of Troullier-Martins pseudo-wavefunctions has been
described in [1].
The pseudo-wavefunction $R^{\textrm{PP}}_l$ is defined by
$$
R^{\textrm{PP}}_l(r) =
\left\{
\begin{array}{ll}
R^{\textrm{AE}}_l(r) & r \geq r_{\textrm{cl}} \\
f_l(r) & r \leq r_{\textrm{cl}}
\end{array}
\right.
$$
Here
$$
f_l(r) = r^... |
Prewitt gradient operator
Show that the Prewitt gradient operator can be obtained by fitting the least-squares plane through the 3 × 3 neighborhood of the intensity function.
Hint: Fit a plane to the nine points (x + $\delta$x,y + $\delta$y,I[x + $\delta$x,y + $\delta$y]) where $\delta$x and $\delta$y range through −1... |
For context: Gelfand's formula for the spectral radius is $\lim_{k\rightarrow \infty}|A^k|^{1/k}$ where $|\cdot|$ is any well-defined operator norm.
I naively coded a function to calculate the $k$th term in Python as
from numpy import linalg as la
def kth_term(matrix, k):
matrix = la.matrix_power(matrix, k)
... |
I am trying to compute the convolution of two characteristic functions over a Cartesian mesh. First, I define my Cartesian mesh of the interval $[0,1]$ as follows
$$
x_{i} = i \Delta x, i = 0, 1, 2\\
\Delta x = \frac{1}{N},
$$
with $N$ being the number of grid points. Secondly, we can compute the convolution of two ... |
I want to solve the convex optimization as follows:
\begin{align}
\underset{X_1,X_2}{\min} &\ -\frac{1}{N}\sum_{i=1}^N\log\det\left(I+H_i^HX_2H_i\right)-\log\left[1+h^H(X_1+X_2)h\right]\\
&\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad+ \text{tr}(AX_1)+\text{tr}(BX_2)\\
\text{s.t} &\ \text{tr}(X_1+X_2) \leq 1 \... |
My PDE simulation program written in Fortran has to make about 2 million variable time steps. But with each time step it slows down more and more, so that if it initially makes 1000 time steps per second, then when it reaches time step 600k and above, it makes 1000 time steps in as many as several minutes. And the slow... |
I have a matrix $A\in \mathbb{C}^{N\times N}$ and I need to calculate $||A^{-1}||_{2}$ efficiently. Can it be done without having to evaluate the inverse explicitly?
In general, I am looking for methods of calculating $||A^{-1}||_{2}$ that are faster than just doing the following in Matlab:
norm(inv(A))
If no faster m... |
I am creating a C++ Physics Simulation where I need to move an rigid body through an acting force field.
Problem: simulation does not conserve energy.
Quesiton: abstractly, how is conservation of energy handled in modern day physics simulations?
My specific instance:
Simulation parameters:
- Constant force field F = <... |
I am trying to implement a numerical solver and am having troubles dealing with boundary conditions, especially in the corners.
I have a 2D mesh, and on the left I have a Dirichlet condition, on the bottom I have a Neumann condition, and on the top and on the right I have a zero-flux vacuum boundary condition.
That is:... |
As far as I understood, scipy.linalg.eig use wrappers from scipy.lapack to compute the eigenvalues and eigenvectors of a matrix. In order to do that eig test the matrix to select the good LAPACK function. Please correct me if I'm wrong.
When the matrix is singular and the algorithm does not converge Python raises an er... |
If one had to code up a new dynamical system for a research group at a university, and the university has a Matlab total headcount license so that one could code in Matlab, are there any benefits to coding in Python instead? How much more work would it be to code in Python than in Matlab? About double the lines of co... |
I am looking for a mathematical explanation for the singularity caused by a Dirichlet boundary condition partially imposed at a boundary.
For instance
$$
\nabla^2u=0 ~ \text{in}~\Omega
$$
where $\Omega$ is a rectangle of 10 by 4. Dirichlet boundary condition $u=0$ is imposed at
$
y=0 ~\text{and}~ y = 4 ~\text{and}~ x ... |
Given matrix $K_{n \times n}, H_{n \times n},M_{n \times n}$, I want to solve for $B_{n \times n} $ and $V_{n \times 1}$ from the nonlinear system of equations:
\begin{aligned}
&H_{i j}=\frac{B_{i j} \frac{K_{i j}}{V_{i}}}{\sum_{i ^{\prime} =1}^{n} \sum_{j ^{\prime} =1}^{n} B_{i^{\prime} j^{\prime}} \frac{K_{i^{\prime}... |
I have the following matrix
$$ A = [x_1, x_2, ..., x_n], $$
where $x_i \in \mathbb R^n$. But I know the relationship that
\begin{align}
x_2 = s_2 x_1 \\
x_3 = s_3 x_3 \\
...
\end{align}
where $s_i$ are the scalars. So the matrix $A$ should have the rank 1.
In this case, it seems that I can decompose $A=SVD$ and truncat... |
According to [1] the one-dimensional Kohn-Sham equation is given by
$$
\left( -\frac{1}{2} \frac{d^2}{dr^2} + \frac{l(l+1)}{2r^2} + V[\rho;r]\right)
rR_{nl}(r) = \varepsilon_{nl} rR_{nl}(r)
$$
where
$$
V[\rho;r] = -\frac{Z}{r} + V_\textrm{H}[\rho;r]+V^\textrm{LDA}_\textrm{xc}(\rho(r))
$$
How are the radial Hartree pote... |
I encountered some odd results when using the function fix() in Octave and Scilab. The following is input and output of the Scilab console but the exact same thing happens in Octave.
I start with the following matrix:
A=[1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0;
0,0,0,0,0,0,0,1... |
I want to learn a very simple PDE to gain physical and mathematical intuition—a PDE with just one spatial dimension $x$ and a time dimension $t$. And, I want to write code for it in Matlab and use a standard PDE solver that Matlab might have, so that I can get a feel for the solution to the PDE and how the solution cha... |
I was recently reading some literature about evolutionary game theory and I got particularly interested in Moran process linked to prisoner's dilemma as a model of evolution of two sub-populations.
Please take a look at this paper:
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5701760/
I understand the model rather well... |
I was reading the book: The Finite Element Method: Theory, Implementation, and Applications by Mats Larson and Fredrik Bengzon, in page 140 of this book they say this:
"The Lax-Milgram Lemma is one of the most
important theorems in applied mathematics"
but, why?!... to answer this we recall that many boundary-value pro... |
I am solving the steady, two-dimensional adjoint Euler equations, $$A_x^T \partial_x \Psi + A_y^T \partial_y \Psi = 0$$, where $A_x = \partial F_x/\partial U$ and $A_y= \partial F_y/\partial U$ are the Flux Jacobians and $\Psi = (\psi_1,\psi_2,\psi_3,\psi_4)^T$ is the adjoint state. $F_x=(\rho v_x,\rho v_x^2+p,\rho v_x... |
This is a follow up to my previous post
I've been trying to compare the diffusion time obtained from theoretical
derivation(answered in my previous post) and what is obtained computationally, for a 1D diffusion equation.
Theoretically, the diffusion time is given by
$$t_D = \frac{l^2}{2D}$$
Calculating $t_D$ , l = 5 nm... |
tl;dr
Using a Taylor-matched method to find coefficients for the discretized equation $ \mathbf{A} \vec{f}'' = \mathbf{B} \vec{f} $, a Fortran code has been implemented to find the second derivative and tested for $f=\sin$, with bad results on non-uniform grids. Which is the cause for that?
Methodology
I am new to non... |
I'm trying to simulate the heat diffusion in a 3D piston. I marked the boundaries on GMSH.
I have used a Dirichlet BC of 300 on the top face of piston. But the results look abnormal. There is a change in temperature along the edge on the top face, which should not be case.
Here is code snippet
from __future__ import pr... |
More specifically, when training a neural network, what reasons are there for choosing an optimizer from the family consisting of stochastic gradient descent (SGD) and its extensions (RMSProp, Adam, etc.) instead of from the family of Quasi-Newton methods (including limited-memory BFGS, abbreviated as L-BFGS)?
It is c... |
I am trying to implement Minimum Discarded Fill (MDF) Ordering algorithm for incomplete matrix factorization. The algorithm description is here on page 60 Preconditioning Techniques for a Newton–Krylov Algorithm
for the Compressible Navier–Stokes Equations.
There is a thing that I don't understand. For initialization I... |
Given a rectangular Toeplitz Matrix $ H $, how could one solve:
$$ y = H x $$
For instance, $ H $ can be Linear Convolution Matrix of the filter $ h $:
$$ H = \begin{bmatrix}
{h}_{1} & 0 & 0 & \ldots & & 0 \\
{h}_{2} & {h}_{1} & 0 & \ldots & & 0 \\
{h}_{m} & \ldots & {h}_{1} & 0 & \ldots & 0 \\
0 & {h}_{m} & \ldot... |
I am familiar with and have written MathCad algorithms for the partition functions (,),which gives the number of ways of partitioning into parts, (,), which gives the number of ways of partitioning into distinct parts, and (,,), which gives the number of ways of partitioning into exactly parts of size at most .... |
I have a problem getting a sensible result for the Mean Square Displacement (MSD) for a simulation of $N$ particles under Brownian dynamics with Lennard-Jones interaction between them with or without periodic conditions applied.
According to my class notes, the result should look similar to this:
Instead, with periodi... |
When I read strong papers from, say, the Journal of Fluid Mechanics, a simple model, simulations and physical experimental results are given, showing good agreement.
Can one publish a new model and simulation that describes a complex physical phenomena, without having experimental work to test the model and compare wit... |
Currently when I try to solve a linear algebra system of the form of $A x =b$ I use the algebraic multigrid method. The algebraic multigrid method uses a Galerkin product to form the coarse grid matrix ($A_c = RA_fP$). Where $R$ is the restriction operator, $P$ the prolongation operator, $A_c$ the coarse grid matrix an... |
I am trying to understand the theory behind a splitting based iterative method which uses the incomplete Cholesky factorization. Before giving the specific details, let me first give the problem background:
I have discretized a linear system $Au = f$ for the following PDE problem:
$$-\frac{\partial u}{\partial x^{2}} ... |
I have a cloud of points scattered in a rectangle and some data in this points, a bit like this
$$
x(:)=[x(1), x(2), ..., x(N)] \\
y(:)=[y(1), y(2), ..., y(N)] \\
u(:)=[u(1), u(2), ..., u(N)]
$$
Here, I am looking for plotting a contour of the $u$ data on matlab.
I tried several function on matlab; contour, contourf... |
I'm trying to solve the 1D heat equation with Neumann boundry conditions numerically using finite differences:
$$u_t = \alpha u_{xx}$$
$$u_{x}(0, t) = u_{x}(L, t) = k$$
$$u(x, 0) = u_0(x)$$
The main problem here is that $u_x$ isn't in the equation, so I thought I could use the Taylor expansions of $u(x)$:
$$u(x+h) = u(... |
Octave calculations is too slow specially when you deal with scientific calculations that can span a very very large matrix, even just iterating. I have to vectorize it to speed up the calculation.
Vectorizing a 1xn matrix would just be easy by following
for i = 1:n
if (a(i) > 5)
a(i) -= 20
endif
endfor
https... |
The governing equation of transient heat transfer analysis is described as follows:
$$C \frac{dT}{dt}+K T = Q$$
When using backward difference scheme for the discretization of the time we get the following equation:
$$(\frac{C}{\Delta t}+K)T_n = Q_n+\frac{C}{\Delta t}T_{n-1}$$
Where $C$ is the heat capacity matrix, $K... |
Can a subfield such as the representation theory of Lie algebras be studied computationally / numerically -- is there an interplay between the abstract and the concrete? I would be grateful for an example, e.g. a reference to a journal paper.
|
I'm trying to compute efficiently the following
\begin{equation}
A_j = \sum_{l'=1}^{\infty}\sum_{k= 0}^{K-1} L_{l'}T_ke^{2\pi i \frac{k}{K}j}\epsilon_{l',k}
\end{equation}
for $j = 0,1, \ldots, K-2,K-1$, where $L_l$ (dimension $NL$) and $T_k$ (dimension $W$) are 1D vectors of complex numbers and $\epsilon$ is a 2D matr... |
According to the survey paper on autodiff (linked) Autodiff works on inputs that cannot be specified in closed form but can be described by a sequence of code, each component of which is differentiable. Autodiff also works on code that can be symbolically differentiated but in this latter case the benefits are less obv... |
Sorry it's bit abrupt, but recently I am caught up in some symbolic calcualtion which is tedious and almost impossible with mere human hands, so just wondering is it possible to solve the double integral of what's written below using Matlab or some other platform?
$$\int_{0}^{a}dk\frac{1}{k}\int_{|k-q|}^{|k+q|}dk'\frac... |
I have a delaunay triangulation for a 2d box with say an airfoil inside. If I uniformly refine this mesh by subdividing each triangle in the mesh into 4 triangles by halving each edge, is the resultant mesh still delaunay? I have been assuming so, but I have no proof this is the case.
|
$A$ and $B$ are $n \times n$ matrices and $v$ is a vector with $n$ elements. $Av$ has $\approx 2n^2$ flops and $A+B$ has $n^2$ flops. Following this logic, $(A+B)v$ should be faster than $Av+Bv$.
Yet, when I run the following code in matlab
A = rand(2000,2000);
B = rand(2000,2000);
v = rand(2000,1);
tic
D=zeros(size(A)... |
I write a simple MATLAB code for solving solid FEM problem.
The problem looks like that
(1) (2)
x-------x
| / |
| / |
| / |
x-------x
(3) (4)
Each node has two degrees of freedom(DOF), which stand for $x$ and $y$ displacements.
Boundary condition
I want only constraint node 1's $x,y$ DOF and node ... |
I want to simulate human erythrocytes in capillaries. I calculated, that for a 1 meter long and 1 mm in diameter capillary there are about 3 billion blood cells.
Erythrocytes are actually discs, but let’s assume that it’s a simple cuboid. What do we have
Erythrocyte -> vertex[8] -> double x
... |
I am beginner in MATLAB and similar. I sow and discussed with my professors doing simulations some times: they wrote down a lot of calculus, most of them using Crank-Nicolson Method and so implement them on MATLAB.
Until now, I could not imagine that MATLAB has pdepe. Today I've learned about pdepe and try to code a PD... |
For the qr factorization using classic Gram-Schmidt algorithm, I found the 2 different implementations below. The first one uses the for loop to compute the upper triangular matrix R, but the second one uses the matrix-vector multiplication. Since they are mathematically equivalent, but they produce different results. ... |
I have a really big symmetric 7.000.000 X 7.000.000 matrix that i would like to invert. The matrix is extremely sparse and it can be rearranged as to become a block diagonal matrix. The biggest blocks are around 1500 X 1500 but most blocks are much smaller like 4 X 4. What is an efficient way to find the inverse? scipy... |
In quantum mechanics, the wavefunction of N electrons is given by a determinant. I am working on a Monte Carlo algorithm. At each Monte Carlo step, I need to add or remove an electron, which means adding or removing a line and a column to my matrix.
I use Gauss elimination to compute an upper triangle matrix. Adding a ... |
Here is an implementation of the sign function in C++ using Adolc librairy for automatic differentiation.
template<class Tdouble> Tdouble sgn(const Tdouble &x)
{
Tdouble s_plus, s_minus, half(.5);
// set s_plus to sign(x)/2, except for case x == 0, s_plus = -.5
condassign(s_plus, +x, -half, +half);
// set... |
What are some computationally efficient ways to solve matrix exponentials, i.e. functions of the form :
$f(X)=e^{X}$, where $X$ is a square matrix?
So far I have been able to diagonalise some matrices and find the exponent of individual diagonal elements, but not all matrices I'm dealing with will be diagonalisable.
I... |
So, I'm currently trying to implement a MCMC to uniformly sampling hyper-points from the polytope defined as $\mathbb{K}=\{x\in\mathbb{R}^{n}\;\;\text{s.t.}\;\; A\,x=b \}$ in the specific case where, given a generic linear transformation $A\in\mathbb{R}^{m\times n}$, $b\equiv0\in\mathbb{R}^m$ and the boundary condition... |
My system is a symmetric FE problem with lagrange multipliers:
$Z=\begin{pmatrix}A & C^T \\ C & 0\end{pmatrix}$
The matrix $A$ is positive semi-definite, non-invertible. The whole matrix is invertible.
I am working on the development of a finite element software where I want to solve such problems with PETSc in paralle... |
For a project in my advanced numerical method class I have to solve the 1D Kuramoto-Sivashinsky equation of which I know little. I just know that it was derived the equation to model the diffusive instabilities in a laminar flame front. It reads
$$
u_t + u u_x + \lambda u_{xx} + \eta u_{xxxx} = 0.
$$
Obviously I need ... |
For Householder transformation, we know that
$H = I-uu^T$, where $\|u\|_2=\sqrt{2}$. When it acts on any vector $x$, $Hx$ and $x$ is symmetric with respect to $span(u)^T$. But I have read a monography "Stewart. Matrix Algorithm I: Basic Decomposition, 1998, SIAM". It is written as follows on Page 257:
Combining these... |
The function $\coth(x) - 1/x$ has a removable singularity at 0.
Its Taylor series is:
$$
\coth(x) - 1/x = \frac{x}{3} - \frac{x^3}{45} + \frac{2x^5}{945} + \ldots
$$
I would like to evaluate the first 3 terms of the Taylor series
for $|x| \le \delta$,
and just do a straight calculation of $\coth(x)$ and $x^{-1}$ for ... |
A Fortran code that solves stiff PDE systems contains the following arrays of Rosenbrock-Wanner method coefficients:
parameter( ROWcc= 0.43586652150845900 )
parameter( ROWb1 =(/ 0.0021103008548132443, &
.88607515441580453, &
-0.32405197677907682, &
... |
For a project in my advanced numerical method class I have to solve the 1D Kuramoto-Sivashinsky equation.
$$
u_t + u u_x + \lambda u_{xx} + \eta u_{xxxx} = 0.
$$
As explained here I will solve it using a random initial condition on a periodic support with homogeneous boundary conditions at the inlet and the outlet. I w... |
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
float timedifference_msec(struct timeval t0, struct timeval t1) {
return (t1.tv_sec - t0.tv_sec) * 1000.0f + (t1.tv_usec - t0.tv_usec) / 1000.0f;
}
int main()
{
struct timeval t0;
struct timeval t1;
float elapsed;
int ** a = malloc(1000... |
I want to solve the following sets of $n$ coupled equations. Initial values of $x_{n}(t)$ and $p_{n}(t)$ are specified.
The problem is, I have an 1D lattice where every particle is bound with neighbouring particles using harmonic plus a slight nonlinear force depending on relative displacement of particles with the nei... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.