instruction
stringlengths
43
28.1k
A lot of my own work revolves around making algorithms scale better, and one of the preferred ways of showing parallel scaling and/or parallel efficiency is to plot the performance of an algorithm/code over the number of cores, e.g. where the $x$-axis represents the number of cores and the $y$-axis some metric, e.g. w...
In Multigrid, using Poisson's equation, does the equality below always hold regardless of what type of boundary conditions you use? $$ R= c\cdot I^T, \text{ for some constant }c $$ where $R$ and $I$ are the restriction and interpolation operator. Why or why not?
I am trying to understand an extra terms that appears when I derive the drift-diffusion equations for semiconductors. The extra term (see below) comes from applying the chain rule to the advection term. The extra term behaves as a source term, however, I can't justify its physical meaning. I think the semiconductor tra...
I know from "Numerical Methods for Conservation Laws" by Randall J. LeVeque that there is an implication chain of properties of methods for conservation laws: monotone $\Rightarrow$ $L^1$-contractive $\Rightarrow$ TVD $\Rightarrow$ monotonicity preserving For the conservation of mass, positivity preservation is most im...
I was looking at this wikipedia page: http://en.wikipedia.org/wiki/Finite_difference_coefficient It is a lists of higher order finite difference approximations, is there any negatives in using these apart from the extra calculations that they require to solve.
I have the following algorithm given: Input: Regular Matrix $A \in \mathbb R^{n,n}$ Output: LU-Decomposition of A = LU for k = 1, . . . , n do for j = k, . . . , n do $r_{kj} = a_{kj} − \sum_{i=1}^{k-1} l_{ki}r_{ij}$ end for for i = k + 1, . . . , n do $l_{ik} = (a_{ik} − \sum_{j=1}^{k-1} l_{ij}r_{jk})/r_{kk}$ end f...
Hi All, I posted this on the math.se site, but this may be a better location. I need a method of finding the maximum of a real valued trigonometric polynomial where I can trade accuracy for speed. The accepted answer to this question: https://mathoverflow.net/questions/35538/the-maximum-of-a-real-trigonometric-polynomi...
I am presently working on solving very large symmetric (but not positive definite) systems, generated by some certain algorithms. These matrices have a nice block sparsity which can be used for parallel solving. But I can't decide whether I should be using a direct approach (like Multi-frontal) or iterative one (precon...
I'm trying to solve a system non linear-equations: $$ \frac{\partial K(\mathbf{\lambda})}{\partial \lambda_i} - c_i = 0 $$ for $i = 1, \dots, 15$, using Newton's method: $$ \lambda^{k + 1} = \lambda^k + p^{k+1} $$ $$ p^{k+1} = - J(\lambda_k)^{-1} \big (\nabla_\lambda K(\lambda_k) - \mathbf{c}\big ). $$ I know that the ...
in matlab, both linsolve and mldivide are used for solving a system of linear equations, in all of determined, overdetermined and underdetermined cases. Reading their documents, I was wondering what differences are between them? Are they using almost the same algorithms of matrix factorization and triangularization in ...
Most numerical methods for quadrature treat the integrand as a black-box function. What if we have more information? In particular, what benefit, if any, can we derive from knowing the first few derivatives of the integrand? What other information might be valuable? For derivatives in particular: error estimates for...
How would I find the definite integral (between any 2 limits, say a and b) of the absolute value of sin(x)? I can calculate for the interval 0 to Pi, and from 0 to 2*Pi, but what if the user enters a value far outside 2*Pi? Could I create a while loop? EDIT: Here is a look at my code and its purpose. I have left my ana...
Do the ellipsoid methods belong to the trust region methods? Reading their descriptions I tend to think the idea of the ellipsoid methods belong to the idea of the trust region methods, but am not sure if I am correct. What are their relations and differences then? Thanks and regards!
I'm writing finite-difference method program using C. The stiffness matrix is symmetrical and band. For its storage I'd like to use Sparse Diagonal Storage format. Could someone tell please, what solvers can use diagonal storage format? Intel MKL's Paradiso uses only CRS-format, SparseLib doesn't have, Spooles seems al...
I read this post, "Conservation of a physical quantity when using Neumann boundary conditions applied to the advection-diffusion equation" and although it is the same type of equation it does not fit my problem. I try to solve the following equation with a no flux boundary with the solver d03pf from NAG. Should not be ...
I was trying to solve a linear system: $$ \mathbf{A}\mathbf{x} = \mathbf{y} $$ but the conditioning number was quite bad (around $10^{17}$). I thought that the system was singular, but after scaling the system using the diagonal matrix: $$ \mathbf{D_{ii}} = 1/\sqrt{\mathbf{A_{ii}}} $$ and the fact: $$ \mathbf{A}^{-1} ...
I have this confusion related to P and NP problems. Why is P a subset of NP? I didn't get it. P problems can be solved in polynomial time. However, NP problems cannot but only verify if a solution is correct of not in polynomial time. Then how come P is subset of NP?
For certain applications, such as steady state heat transfer and flow in porous media, it is possible to simulate a much larger (infinite) domain by imposing periodic boundary conditions on opposite boundary faces and dirichlet bc's on the remaining boundaries. For a 2D rectangular domain, the periodic condition can b...
I am a bit confused why the 0-1 loss function is not convex. What's wrong with it?
I have three questions regarding WENO schemes 1) How to actually compute the smoothness indicators $\beta_j$ for required order of polynomial? Any reference which explains the algorithm will be helpful. The formula for $\beta_j$ is given by equation (2.61) of this paper. 2) How to obtain modified wave-number plots (as...
I'm trying to localize points I see in a camera image in terms of azimuth and elevation and match points between shots. Individual shots should differ only in rotation around the camera's center (roughly). It's not working (as I'll explain below), and I'm looking for things I might be doing wrong. I've tried different ...
I need to find all the roots of a scalar function in a given interval. The function may have discontinuities. The algorithm can have a precision of ε (e.g. it is ok if the algorithm doesn't find two distinct roots that are closer than ε). Does such algorithm exists? Could you point me papers about that? Actually, I ha...
Precisely the title of the question. I have encountered these terms in two areas: conjugate gradient method, and adaptive finite elements.
I'm interested in suggestions for book references on the subject of numerical PDE and ODE, in particular, a rigorous analysis of such methods in a manner written for professional mathematicians. It does not have to be extremely comprehensive in the sense of listing hundreds or thousands of different methods, but I woul...
What is the current state of research on the existence of incomplete cholesky factorizations (in the context of preconditioning) for symmetric positive definite matrices? I wonder in particular whether the question of existence is settled for finite element mass matrices.
I'm learning about numerical methods to obtain the eigenvalues of a system. I have to find the eigenvalues for the time-independent Schrödinger equation but I'm having some difficulties understanding the real problem. I was told to consider a 2D potential box (what's this? never heard about this before). The domain is ...
I have a situation where I am trying to maximize the distance between some point particles. For example, I have a periodic simulation box that is 100 Å$^3$, and I am putting in 361 particles. Ideally, the radial distribution function will be zero up until a particular r, at which point it should jump to some particul...
On page 3 of this document, there are some matrix forms for sparse matrices. I wonder if there are other forms used in computational problems encountered in physics, chemistry, etc., so that reordering the matrix will speedup the computation phase. Preprocessing overhead for matrix reordering should be amortizable via ...
I develop a parallel time-domain DAE simulation software using OpenMP and Fortran 2003. The main algorithm is: while t<time_horizon do X_1=X while not converged do !$OMP PARALLEL DO Solve sub-domain DAE using a portion on X and X_1 to get DeltaX Correct X=X+DeltaX !$OMP END PARALLEL ...
Briggs, "A Multigrid Tutorial" (pg. 35) has the following expressed as 2-D interpolation: \begin{align*} v^h_{2i,2j} &= v_{i,j}^{2h}\\ v^h_{2i+1,2j} &= 0.5\cdot(v_{i,j}^{2h} + v_{i+1,j}^{2h})\\ v^h_{2i,2j+1} &= 0.5\cdot(v_{i,j}^{2h} + v_{i,j+1}^{2h})\\ v^h_{2i+1,2j+1} &= 0.25\cdot(v_{i,j}^{2h} + v_{i+1,j}^{2h} + v_{i,j...
I'm wondering if anyone can point to a browser-based FEM (or other) 2D PDE solver for simple elliptic problems. It seem like there ought to be a javacript implementation that would allow for the drawing of simple geometries, the creation of simple Dirichlet boundary conditions, and the imposition of simple right-hand-s...
I have a 3 dimensional convex polyhedron whose vertex coordinates are rational. For one of these vertices, I would like to find the nearest integer grid point (under the Euclidean metric) that is contained within the polyhedron. The polyhedron can be specified by a collection of inequalities, or as a collection of vert...
Experiment description: In Lagrange interpolation, the exact equation is sampled at $N$ points (polynomial order $N - 1$) and it is interpolated at 101 points. Here $N$ is varied from 2 to 64. Each time $L_1$, $L_2$ and $L_\infty$ error plots are prepared. It is seen that, when the function is sampled at equi-spaced po...
I need to solve a very large O(10^10) linear selection problem in a distributed memory machine, is there any library that will solve it for me? In shared memory machines, e.g. std::nth_element does it in average O(n) but deterministic O(n) algorithms also exist. I could live with something worse as long as it's easy t...
Several families of methods exist for numeric quadrature. If I have a specific class of integrands how do I select the ideal method? What are the relevant questions to ask both about the integrand (e.g. is it smooth? does it have singularities?) and the computational problem (e.g. error tolerance, computational budget...
I managed to display the coordinates of x,y and z into a 3D mesh by using delaunay function. The coordinates are in .obj format actually and i have read it into matrix form. Now, i would like to extract certain features / regions from the 3D mesh, reconstruct a new mesh and get the coordinates of it (I would like to ex...
I need to compute a closest point on a nonconvex polyhedron to a given point in 3D space. I need a simple algorithm or library. I search in CGAL but did not find a suitable function and the package is very complicated. I also looked on Mauch's CPT (it does not compile) and gts-cpt (the result is not correct). I do not ...
I'm an engineer and I'm planning to get a bigger toolbox than Excel to solve difficult problems. I started learning Python (as that seems the script language to go for math intense jobs, and runs in the background of many applications) and plan to take a deep look at Sage and Ascend, as those seem to be two good free p...
I have the following dataset that I need to display on the heat map: [30, 15, 66, 7, 9999, 78, 42, 132] So if I map the values to the color scale using a linear function I only see the spike while the rest of the values I cannot tell apart because the difference between them is insignificant in the scale of that spike....
I am currently learning a code which utilizes Scharfetter-Gummel discretization for unsteady drift-diffusion equations. For this scheme, a 2D unstructured triangular mesh is used, with the unknowns located at the vertices of the mesh. Cells are then constructed by perpendicular lines bisecting the chords between vert...
Thomas algorithm can be used to solve a tridiagonal matrix: $$ \begin{bmatrix} {b_ 1} & {c_ 1} & { } & { } & { 0 } \\ {a_ 2} & {b_ 2} & {c_ 2} & { } & { } \\ { } & {a_ 3} & {b_ 3} & \ddots & { } \\ { } & { } & \ddots & \ddots & {c_{n-1}}\\ { 0 } & { } & { } & {a_n} & {b_n}\\ \end{bmat...
I'm a high school student interested in computational science, and I would like to learn more about it. This year I took AP Computer Science for that reason, but except for some very basic gambling stuff we didn't really do any modeling or simulation. Can one of you kind sirs/madams please point me towards a good intro...
The motivation for my question is the following: in one of Project Euler questions there is a need to count the spanning trees of a rectangular grid graph of dimension 100x500. By the Matrix-Tree theorem this number is equal to the determinant of the matrix obtained by taking the graph Laplacian and deleting its first ...
I use OpenFOAM for CFD simulations. A very popular preconditioner is GAMG which needs a low number of iterations per a time step in SIMPLE or PISO solvers that are used to simulate the fluid flow. I would like to understand how GAMG prepares the internal structures. Does it create the internal data structures used in ...
I tried to make the question as detailed as possible. I have an extremely simple solver written for the Schroedinger equation but with imaginary time, which transforms it basically into the diffusion equation (with a potential term). The method is pretty well documented on this page, and I basically followed the steps ...
Consider a scalar field $u$ on an unstructured triangle mesh which is constant on each face. Let $A_i$ be the area of triangle $T_i$, $N(i)$ the set of triangles sharing an edge with $T_i$, and $L_{ij}$ the length of the edge between $T_i$ and $T_j$. I want the simplest possible spatial discretization of the heat equ...
Printing photo matrices (x,y,z) where z is 0:2 colour, I want to see (x in rows, y in columns) 3 times, once for each colour (the way I've been taught by every mathematician). By default, numpy does it last dimension first.
I've reading up on the numerical sign problem, and how a general solution is NP-Hard. I can't seem to find a proof of this, though. Does anyone know where I can find a proof that the numerical sign problem is NP-Hard?
I have a problem by solving stokes flow in 2D by finite differences. I am using a marker and cell method, my scheme is o-------vx1.1-------o-------vx1.2-------o | | | vz1.1 P1.1 vz1.2 P1.2 vz1.3 | | ...
Currently, I fit a Finite Element solution of a PDE on a spectral basis. The matrices ($R^{25000\times 2000}$) of the corresponding system of linear equations are highly ill-conditioned ($\kappa \approx 10^{15}$). However, I am able to find a solution with Tikhonov-regularization, which has also a small residuum on oth...
I'm looking for alternatives to Matlab/Simulink and Dymola for simulating a non-linear dynamic system. I know it's possible to implement the time-domain behavior without a lot of code and a good simulator template which would do fixed-step simulation, but I don't want to re-invent the wheel. I'm basically looking for a...
I'm looking for literature on the progression (year on year, or more fine-grained if possible) of Molecular Dynamics simulation sizes. By simulation size I mean number of atoms, time step, total simulation time and the architecture it was executed on. Bonus points if anyone knows of a similar database/list for consume...
The primal problem is $$\min_{w,b}\frac{1}{2}w^Tw$$ $$s.t. f_i(w)=1-y_i(w\cdot x_i+b)\leq0$$ Where $y_i=\pm1$. Instead of using Gradient Descent directly, the dual is usually solved: $$\max_{\lambda}\min_{w,b}\frac{1}{2}w^Tw+\sum_{i=1}^M{\lambda_i(1-y_i(w\cdot x_i+b))}$$ $$s.t. \lambda_i\geq0$$ Why not solve the primal...
I'm implementing a very simple Susceptible-Infected-Recovered model with a steady population for an idle side project - normally a pretty trivial task. But I'm running into solver errors using either PysCeS or SciPy, both of which use lsoda as their underlying solver. This only happens for particular values of a parame...
When solving $Ax=b$, prior knowledge about $A$'s structure can help in designing an efficient solver which exploits this information (e.g conjugate gradient method is to be used when $A$ is symmetric and is preferable to GMRES when we know $A$ is so ) For the set of non-linear equations I am working with, I am using...
Do CPLEX or Gurobi handle MIQPs with indefinite coefficient matrices? The problem I am dealing with has quadratic terms in which one variable is binary and the other variable is continuous. The coefficient matrix of the quadratic form is far from positive semi-definite. Its entries are data-dependent. Thus, I have no c...
I am trying to derive the formula of the 4th order Padé scheme that passes through the points $x_i$, $x_{i-1}$ and $x_{i+1}$ $$\Big(\frac{\partial\phi}{\partial x} \Big)_i = -\frac{1}{4}\Big(\frac{\partial\phi}{\partial x} \Big)_{i+1}-\frac{1}{4}\Big(\frac{\partial\phi}{\partial x} \Big)_{i-1} + \frac{3}{4}\frac{\phi_{...
I need to use GMRES solver in MATLAB, and I need to play around with the codes parameters and I had a very simple question about its usage. The documentation of the solver here mentions a parameter tol which they do not seem to have defined except that the defuault value is $10^{-6}$. What is this number? There don't...
I am working with an octree mesh where variables are stored in a collocated fashion at octant centers. I want to construct a lookup table for interpolation weights that may occur using only a cell and it's immediately adjacent neighbor leaf cells. There are a specific number of neighbor configurations since each neighb...
Consider 2 mathematical problems: $$ f_1(x) = a - x \\ f_2(x) = e^x -1 $$ The condition number for a function is defined as follows: $$ k(f) = \left| x \cdot \frac{f'}{f} \right| $$ Lets analyze conditioning first: $$ k(f_1) = \frac{x}{x - a}, $$ which means that $f_1$ is ill-conditioned near $x = a$; $$ k(f_2) = \frac...
This program finds the first root of the function f, defined in the code. There are 5 roots of this function. (x=1,2,3,4,5) I wish to find all of the roots in this program and print them to the screen. In the main function, you can see that I have attempted to write a while loop to do this(commented out in the code bel...
Like the title says, I want to be able to stop the code at a specific location and have it halt safely. I cannot find a command to do it like for example in FORTRAN there is the stop command.
I noticed that adding constraints to an IloModel one by one can be prohibitively slow. (I am referring to the construction of the model, not the optimization.) Suppose I have many constraints with the same number of variables, can I add the constraint matrix in one function call? Are there other ways to speed up the co...
Given an undirected graph, is it possible to find a criteria that leads to a unique partition of the nodes? The graph is not weighted.
I recently read something that talks about DIST distribution strings. It appears to be a way to take a long string of previously generated numbers and somehow compress them into a string that can then be used by others. I believe it's lossy. I'm having a great deal of trouble finding out anything other than some gen...
I have a large system of equations $$Ax=b$$ and I know matrix $A$ and right-hand side vector $b$. I'm using MKL to solve this system. The matrices are complex. I have used the general solver ZGETRS (Intel MKL zgetrs) which needs the matrix input in LU decomposition. So I have used ZGETRF (Intel MKL zgetrf) that perfor...
How can I represent the calculation in this image mathematically? For example, with the discrete convolution (and Fourier Transform?), $$(f * g)[n]\ \stackrel{\mathrm{def}}{=}\ \sum_{m=-\infty}^\infty f[m]\, g[n - m]$$
I read some references including this. I am kind of confused what optimization problem compressed sensing builds and tries to solve. Is it $$\begin{array}{ll} \text{minimize} & \|x\|_1\\ \text{subject to} & Ax=b\end{array}$$ or/and $$\begin{array}{ll} \text{minimize} & \|x\|_0\\ \text{subject to} & Ax=b\end{array}$$ or...
Following regularized minimization problem $$\min f(x) + \lambda g(x)$$ where $\lambda>0$, and following constrained minimization problem $$ \min f(x) $$ s.t. $$ g(x) \leq \epsilon $$ where $\epsilon>0$, can be converted to each other so that they have the same solution. Examples are a $l^1$-regularized linear least ...
Given an unknown function $f:\mathbb R^d \to \mathbb R$, we can evaluate its value at any point in its domain, but we don't have its expression. In other words, $f$ is like a black box to us. What is the name for the problem of finding the minimizer of $f$? What are some methods out there? What is the name for the prob...
I'm currently learning about using linear and semidefinite programming to find sparse solutions to problems. In particular, finding sparse solutions where the sampling functions are sinusoidal (Dirichlet kernel). I've implemented a linear programming solution with a discrete approximation using l1magic MATLAB library, ...
I was wondering what differences are between the terminology: "least square (LS)" "mean square (MS)" and "least mean square (LMS)"? I get confused when reading in Spall's Introduction to Stochastic Search and Optimization, section 3.1.2 Mean-Squared and Least-Squares Estimation and section 3.2.1 Introduction and sectio...
I apologize if this is a naive question. I'm trying to create some boostrap data for a system of linear, ordinary differential equations at steady state. Since the equations represent the concentration of chemical species, X has to be positive. Further, I'm trying to find the sparsest possible matrix of A, for the sa...
Here is some code that hopefully clearly illustrates what I'm doing: >>> sp.linalg.eig(d)[0].real; sp.linalg.eigh(d)[0]; d; sp.linalg.eig(d)[1]; sp.linalg.eigh(d)[1] array([ 1., -1.]) array([-1., 1.]) matrix([[ 0, -1], [-1, 0]]) array([[ 0.70710678, 0.70710678], [-0.70710678, 0.70710678]]) array([[-0...
C++11 introduces move semantics which can, for example, improve code performance in situations where C++03 would need to perform a copy construction or copy assignment. This article reports that following code experiences a 5x speed up when compiled with C+11: vector<vector<int> > V; for(int k = 0; k < 100000; ++k) { ...
For a little project I'm working on, I am trying to generate a wavefunction basis set I can use in Quantum Monte Carlo (DMC to be specific). Preferably, it would be a linear combination of Slater determinants with a Jastrow term. However, my problem is that I don't want a pseudo-potential or any sort of electron distr...
I would like to find the analytical form of the point which minimizes the following function: $$ f(x_T) = \frac{1}{T} a_1 (x_T-x_0)^2 + a_2 |x_T-x_0| + T a_3 + \sum_{i=1}^M p_i \left[b_{1i} (x_T - l_i)^2 + b_{2i} |x_t - l_i| + b_{3i} \right] $$ where $T,a_1,x_0,a_2,a_3,p_i,b_{1i},l_i,b_{2i},b_{3i}$ are constants, $T,a_...
How do I approximate the condition number of a large matrix $G$, if $G$ is a combination of Fourier transforms $F$ (non-uniform or uniform), finite differences $R$, and diagonal matrices $S$? The matrices are very large and not stored in memory and are only available as functions. In particular, I have the following ma...
We're all familiar with the many computational methods to solve the standard linear system $$ Ax=b. $$However, I'm curious if there are any "standard" computational methods for solving a more general (finite dimensional) linear system of the form $$ LA=B, $$ where, say, $A$ is an $m_1\times n_1$ matrix, $B$ is an $m_...
Sometimes while optimizing code it is required to time certain portions of the code, I have been using the following for years but was wondering if there is a simpler/better way to do it? call system_clock(count_rate=clock_rate) !Find the time rate call system_clock(count=clock_start) !Start Timer call do_somethin...
I've been reading about the algebraic multigrid algorithm and came across polynomial smoothers in this paper. It's my understanding that usually the coarse-level matrices $A_H = I_h^HA_hI_H^h$ are formed explicitly. However, there's still the issue of how to define the coarse space corresponding to a given smoother. Th...
I'm doing some machine learning where I have lots of data and through optimization I'm trying to learn the weights for the model. I'd like to check that my learning actually works correctly. For that I can create a set of known weights. My question is from these weights, how can I create synthetic data? On this data I ...
I am running my Fortran 95 numerical codes, whose structure is most times easily parallelized by little more than simply adding the corresponding OpenMP instruction before some critical DO sentences, in a dual-core multi-thread CPU Intel CORE i3. Ubuntu "sees" four CPUs (obviously since there are 2 cores, each of them ...
Simulation type: I'm running a simulation with the OOMMF micromagnetics package http://math.nist.gov/oommf/ where are magnet is represented by a mesh of 3 million cells, it gets excited by a magnetic pulse, the single cells oscillate and data output for every cell is x, y, z direction and absolute magnetic field value...
Consider a continuous Markov chain $X=(X_t)$ on a finite state space and let $Q$ be the (given) transition rate matrix. This matrix is very sparse, with non-zero values on 3 diagonals only (so from each state, there can be transitions to 2 other states only). Let $P_t$ be the transition probability matrix, so $P_t(j,k)...
I've coupled a COMSOL model for fluid dynamics with a very simple pde that model the transport of humidity in air. When I solve it for the stationary case, the solution converge easily, but when I try to solve the time dependent problem, the solution can't reach convergence. This seems very strange to me, the fluid i...
I was reading thispaper related to kernel SVM. It states Support Vector Machine (SVM) (Cortes and Vap- nik, 1995) as the state-of-the-art classification algo- rithm has been widely applied in various scientific do- mains. The use of kernels allows the input samples to be mapped to a Reproducing Kernel Hilbert S- pace ...
I'm trying to make highly efficient CFD programming complex for solving combustion problems. I've finished writing core which realises mathematical model, and now I'm concerned about code performance. Combustion problems are very computationally expensive, with no doubt I'll have to make parallelization of my code, but...
I'm developing some larger code to perform eigenvalue computations of huge sparse matrices, in the context of computational physics. I test my routines against the simple harmonic oscillator in one dimension, since the eigenvalues are well known analytically. Doing so and comparing my own routines to SciPy's inbuilt so...
By "the simplest" I mean the simplest to learn and implement from scratch. I hope my question can more or less be answered.
I have run the molecular dynamics (MD) code GROMACS on a Ubuntu Linux cluster consisting of nodes containing 24 Intel Xeon CPUs. My particular point of interest turns out to be somewhat sensitive to floating point arithmetic precision, so I have had to run GROMACS in double precision rather than single precision -- de...
I found this method in this book for solving the Poisson equation with error converging with $\mathcal{O}(h^4)$. However, when I try to implement it for the 1D equation $-u''(x)=f(x)$, it only converges with around $\mathcal{O}(h^2)$. The math is as follows: Using Taylor Series, we get $$\frac{1}{h^2}[-u_{i-1} + 2u_i -...
I came across the following task recently: Use the von-Neumann stability analysis to investigate the stability of the discrete form of $\frac{\partial c}{\partial x} = \frac{\partial^2 c}{\partial y^2}$. Use the first-order forward finite difference for the first-order derivative and the usual central difference schem...
This question is a follow-up to Fortran: Best way to time sections of your code?. If I want to time functions in my code, I know I could use gprof or kcachegrind. I also know that the results from these tools can be skewed (see http://www.yosefk.com/blog/how-profilers-lie-the-cases-of-gprof-and-kcachegrind.html and htt...
I have a $53534\times 3$ matrix with $x$, $y$, and $z$ coordinates. I want to find the element of matrix within ranges as follows: % coordinate range; x1(x<-25|x>0); x2(x<0|x>25); y1(y<-40|y>0); y2(y<0|y>40); z1(z<45|z>0); z2(z<0|z>82); and insert them into a new matrix, so that it becomes point1=[x1, y1, z1]; point2=...
I am considering two equations $$u_t=a(x)u_{xx}$$ and $$v_t=b(x)v_x$$ as classical representatives of the parabolic and hyperbolic family of equations. If $a(x)=a$ and $b(x)=b$ were constants, to show stability of any finite difference scheme I use for those equations, I could use the Fourier or so called Von Neumann s...
This is a follow up to the question about the method of frozen coefficients. I think it deserves to be a separate question. The frozen coefficient problems are obtained by fixing the coefficients of the variable coefficient problem. For example, consider pde $$u_t=a(x)u_{xx}, x \in \mathbb{R}, u(0,x)=u_0(x)$$, then at ...
I am using the Dakota Optimizer. I have 50+ variables, 50+ constraints and more than one objective function. Independent of the actual optimizer used, or the output selected: Is there a way to plot the objective functions while the optimizer is running? Dakota offers a graphical output, but this shows a combined obje...
I was assigned a project in my intro to computer programming class. The goal is to implement a numerical model to some engineering or physics/science problem. The course uses Java. An example might be a soccer ball's flight. I'm looking for something a little bit more interesting than just modeling gravity, air drag,.....
I have a Kalman Filter based modelling code that I have developed for a near-real time regional ionospheric mapping application. The code assimilates data from different sensors into a map (described by a set of basis functions) using a Kalman Filter. I am trying to scale this up to a larger region and more sensors, ho...