instruction
stringlengths
43
28.1k
For a computer with 8 GB of memory, which is the order of magnitude for the number of particles that could be used in a simulation. Is the answer $N=8/6\times 10^9$? or do the particles take up more memory than 6N(3N position +3N velocity)?
I'm solving coupled PDEs using finite difference method: Incompressible Navier-Stokes and the divergence-free induction equation (Maxwell's equations) with non-uniform electrical conductivity. The dimensionless equations are: $1) \partial_t \mathbf{u} + \nabla \bullet (\mathbf{u}\mathbf{u}) = -\nabla p + Re^{-1}\nabla^...
The following is related to a question a asked a few days back 1, but now I would like to focus on just one part of the problem. I have problems computing the integral over the reference element: $$ \int_{0}^1 (f - \Pi_h^1(f))^2 dx. $$ I think I understood how to use the basis functions on the reference element and wha...
In my efforts to write a code for a calculation I have encountered a problem of numerically differentiating a non-linear function at different points on a grid. I used the simple forward finite difference method to differentiate the function but the errors were huge in case when I know the analytical solution of the ca...
I am working on a flow physics problem (2D), which ultimately boils down to solving Eigen value problem. Even for a grid size of 60 x 60, the matrix in the Eigen value problem end up with 1260 million elements (This matrix has to be solved iteratively!). Sometimes the matrix is sparse and other times it is not dependin...
$$\frac{d^2 u}{dx^2} +A \frac{d^2}{dx^2}\left(\frac{du}{dt}\right)=B $$ I want to solve the equation given above. I need to first discretize it by the Method of Lines and then evolve the resulting ODE using a Runge-Kutta method. My question is, how can I reduce this special equation to two different ODEs?
Disclaimer : This question is related to computational science, but it is a purely a post-processing question so if this is on the wrong board, please tell me I would like to postprocess simulation results in an automatic way. Our current simulation software generates output in an ensight gold format. This means that f...
I've been trying to find a way to correlate data sets from two sensor types. In theory these measure the same signal. One is in a known format expressed in meters while the other is in numeric form read from a 24 bit value. If anyone could help me find a way to find the approximate meter value of these integer values I...
I am wondering if this is the right place to ask this question. I found a related question on stack overflow https://stackoverflow.com/questions/814312/physics-in-computer-science but it was closed. So I am asking my question on SE Physics. I am planning to study graduate level computational physics study. For example,...
I need to integrate a function along the edge of a quadrilateral (boundary integral). For example, the function is $f(x,y)=x^3+y^3$, the quadrilateral coordinates are $(0,0),(2,-1),(3,2),(1,3)$ and the concerned edge is the line joining $(2,-1)$ and $(3,2)$. So, the required integral is $$I=\int_{(2,-1)}^{(3,2)}x^3+y^3...
Let me first be clear that I'm still new to Julia. I need to plot time series data contained in an Excel file using Julia. So far I couldn't find any packages for that. The only workaround I found was to save the Excel as a CSV file and then plot the data using DataFrames and Gadfly. I know that this can be done easily...
I've written a simple legendre quadrature in MAPLE to compute the integral $\int_{-1}^1 r^2 dr = \frac{r^3}{3} |_{-1}^1=\frac{2}{3}$ restart; with(orthopoly): with(LinearAlgebra): legendre_quad := proc (n, digits) local i, s, w, location; w := Vector(n, fill = 0); location := Vector(sort([evalf[digits](...
I have the x and the f(x) for a set of x. I don't know the function, actually. This is sufficient to integrate it? The x value might span from 1 to no more than 50, usually around 10. While y is always negative and it's peak might pass -100. What's the simplest approach? x 0 1 2 3 4 5 6 7 8 9 y 0 -3 -5 -7 -5 -3...
I have a quadratic constraint of the form $$ x_1 x_2 \leq x_3 $$ where $x_1, x_2, x_3 \geq 0$. The objective is linear, and all other constraints are linear, too. I know that I can transform the product as $$ y_1=\frac{1}{2}(x_1+x_2) $$ $$ y_2=\frac{1}{2}(x_1−x_2) $$ $$ y_1^2−y_2^2\leq x_3 $$ But when it comes to the l...
I am trying out the arpack driver dsdrv1, which is used to iteratively obtain the first m eigenvectors from the eigenvalue problem. $$ \hat{A}\mathbf{x} = \lambda\mathbf{x} $$ As it is an iterative procedure, a good initial guess will reduce the number of iterations needed for convergence. One of the best initial guess...
I'm solving simple single-objective multidimensional global optimization problem using various stochastic algorithms like Monte-Carlo, GA and other evolutionary approaches. The task is formulated as follows: search space $X \subseteq R^n$ objective function $f: R^n \rightarrow R$ must find $\textbf{x}^*=\{x_1^*, ..., ...
I have a question as I am starting my dive into computational analysis. I have a large set of data (~2 months) which includes the room temperature, HVAC status (heat/cool/off) and the location of this room (I can find detailed information on outdoor temperature). I would like to do some analysis to find the following...
I am using OpenFoam to do an LES simulation. I am using mapped boundary condition on the inlet plane. I know it maps from a source plane to the target plane(here the inlet plane). In "Pitzdaily-mapped" tutorial, we only have "set average" and "average" options and there's no option for selecting the source plane. Can a...
I was wondering if there is any known way to compute the Charactaristic Polynomial P of a matrix A numerically stable in the sense of realizing the Cayley-Hamilton Theorem, i.e. that P(A)=0. I've found and implemented a couple of ways, but when the dimension of the matrix is even a few hunderds, P(A) is not even close ...
I'm trying to solve a nonlinear elliptic equation $$(n(u)u')' = f(u)$$ and have a crucial misunderstanding. I suppose the procedure of solving some nonlinear equation consists of: Choosing a proper approximation method (FEM, FVM, FDM etc.). Linearization of the resulting system of nonlinear algebraic equations. Choosi...
I am implementing an algorithm which produces a 4d mesh for a cylinder with a given 3d base. This means, I have a 3d mesh and I want to generate a 4d mesh for the corresponding space-time cylinder. Currently I am using netgen for 3d mesh. I am able to generate the 4d vertices and the new 4d elements (pentatopes). This ...
I'm using an iterative subspace algorithm (dsrrit) to obtain the eigenvalues of an eigenvector equation $$ -\nabla^2 \mathbf{x} = \lambda\mathbf{x} $$ where $\nabla^2$ is the usual Laplacian operator. The algorithm returns a set of eigenvalues $\lambda$ and a subspace $Q$ that spans the eigenvectors of $\lambda$. The l...
I'm trying to solve the following equation $$\dfrac{\partial}{\partial x}\left(e^{au}\dfrac{\partial u}{\partial x}\right) = 0$$ Of course, this equation can be solved analytically. I am trying to understand the way of working with exponential coefficients. For the approximation, I use the finite volume method which le...
I don't think this is a pure math problem, so I post it here. Assume we have two regions in $\mathbb R^n$: $$ \lbrace x : a \leq x \leq b \rbrace\\ $$ and $$ \left\lbrace x : \sum_{i=1}^n |x_i | \leq c \right\rbrace $$ The problem is to find the smallest possible cube that contains the intersection between the two reg...
I'd like to simulate the following problem: Define some square, horizontal and hard area onto which cylinders (aspect ratio R) sediment. Preferably, the source of cylinders sequentially generates N of these cylinders from a large distance above the plane. There is gravity. The cylinders are hard, if possible deformab...
I have a system of $n$ non-linear equations that I want to solve numerically: $$\mathbf{f}(\mathbf{x})=\mathbf{a}$$ $$\mathbf{f}=(f_1,\dots,f_n)\quad\mathbf{x}=(x_1,\dots,x_n)$$ This system has a number of characteristics that makes it particularly difficult to handle. I am looking for ideas on how to deal with the sys...
Is the marching triangles algorithm guaranteed to terminate (sucessfully)? The algorithm does roughly speaking: iterate over all boundary edges project a new point, add a new triangle from the edge and the point, if it's admissible (the new point does not intersect the circumsphere of any existing triangle) if it's no...
I'm researching numerical optimization. Recently I've come across a variant of a conjugate gradient method named fmincg. The function is written in MATLAB and is used in the famous Andrew Ng's course on Machine Learning on Coursera. According to the copyright notice, fmincg was written by Carl Edward Rasmussen. You ca...
In the finite element lecture we learned, that it is impractical to use centre of gravity of a triangle as a degree of freedom. So we defined a subspace $P_3'$, where $P_2\subseteq P_3'\subseteq P_3$ $$P_3'=\{p\in P_3;\ p(a_{123})=-\frac{1}{6}\sum_{l=1,2,3}p(a_l)+\frac{1}{4}\sum_{l,m=1,2,3,\ l\neq m}p(a_{llm})\}$$ wher...
Let $\Omega$ be a bounded open set in $\mathbb{R}^d$ where $d \geq 1$ is a positive integer, with Lipschitz boundary. Let $k,l$ be non-negative integers and $1 \leq p < \infty $ then if $k > l$ and $\frac{k-l}{d} > \frac{1}{p} - \frac{1}{q}$ then the Sobolev embedding $$ W^{k,p}(\Omega) \subset W^{l,q}(\Omega) $$ is c...
I have problem with volume loss in FLIP simulation. Unfortunately it's necessary to obey the CFL condition when using explicit integration methods (RK2 in my case) to advance particle positions using the Fluid Implicit Particle method, otherwise fluid volume gets lost over time (simulation becomes unstable). It turns o...
I am trying to solve a standard Poisson equation on image with Neumann boundary condition. The Poisson equation has the form: $Δp=b$ where $b$ is the divergence of the input image,which is as shown: I tried to write it in Matlab with centred finite difference method and Gauss-Seidel iterative method but the result tur...
I am trying to solve an equation by a meshfree method. Shape functions (and their derivatives) have a compact support domain. So, over a given integration cell used for numerical integration, only a small number of shape functions will have nonzero values. At the same time, for each integration point belonging to a cel...
Trying to find a way to solve exponentially nonlinear elliptic equation with complex source term i manage to know about such schemes like Godunov, Lax-Friedrich, MUSCL. I still seraching for literature about them. The main question is could this schemes do something with $$ \dfrac{\partial}{\partial x}\left(ce^{\varphi...
I have this MIP optimization problem, with couple of binary variables; however when I relax one of the binary variables the optimal solution of the objective does not change. But the solving time increase drastically. How could this happen? I noticed that this only happens for just when only I relax that specific varia...
I have a ''cosmetic'' problem with a singular term in my Matlab script. I am trying to solve the following system of differential equations: $$ \begin{aligned} y_1' &= y_2,\\ y_2' &= \frac{2y_1}{x^2}+k(y_1^3 - y_1) - \frac{2y_2}{x}. \end{aligned}$$ Where x is the independent variable of y and k is a constant. This syst...
Suppose we want to approximate a function $f: [a, b] \rightarrow \Re$ with a Chebyshev series: $$ f(x) \approx \sum_{k=0}^n c_k \, T_k\left( \frac{2x-b-a}{b-a} \right) $$ where $T_k(x) = \cos(k\, \cos^{-1}x)$ are Chebyshev polynomials of the first kind. There are two methods of finding the coefficients $c_k$ that make ...
I am solving a elastodynamics (vector valued elastic wave) equation. I create the 2D mesh in Gmsh discretised into triangular elements of second order. Therefore, it is my understanding that the element is a triangle with total six nodes, i.e., 3 vertices and 1 node on each of the 3 edges. I have the following question...
I looking for literature for $\mathbb{P}_k$ bubble enriched for finite elements.
Burgers' equation is a fundamental PDE used in various fields such as number theory, gas dynamics, heat conduction, elasticity, etc. It is crucial especially for developing numerical models for turbulence since nonlinear viscous Burgers' equation can be considered as an approach to the Navier-Stokes equations. It can b...
I have a linear system of the form $\mathbf{A}\mathbf{x} = \mathbf{f}$. If the length of the vector $\mathbf{x}$ is $N$, meaning that there are $N$ unknowns, then the matrix $\mathbf{A}$ has seven bands and the matrix is sparse. The matrix is not symmetric. It looks like this: $\pmatrix{a_1&a_2&a_3&a_4&&&&&&\\ b_1&b_2&...
I worked on a method based on this paper, "Gradient methods for minimizing composite functions". But unfortunately, every time I code it doesn't work. Even I investigate inequalities of the paper numerically, but I couldn't figure out what's the problem. Is there any matlab implementation of the paper available? I sear...
Is there a way in which Depth First Traversal will put a node into the stack more than once using the general algorithm as shown here. Also, is it compulsory for all nodes to be entered into the stack atleast once? Is there any case in which a node is not entered into the stack?
I'm trying to make a CFD model where I can place a source and a sink anywhere in a grid and get the fluid flow rate across each cell boundary between those locations. I'm starting simple with a 3x3 grid and solving continuity for each grid element, but that leaves me a few equations short (9 equations, 12 unknowns). ...
I am looking find a way of efficiently generating a random, undirected subgraph $G_s$ with $N$ vertices, using a subset of edges from an exisiting undirected graph $G$, also of size $N$, where the subgraph has only nodes with degree $k \leq k_{max}$. In other words, I want to create a new random graph with the same nu...
In advance I am sorry for my noobish question. I am a physics PHD student and basically I use python for my math/physics problems. But now I have a problem which requires more computing capacity and I intend to use Fortran or C and supercomputer. Those things are very new to me :). So my problem is: I have a system...
I am considering finite difference methods and their error analysis for solving HJB equation of the following form: $$ v_t=|\sigma(x)v_x|,\quad x\in \mathbb{R}, $$ where $\sigma$ is a given function on $\mathbb{R}$ (with possible regularity assumptions). Could you give me a simple (perhaps first-order) FD scheme and it...
Let $V_1,\ldots,V_n$ be $n$ vector subspaces of a Hilbert space, $y_i\in V_i$ for each $i$ and $\overline{x}$ be a fixed vector. I want to solve the optimization problem: \begin{equation*} \begin{aligned} & \underset{x_1,\ldots,x_n}{\min} & & \sum_{i=1}^n \| x_i - y_i\|_2^2 \\ & \text{subject to} & & \frac{1}{n}\sum_{...
I try to convolve a rectangle function in [-1/2, 1/2] with itself using fft. The convolution should be a tent shaped function, see figure below. The code is below. In the 3rd to last line I add /50 so it appears correct - I have no idea what the normalization factor should be. And my question is how to normalize the p...
I am considering solving HJB equation of the form $$ v_t=g(a(x)v_x),\quad x\in \mathbb{R}, t>0, $$ with initial condition $v(0)=v_0$. Here $g:\mathbb{R}\to \mathbb{R}$ is Lipschitz and monotone increasing. I hope to construct a scheme stable in $L^\infty$ norm. Here is what I tried. For the linear $g$, i.e. $g(p)=cp$ ...
Say that N is the number of nodes, E the number of elements and S the number of sides in a triangular 2D mesh. Is there a relationship that links these quantities, possibly taking into account that some nodes are boundary nodes (Nb) and some are interior nodes (Ni)? The answer can be restricted to Delaunay triangulatio...
I'm testing a Finite Elements code. To do this, i have created a simple one element quadrilateral mesh to verify the solution: This is a plane stress elasticity problem, and the local stiffness is computed through the following weak formulation: The problem data is the following: the resultant stiffness matrix and l...
Suppose I have a mesh consisting of a set $M$ of conformal elements that fill the region $R=[0,1]\times[0,1]$. Suppose that I also have a 2D shape $S\subset R$ whose boundary $\partial S$ is piecewise linear, but which is not necessarily convex nor necessarily simply connected. Without making any assumptions on the p...
I have a linear program of the form $$\underset{P,\;g}{\text{Minimize}}\hspace{3mm}c^Tg$$ \begin{align} \hspace{17mm}\text{Subject to}\hspace{3mm}AP_{\cdot,j}&=\begin{bmatrix} -g\\ d \end{bmatrix}\\ P_{ii}&=0\\ |P_{\cdot,j}|&\leq P_{\max}\\ g&\leq G_{\max}\\ g&\geq 0 \end{align} with variables: $g\in{\bf R}^k$, $P\in{...
I have a pretty naive question, though important to me. Usually when solving the following PDE in solute transport: $\frac{{\partial C}}{\partial t } = \nabla. (D\nabla C -vC )=0,$ one can be asked to use a third-type boundary condition (called flux in software like Comsol or Phreeqc): $(D\nabla C -vC )=vCo,$ where the...
I am attempting to model the following SDOF system with a variable spring and having a sinusoidal input, $$m\ddot{x}+(k_0+k_1)x = m(2\pi f)^2\sin(2\pi ft)$$ where $m$ is the mass, $k_0$ the original spring and $k_1 = k_0$ for $x\dot{x}>0$ and $k_1 = 0$ otherwise. I was able to code this in Matlab, but for low frequenci...
I have to solve the following equation for $x(i), 0 \leq i \leq 1$: $$ y(i) = x(i)^{-a} \int_0^1 y(j)x(j) dj \left(\int_0^1 \mathcal A(j) x(j)^{1-a} dj\right)^{-1} \int_i^1 \left( \int_0^x x(j)^{1-a} dj \right)^\frac{a+b}{a-1} A_i^{b - 1} dx $$ where $A_i$ and $y(i)$ are known and I use the short cut $$ \mathcal A(j) ...
I'm implementing a Finite Difference WENO5 with Lax-Friedrich flux splitting on a uniform, structured grid to solve the 2D Euler equations of fluid dynamics on a rectangular domain in cartesian coordinates. $$\frac{\partial U}{\partial t}+\frac{\partial F}{\partial x}+\frac{\partial G}{\partial y}=0$$ where: $$U = (\rh...
I'm using Python scipy.integrate.ode, and I want to stop my integration at a certain condition. So I use the integrator "dopri5" and use the method "set_solout" to specify a function for my stop condition. Unfortunately, in some cases, the program says my problem is stiff, and exits. (The message is "UserWarning: dopri...
I'm wondering what alternatives there are to a grid convergence study to judge solution accuracy for a given grid resolution when doing steady-state RANS simulations on an automatically generated complex unstructured co-located grid (using OpenFOAM). Ideally, such a criterion would lend itself to automatic grid refinem...
Given a feasibility problem with both inequality and equality constraints, I'm interested in the sensitivity of the bounds of the region to changes in the constraints. To help with answering the rather general question, I'm interested in particular for linear equality constraints with perturbations for Linear Non-line...
I am trying to solve the equation below numerically for various functions $I(x)$: $$ \frac{\partial^2}{\partial x^2} G(x) + I(x)G(x) = 0 $$ Subject to the boundary contitions: $$ \frac{\partial}{\partial x} G(x)\Big|_{x=0} = C_1 $$ $$ \frac{\partial}{\partial x} G(x)\Big|_{x=L} = C_2 $$ $$ \frac{\partial}{\partial x} G...
I would like to know which is the best way to integrate numerically Legendre polynomials. I am building up a Discontinuous Galerkin CFD code for which Legendre polynomials are used as basis functions in the spectral projection. In previous codes, I was used to employ Gauss-Legendre numerical quadrature, where only $k$ ...
I am using this matrix class here to assist me in converting this Least Squares algorithm that prices American options that is written in Matlab in C++. My question is pretty simple. I want to pass in a vector into a function but it has to be with this matrix class. For some reason, I get an error stating: cannot con...
looking to introduce a mathematics program in my work, I would have 2 uses: In a classroom (high school level), providing good visualisation of physics ideas, and making my lecture more interactive. An example is the Mathematica demonstrations project, or simple interactive plots. Symbolic computation, I work with non...
Consider $f(x)= \sum\limits_{n=0}^N a_n p_n (x)$, where $p_n$ are the Legendre polynomials. If one wants to differentiate $f'$ symbolically, i.e. to compute $$f'(x) = \sum\limits_{n=0}^{N-1} b_n p_n (x)= \sum\limits_{n=0}^N a_n p_n '(x)$$, he should be able to use the fact that the $p_n'(x)$ are well known for the Lege...
Consider $[0,1]$ with the Lebesgue measure $m$ and $f:[0,1]\to \mathbb{R}$, and $x$ a uniformly distributed random variable in $[0,1]$. Then, $f(x)$ itself define a new random variable. We can then define the Cumulative density function of $f$ as $$P_f (y) :\,= m(f^{-1} (-\infty, y)) \, ,$$ and its PDF as $$\rho _f (y)...
I wanted to generate LU decomposition of large size dense matrices ($N>10^7$), the LU decomposition I'm currently using is based on Adaptive Cross Approximation and is taking very long time to execute for larger $N$. Can anybody suggest a few LU decomposition techniques that can be very well parallelised (using OpenMP)...
Can the order of the local truncation error be higher than the order of global truncation error in a finite volume method?
I have a large dense matrix $A$. For simplicity in simulation purposes and application demand, I induced sparsity by replacing lower/insignificant values by zero and reordering it in block diagonal form e.g $\hat{A}$. How can I measure how much information I lost in this process? What property of matrix represents it's...
I am testing the ability of my integration method to reproduce results obtained analytically (for various values of the parameters), but the results turn out to be completely wrong and I can't find what's wrong with my code. As an example, for the parameter values below, $x_1$ is supposed to tend towards $40$ with time...
Going off of the answer here: sorting adjacency matrix by the Fiedler vector So here, Jesse the answerer plotted the first 3 eigenvectors associated with non-zero eigenvalues of the Laplacian against each other in order to see more distinguishable clusters. My 2 questions about this are: 1) Why did he choose specifical...
I want to numerically solve the advection-diffusion equation: \begin{equation} u_t(x,t) + cu_x(x,t) = v u_{xx}(x,t) \end{equation} for $x \in [0,1]$ and $t \geq 0$ subject to the boundary conditions $u(0,t) = u(1,t) = 0 $ and $u(x,0) = f(x)$. To compare the accuracy of the numerical solution, I will at first derive t...
I have implemented an ADER-Discontinuous Galerkin scheme for the resolution of linear systems of conservation laws of the type of $\partial_t U + A \partial_x U + B \partial_y U=0 $ and observed that the CFL condition is very restrictive. In the bibliography, an upper bound for the time step $\Delta t \leq \frac{h}{d(2...
Frame of the question I am currently editing an add-on module to an ocean/circulation model, which is written in Fortran. The code of the main model is quite optimized with respect to short run time (not with respect to readability of the code). There are some code parts in the add-on module that do not seem to be opti...
I'm not sure that this *overflow is right place to ask.... Sorry if it is off topic. Does anyone know a citation (scientific article or book) for a numerical trick (method), when we tabulate a right-hand side of given differential equation(s) and use an interpolation in between rows of the lookup table when we numerica...
I just searched around a bit for BLAS implementations and was amazed by the sheer amount of libraries around. Does someone know of a benchmark or otherwise rating of the various libraries? How easy they are to install. Performance. How easy they are to get to work with Octave or Matlab. I realize all of these would d...
I have just read yet another introduction to image processing, which describes Gaussian smoothing from a convolution perspective and least-squares smoothing from an optimization perspective. It would help me knit this knowledge together if I could imagine how I could also use optimization to obtain a Gaussian-smoothed ...
The lsqcurvefit solution in matlab converges at different solutions depending upon the initial guess: Surface represents the error (SSE) between model and data at various combinations of parameters p1 and p2. Red lines represent the path lsqcurvefit takes from initial guess of parameters to the solution marked with r...
I'm considering implementing (just for simplicity) the unconstrained implicit optimization based integration for Material Point Method as described in Chenfanfu Jiang's thesis on MPM (the minimization algorithm starts on page 101 – "A.3.1 Unconstrained minimization"). I have difficulties understanding how would be the ...
In all the sources I have that discuss the elasticity equations, they start by saying that the strain tensor, $\epsilon$, is related to the displacement gradient, $\nabla u$, where $u$ is the (vector valued) displacement as $$ \epsilon_{ij} = \frac{1}{2}\left(\frac{\partial u_j}{\partial x_i} + \frac{\partial u_i}{\par...
I'm trying to solve the phase problem from single intensity measurement. I implemented error reduction algorithm in Matlab for my problem but it does not give any result. Is there anybody uses this algorithm for phase problem?
I am searching for a good algorithm to solve problem 487 on project-euler. I dont want code or something like that, I only want the name of the algorithm thats best suited. Till now I think of either using Faulhabers Formula or using the stirling numbers of second kind to compute the sum. https://projecteuler.net/prob...
I have quadratic finite element - shape function is quadratic. Element spans from 0 to 5. Body force is given by (in physical coordinates) $$f_b = \int_0^5 N(x)^T b(x) dx \approx \sum_{i=1}^3 N(\xi_i)b_i(x)w_i $$ The last term is obtained from Gauss quadrature. $\xi_i$ are Gauss points and $w_i$ are corresponding wei...
I am trying to constrain an eigenvalue problem. I am aware of the method utilizing the nullspace of the constraint vectors but I was wondering if it would be to use a penalty method for the same purpose. Trying the following at MATLAB/Octave r = rand(4,4); r=r' + r; p=[1, 0, 0 , -1]'; w=10000; [V, D] = eig(r + w*p*p')...
I'm a bit confused about the concepts of convergence rate and convergence order. Let me first give you the definitions we use: [sorry for the English, it's all self translated] Let $x^{*}$ be our solution. Definition 1: The sequence $x^{(k)}$ is called linearly converging towards $x^{*}$, if $$\exists L<1 \text{ so tha...
I don't fully understand the subsection 3.2 Constrained minimization of this paper. In particular, I don't understand the first step "Register active set" and the definition of projection $P(x)$. Simplified algorithm (stripped-down version of the paper's one): Select initial guess and project it: $x^{(0)} = P(x'^{(0)}...
this is a follow up question to Convergence rate vs convergence order I guess the whole confusion about how rate vs. order of convergence also came from the implementations I saw. For example, for fixpoint iteration, I saw this: [was part ofa fixpoint iteration] #Function to calculate order of convergence def konvord...
I'm looking for the SCAT (Symbolic convex analysis toolkit) for Maple written by Hamilton and Borwein. I have seen some references in the specialized literature than mention some urls. However, the links are dead. References Borwein, J.M. & Hamilton, C.H.: Symbolic Fenchel Conjugation. Math. Program. (2009) 116: 17. ...
i have to decide if the following differential equation is stiff: $$y''(t)=-201y'-200y^2 + 2, \quad t\in[0,20].$$ Sadly, I don't have any solutions. So, what I did was implementing explicit and implicit euler and look at the result for various step sizes. from numpy import * from scipy import optimize rhs = lambda z: ...
I'm writing a code in C++ to parse abaqus/calculix input file for 2D plane stress problems. I'm not a user of abaqus/calculix but I noticed that the input file doesn't ask complete boundary details. If there is a loading/displacement boundary condition then we need to specify the corresponding boundary element otherwis...
I am new to the field of computational physics and have a couple of questions regarding solving the non-linear Schrödinger equation using Operator splitting. 1) If the hamiltonian is of the form $H=\frac{\partial^{2}}{\partial x^{2}}+\gamma|\psi|^{2}$ then the standard procedure I understand is to exponentiate $-i(\gam...
I'm working on some c++ code to solve (conjugate gradient, least squares conjugate gradient, LSQR,..) large sparse overdetermined systems of linear equations. There is a twist to my matrices and the system they're running on, that's why I code the solver myself. For testing, debugging and benchmarking purposes I'm look...
I am trying to numerically evaluate a Greens function for this equation: $$ \left[\frac{\partial^2}{\partial x^2} + f(x) \right] G(x) = \delta (x-x_0) $$ With Neumann boundary conditions. Here, the function $f(x)$ is known. The difficulty in solving this lies in the numerical approximation of the $\delta$ function. Ra...
I know that the piecewise linear finite element approximation $u_h$ of $$ \Delta u(x)=f(x)\quad\text{in }U\\ u(x)=0\quad\text{on }\partial U $$ satisfies $$ \|u-u_h\|_{H^1_0(U)}\leq Ch\|f\|_{L^2(U)} $$ provided that $U$ is smooth enough and $f\in L^2(U)$. Question: If $f\in H^{-1}(U)\setminus L^2(U)$, do we have the ...
In computation of the solution I achieve a solution with nice precision and small number of nodes but the condition number of the matrix is very large. I am confused. Is it possible to have a large condition number with a good precision? The condition number is $10^4$ and it increases as the number of nodes increses an...
I need to write a report about some image processing topic. I want to describe some kind of density, e.g: $\rho = \frac{\text{voxels with greyvalue 128}}{\text{number of voxels}}$. Is there a common way how to describe this in a more mathematical sense? I would use for example the cardinality symbol and define some fun...
I am trying to teach myself the basics of FEM but am having trouble with the the manipulations involved. For instance, Example 5.5 of Hutton's "Fundamentals of Finite Element Analysis" provides a worked solution of $$x{d^2y\over dx^2}+{dy\over dx} -4x=0 \qquad 1\le x \le 2 \qquad y(1)=y(2)=0$$ using a hat-type trial f...
Assume a function $M(t)$ strictly increasing, essentially growing exponentially, and asymptoptically growing at a known rate $\bar{g}$, i.e. $\lim_{t\to\infty}M'(t)/M(t) = \bar{g}$ In a set of awful integro-differential equations, I need to use the inverse of $M(t)$, denoted by $q(\cdot)$ for simplicity, i.e. $t = M^{...
Problem description: I want to numerically solve system of two time-independent partial differential equations (pde) of the following simple form $$\frac{\partial u(x,y)}{\partial x} = f_1(x,y,u),$$ $$\frac{\partial u(x,y)}{\partial y} = f_2(x,y,u),$$ where $u(x,y)$ is the unknown we want to solve for, $x$ and $y$ are ...