instruction stringlengths 43 28.1k |
|---|
I am very new to optimization. so, sorry If I ask a simple question. I have a problem with a dozen of variables. I want to use Augmented Lagrangian for solving the problem. I write a code based on the method(in matlab). Unfortunately, the code doesn't work And I don't know how to understand what's going wrong?
How to ... |
I'm trying to find inverse of a matrix using c++ library armadillo or eigen. But first row of the matrix is wrong, please note that other elements are correct. I'm unable to understand what mistake I committed, please help me.
My code is:
#include <iostream>
#include <armadillo>
#include <cmath>
#include <Eigen/Dense>
... |
Computers can work only with computable numbers, while most of the algorithms are based on analysis of real numbers (real analysis).
When I heard of the existence of computable analysis I immediately had these questions:
Can it help numerical analysis in some way?
Can we for example, help prove convergence of algor... |
I have been doing finite element analysis using Matlab. I look for many examples and tutorials producing only the stiffness matrix letting elements being weightless. However, in my case, I need to do a soil deformation where the self-weight of elements is significant.
Any guidance will be appreciated.
|
I have a problem that I've framed out in a particular way, but I don't know if I'm re-inventing the wheel here. Is there an existing literature base in this problem? Does it have a corresponding term of art? Where would you recommend that I start reading about this type of problem?
The basic problem that I have is that... |
After doing some mathematics related to the stability of elements in 3D Stokes problem I was slightly shocked to realize that $P_2-P_1$ is not stable for an arbitrary tetrahedral mesh. More precisely, in case you have an element where all nodes and three out of four facets lie on the boundary of the domain with a Diric... |
I have a matrix, $X$, it is symmetric. I project $C \odot X$ and $D\odot X$ to semidefinite cone. $C$ is a Gramian matrix with some elements near zero and of course semidefinite, with one row and column equal to zero. $D$ is a matrix of ones except one column and row equal to zero (not the same column and row as $D$). ... |
The free-streaming term in stationary 1D Boltzmann equation satisfies the equilibrium distribution function, that is:
\begin{equation}
\text{Fr}\{f\} := v(k)\dfrac{\partial f(x,k)}{\partial x}
- \dfrac{d\varepsilon_\text{sub}(x)}{dx}\dfrac{\partial f(x,k)}{\partial k}
\end{equation}
equals zero by putting $f_0(x,k) =... |
I have implemented the Richardson extrapolation of the Euler-Maruyama method to 4th order, to estimate the moments of SDE.
The Euler-Maruyama works, and I would expect the Richardson extrapolation to work too, because when I suppress the noise contribution it gives the correct solution in the resulting ordinary differe... |
I'm looking for a benchmark for the lid-driven cavity problem in 3D to compare the results of my code.
In 2D I used:
U. K. N. G. Ghia, K. N. Ghia and C. T. Shin (1982)
High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method. Journal of computational physics.
Do you know a benc... |
I understand how MH work, I'm able to use it to simulate e.g. 2D Ising model. What I don't understand is what you actually take average of.
When I run the simulation, it reaches equlibrium after some time:
Now each new state is going to be the same, so I see no point in taking the average or variance of the sequence t... |
I am trying to solve a singular linear least square problem:
$$minimize: \phantom{2} ||Ax-b||^2 \\
subject \phantom{2} to: \phantom{2} x \ge 0$$
Here $ A \in R^{n \times m} $, and $ n\lt m$. here m is a very large number and the matrix $A$ is dense and almost full.
The least square solution for this is equivalent to so... |
I am trying to learn the Lattice-Boltzmann method and was looking for some good beginner resources explaining the method. I have been looking at some codes online, but have been having trouble understanding them.
Can someone suggest some good introductory resources about the Lattice-Boltzmann method? If you know of an... |
I want to solve the PDE equation numerically. For this, I started my study with something simple; heat equation
$$
\frac{\partial u}{\partial t}=\frac{\partial^2 u}{\partial^2 x}
$$
with the initial condition
$$
u(x,0)=1\qquad(-1<x<1)
$$
I assumed the constant is set to zero.
My next step was to turn this into discrete... |
I searched the web and found some C code for calculating the determinant of a $n\times n$ matrix. This code however seems timing complexity, and run pretty slow especially when handling a larger matrix, for instance, $1000\times1000$ matrix. I need calculate the determinant of a covariance matrix of a multivariate norm... |
I am reading a paper [1] where they solve the following non-linear equation
\begin{equation}
u_t + u_x + uu_x - u_{xxt} = 0
\end{equation}
using finite difference methods. They also analyse the stability of the schemes using the Von Neumann's stability analysis. However, as the authors realize, this is only applicable... |
I need to calculate the inverse of a dense matrix, with some elements taking values as high as 1e9 and some around 1e2. What would be the best method to do it?
Note:
I am more concerned about the precision of the answer rather than minimizing the computational time.
I explicitly need to find the inverse and not the ... |
I am using FEM to do an assignment on a heat conduction problem on a complex domain, which needs me to get the variation of the temparature distribution subject to the variation of boundary conditions, and its exact solution is unknown. Also I have to show the correctness and convergence of my solutions numerically.
I... |
I was wondering what is a more optimized open source BLAS/LAPACK package with respect to modern multi-core processors (Haswell and beyond). Is there any distribution that can attain performance close to that of Intel MKL for instance?
In addition to Intel, which libraries may perform well on AMD architectures for Zen ... |
I have an equation of the form $J^Te=f$, where $e$ and $f$ are known vectors and $J$ is an unknown matrix.
How can I efficiently compute $J^T(JJ^T)^{-1/2}e$ ?
My motivation to address this problem is that, as a part of a bigger problem I need to compute matrix $J$ then compute $J^T(JJ^T)^{-1/2}e$. However, computation... |
I have an interesting problem from my research that I have been struggling to solve. One part of the problem involves generating all possible matrices, where each set contains three integer vectors, of a given volume $V$. That is the determinant of the matrix should be $V$. The constraint is that the maximum of the abs... |
I need to compute a lot of $3\times3$ matrix inverses (for Newton iteration polar decomposition), with very small number of degenerate cases ($<0.1\%$).
Explicit inverse (via matrix minors divided by determinant) seems to work, and is about ~32~40 fused flops (depending on how I compute reciprocal of the determinant). ... |
As per suggestions of the people from MathOverflow, I'm reposting my question here:
I'm currently trying to solve a linear system $Ax = B$, where the matrix $A$ is ill conditioned (i.e. nearly singular), with a condition number of $~10^7$. The aforementioned linear system arises from a finite difference discretization.... |
Can you provide a hash functions $F(x) | F(x) = F(\overline{x}), x \in {\{0;1\}}^n$
$\overline{x} $ is $x$ where all bits are swapped: $0 \rightarrow 1, 1 \rightarrow 0$
Basically it will help me improve my MAX-CUT algorithm
|
I have a problem of the form,
\begin{align}
minimize_{y} maximize_{x}&\quad x^T y - y^T (B\odot x x^T) y\\
s.t. &x\in [l,u]\\
&Ay=b
\end{align}
How to efficiently solve this problem? $B$ is a semidefinite matrix.
What I have done: you can dual the inner problem, and get a semidefinite problem with two sdp variabl... |
I would like to incorporate a CFD topic in a project I currently have. The deadline is a little less than a month from now. Basically, what I would like to do is solve some equations and simulate fluid behavior. The programming language I will use to accomplish this in is C, however I intend to rely on MATLAB for later... |
I'm trying to solve a nonlinear partial differential equation
\begin{equation}
L(u_{xxtt},u_{xx}u_{tt},u_{xt}^2,u_{xt},u_{tt})=0
\end{equation}
using finite difference methods. In order to remove the second derivatives with respect to time, I substitute
\begin{equation}
v := u_t
\end{equation}
such that it becomes
\beg... |
The problem I have may be really simple, but still getting a hard time solving it. So I have the Euler rotation equations:
$$I_{1}\dot{\omega}_{1}+\left(I_{3}-I_{2}\right)\omega_{2}\omega_{3}=\lambda_{1}$$
$$I_{2}\dot{\omega}_{2}+\left(I_{1}-I_{3}\right)\omega_{3}\omega_{1}=\lambda_{2}$$
$$I_{3}\dot{\omega}_{3}+\left(I... |
I am starting to dabble in MPI. I am fairly new to this area and I am currently reading the MPI standard.
I would like to write my first MPI program, a simple hello world program, on a cluster that I have. I am not sure if anyone is familiar with the IBM bladecenter. Supposedly, there is a midplane that connects all o... |
In N queens problem https://en.wikipedia.org/wiki/Eight_queens_puzzle, trying to find solution by backtracking encounters difficulties quite fast (even for SWI-Prolog, http://swish.swi-prolog.org/example/clpfd_queens.pl, which solves N=100 in 0.2 sec, entering N=150 in the link above did not reach a solution in a reaso... |
I do a lot of general processing of data on my desktop computer. It can be stuff like extracting timeseries of point measurements from a large number of NetCDF files, or converting csv-files into binary or making a lot of plots.
My question is, would it be useful to have a Xeon Phi for this kind of work? I try to use t... |
Ok so I'm a complete beginner in computational modelling (I use analytical methods of physics typically) but I would like to model an anisotropic, aperiodic (but not random) finite array of metallic nanorods, all of which have their long axis orientated in the same direction as eachother, but this direction can be comp... |
I have 2 pandas datasets which have 'RF' field in common. The optionsdata variable is ~60K, which map to at most the histdata fields of 5K. Using np.where is incredibly slow:
for j in range(0,len(optionsdata)):
optionsmap[j] = np.where(histdata.ix['RF'].str.match(optionsdata.RF[j]))[0][0]
Is there a much faster ... |
Suppose we use a preconditioned iterative solver for a linear system. If the initial state for the solver can be chosen very close to the exact solution - does this reduce requirements for the preconditioner?
|
I just got a new Macbook and decided to install everything from scratch instead of migrating. Previously I've always installed SciPy etc. through MacPorts, but lately MacPorts as a whole seems not to be as cleanly maintained as it once was, and I spend a lot of time tracking down problems with it. I also generally used... |
Hi I have a code below that solves non linear coupled PDE's given Dirichlet boundary conditions. However I need to implement periodic boundary conditions. The periodic boundary conditions are troubling me, what should I add into my code to enforce periodic boundary conditions? Thanks for the help.
Note, $t\geq 0$ ... |
I have the following two PDEs which I want to check for stability:
$$u_t= u_{xx} , \ u(x,0)=1 , \ u_x(1,t)=-hu^4(1,t) , \ u_x(0,t) = 0 $$
$$u_t = u_{xx}-\sin(x+t)+\cos(x+t) , \ u(x,0)=\cos(x) ,\ u_x(1,t)=-hu^4(1,t)-\sin(1+t)+h\cos^4(1+t) , \ u_x(0,t)=-\sin(t)$$
For the first I got that $d/dt (u,u) = d/dt \int_0^1 u^2 d... |
Consider the following eigenvalue problem
\begin{equation}
\mathcal {L} x(s) = \lambda x(s),
\end{equation}
where
\begin{equation}
\mathcal {L} = \alpha \partial^4_s + (s^2-1)\partial^2_s + s \partial_s + 1,
\end{equation}
with $\alpha = \rm{const}$ and $s\in[0,1]$. In order to find the eigenvalues and the eigenfuncti... |
What are the state of the art methods for fast 2D convolution approximation?
I'm familiar with SVD based multiplication and cross approximation approaches, but would be thankful to get additional references.
The kernel size is typically ~3x3 - 11x11, not separable, with input matrices from sizes ~200x200 - 1000x1000.
T... |
There are many methods for diagonalizing matrices, probably the most widely used is the combination of Householder transformations and the QR algorithm.
Is there any superior method for diagonalizing (large, non-sparse)real symmetric matrices? Superiority can be a bit muddy, so I define it as fast, numerically stable, ... |
It is a commonly known fact that the Rayleigh Quotient converges cubically (1), while the Power Iteration may converge slowly if the difference between the dominant and second-dominant eigenvalue is small.
Knowing this, when would it ever be beneficial to use the Power Iteration over the Rayleigh Quotient Iteration? T... |
If there is an $(n+1)$-dimensional integral of the form
$$ \int_{[0,1]^{n+1}} f(x, y)\,\mathrm{d}^n x \,\mathrm{d}y,$$
normally one would evaluate this using a multi-dimensional integration library over the whole domain, $[0,1]^{n+1}$.
But are there some conditions where it might make sense to perform the integral over... |
In CVX, I encounter a problem. I want to multiply a Matrix of 2x4 with its transpose. I know the result must be positive definite. However, it couldn't let me do the multiplication directly. Says: Disciplined convex programming error:Only scalar quadratic forms can be specified in CVX. What can I do?
cvx_begin
vari... |
I am working on implementing the Fourier beam propagation method in C++. I am really more of a programmer than a physicist but I think I have a good understanding of what I am trying to do. Here is what I am trying to implement.
Two questions. In the flow chart he says you should perform the diffraction and after t... |
I am in the process of building a robotics physics engine. I have been using the Linear ODE $x' = Ax + b$ for the core of my physics integration, but have never found a really good solution method for it.
My problem gets harder than the standard ODE solution because my A matrix is singular.
Here is an example of an $A... |
I need to calculate the lagrange polynomial which approximates $e^x$ at $101$ points, the points $\frac{k}{101^2}$ for $k\in\{0,1,2\dots 100\}$.
I tried the following code:
import java.math.*;
import org.apache.commons.math3.analysis.polynomials.PolynomialFunctionLagrangeForm;
public class interpolation {
publi... |
I want to solve PDE system, which consists of Poisson equation, continuity equations for electron and hole with drift-diffusion equation numerically, by using method called Newton's method.
This method is explained in several literatures, including
https://nanohub.org/resources/1565/download/ddmodel_solution_details_wo... |
I need to solve a set of 5 PDEs for functions $u(x,t)$.
I looked up the Matlab function pdepe. It looked perfect for my case, until I read the line:
$f(x,t,u,\partial u/\partial x)$ is a flux term and $s(x,t,u,\partial u/\partial x)$ is a source term. The flux term must depend on $\partial u/\partial x$.
In my probl... |
When we create numerical models of a real-world system, we usually go through a few phases (from Abramowitz 2010):
a perceptual model, where we consider the relevant components of the system
a conceptual model, where we consider the relationships between those components
a mathematical model, where we come up with equ... |
In my view, it is needed,
To save computational time.
To define accurate boundary conditions at interface where properties changes drastically.
To solver 2 phase problems as single phase only.
To capture breaking and joining of droplets/splashing.
Are there any other reasons which I am missing? Please guide.
Thanks
|
I am trying to simulate an optic-fiber sensor (in-fiber interferometer) to study its respond to temperature. The method I am using is finite-difference time-domain (FDTD), and I come out with a large memory usage problem. The wavelength of the light source centered at 1.55μm while the optical fiber has diameter of 125μ... |
How to numerically find the solution for $a$ and $b$ of this equation
$$\sum_r \frac {\mathrm B_{z_r}(a+m_r+1,b)}{\mathrm B_{z_r}(a+m_r,b)}=K$$
where $m_r$ are non-negative integers, $0<K<1$, $0<a$, $0<b$, and $\mathrm B_{z}(a,b)=\int_0^zx^{a-1}(1-x)^{b-1}dx$ is the incomplete beta function
|
I am using the method by Brandt in the FAS Multigrid algorithm to estimate the truncation error in a 1-D flow problem and then use that as the basis for generating a mesh(r-adaptation) in 1-D.
The process is standard, in that, transform the equations to a computational domain $\xi$, perform/run computations and map th... |
Given some sparse unitary square matrix $A$ ($dim=2^n$ if it matters), is there an algorithm to decompose $A$ into a Kronecker/tensor product of smaller unitary matrices? In other words: decompose unitary $A$ into $$A=U_1 \otimes U_2 \otimes ... \otimes U_k$$ where each $U_i$ is individually unitary and $\otimes$ deno... |
Let $A\in \mathbb{R}^{n\times n}$, symmetric and positive definite. Suppose it takes $m$ units of work to multiply a vector by $A$. It is well known that performing the CG algorithm on $A$ with condition number $\kappa$ requires $\mathcal{O} (m\sqrt{\kappa})$, units of work.
Now, of course, being a $\mathcal{O}$ stat... |
Let $A$ be positive-definite and $C$ diagonal positive-definite, consider the problem of solving the following equation for $\bf x$
$$A{\bf x}+C\begin{bmatrix}
e^{x_1} \\
\vdots \\
e^{x_n}
\end{bmatrix}=b.$$
I believe nonlinear conjugate gradient can solve this, however the nonlinear part is pretty benign as far a... |
I'm a bit confused about the relationships between these two approximation methods mentioned in the title.
Does this kind of interpolation also belongs to the field of spectral methods?
Are the Lagrange interpolants we get from using the roots of orthogonal polynomials also orthogonal?
It's likely to get mixed with... |
In PETSc, I need to generate a random number between 1 and 0.
With the include cstdlib, the classical trick is:
(double)rand() / (double)RAND_MAX
In PETSc, the constant RAND_MAX does not seem to exist.
Is there a work around?
Though it is ugly, I plan to do something similar to:
(rand() % 10000) / 10000.0
|
I am working on a model in COMSOL and I am usin different meshes from coarse to fine keeping the other parameters constant. And, I got different maximum velocities for all the meshes.
What can I do to achieve similar maximum velocities for all the simulations?
|
Note: this question is not strictly related to Matlab or any other environment (even though I would prefer that you refer to my Matlab code).
I've n = 10000 equally spaced elements between -pi and pi in an array produced like this (in Matlab):
n = 10000;
x = linspace(-pi, pi, n);
Then I create a second array x_r, ... |
Setup (complete, but all very standard):
My problem is how to best calculate the cumulative integral of a function which comes out of Spectral Collocation with a chebyshev basis. Take some function $f : [0, \bar{z}] \to \mathbb{R}$ approximated by
$$
f(z) \approx \sum_{n=0}^{N-1}d_n T_n(z),\, z \in [0, \bar{z}]
$$
whe... |
The solvepde function was introduced in MATLAB R2016a. I am able to solve my system of PDEs if there are no time delays involved. Does anyone know how to include time delays in the solvepde function?
|
I need to compute the two-sided (bilateral) Laplace transform of a numerically given function $F$,
$$
I(t) = \int_{-\infty}^{+\infty} {dx} \, e^{-x} \, F(x + t) ~,
$$
where $F(x)$ has some sharp features, e.g., at $ x = \{ 0, x_p, \cdots \} $, has finite support, and vanishes sufficiently fast for $ x < 0 $ to prevent ... |
I have a one-dimensional set of points, i.e. $(n,y_n), 1\leq n \leq N$. I want to fit them with a linear combination of $k$ rectangular functions in a least-squared-error sense. Each rectangle is parametrised by a left edge, right edge, and height. It is similar to the Lebesgue sum but I am looking at horizontal strips... |
I have a simple question that I wasn't able to find an answer to. I have a function f(x) where x is some vector, for example:
function f=f(x)
f=x.^4;
end
Then I want to integrate with bounds as vectors:
x=1:0.1:10;
x_0=2*ones(size(x));
g=integral(@f,x_0,x);
and I want to get g as a vector g(i)=integral(@f,x_0(i),... |
I would like to fit a diffusion coefficient as function of e.g. salt, pH etc. If I use a linear combination of all variables, I will have to apply constraints because the model fails, if the diffusion coefficient will get too large or negative.
I was wondering if there exists a function that behaves similar to the logi... |
I want to write a MATLAB code for Roe solver for 1D shallow water equations.
Is there anyone who can help me with that?
|
I am going to calculate a trajectory, by using a pre-calculated vector field. The values of the field are known on a grid which is quadratic in the horizontal direction, un-evenly spaced in the vertical, and evenly spaced in time.
I'm planning to use a 4th order Runge-Kutta integrator, and my question is if I should si... |
Recently, I took a course on numerical methods where we learned about Galerkin's Method of Weighted Residuals. We were told that it forms the basis of the Finite Element Method .
However, in most introductory texts I've seen on FEM, they start with a simple example where they manually write out the equations to minimiz... |
How can I make a scatter plot like the following, where the density of points represents the magnitude of the scalar field at that point. Consider for example the probability density for an atom:
I managed to plot something like this as a color plot (see my question and the pictures here: https://stackoverflow.com/que... |
In elementary chemistry textbooks you often have pictures like the following one:
Are there any conventions how to get them?
I am not sure, but I guess that it are contour plots with only one iso-surface of constant probability density $|\psi|^2$ such that the (integrated) probability for an electron to be inside of o... |
I am trying to solve Travelling Salesman Problems using tabu search. I have been able to successfully find "near enough" optimal solutions (as well as one optimal, yay!).
For the moment I am using sub-tour reversal as the local search precedure. The basic gist of it is similar to 2-opt, but rather than swapping two cit... |
The documentation of PETSc shows an example of usage:
PetscRandomCreate(PETSC_COMM_SELF,&r);
PetscRandomSetType(r,PETSCRAND48);
PetscRandomGetValue(r,&value1);
PetscRandomGetValueReal(r,&value2);
PetscRandomDestroy(&r);
In the example random 1, we can find also the use of PetscRandomSeed.
However, it seems n... |
I've got an elliptic problem in a domain with two materials in a checkerboard arrangement. Both materials are highly dissimilar, being one much more compliant than the other.
If I use classic linear lagrange finite element, because of the corners of the checkerboard, there will be singularities that will make the solu... |
I understand the basic idea of imaginary time propagation method:
The wavefunction $\psi(x,t)$ as a superposition of energy eigenstates $\phi_m(x)$:
$$
\psi(x,t)=\sum_m \phi_m(x)e^{-iE_mt/\hbar}
$$
In imaginary time, ${t}\rightarrow{-it}$,
$$
\psi(x,-it)=\sum_m \phi_m(x)e^{-E_mt/\hbar}=e^{-E_ot/\hbar}\bigg(\phi_o+\phi_... |
I would like to know if I should switch to OPENFOAM for my task.
I work only with Cartesian grids, right now in 2d, rectangular domains only.
If $\mathbf{w} = (w_1, w_2)$ and suppose I want to solve
$\partial_t(\mathbf{w}) = \nabla(\mathrm{div} \mathbf{w}) = \mathbf{f}$
subject to Dirichlet boundary condition and an... |
Nocedal and Wright
on Conjugate Gradient Methods, p. 123, describe a
restart strategy ... whenever two consecutive gradients are far from orthogonal
$\qquad {{| \nabla f_k^T \ \nabla f_{k-1} |}
\over { \|\nabla f_k\|^2 }} \ge \nu $,
with $\nu$ typically 1/10.
Can anyone comment on CG with such restarts, or point to t... |
A CSV file is characterized by a header, describing the n datarows to come. The header is a text string separated by a separator. A CSV header might look like (C1)
Date;Time;ZIP-Code;Address;Temperature
Assume we have a second CSV file (C2) with this structure:
Date;ZIP-Code;Address;Temperature
C1 and C2 are similar,... |
Suppose I have a large, sparse, $m \times n$ matrix $A$, with $m \gt n$ and $\text{rank}(A) = n$. I wish to solve $Ax=b$.
Suppose I know that $A$ has the following characteristics:
$A$ is somewhat diagonally-dominant (it may have a few side-bands offset quite a bit from the main diagonal, and a few rows do not fit th... |
In numerical fluid dynamics there are field methods like finite-volume, finite-element, etc. and particle methods like Smoothed-Particle-Hydrodynamics – SPH and others. Both approaches have advantages and disadvantages depending on the application. Both, in principal completely different approaches, can be combined usi... |
The 2-norm condition number can be easily extended to rectangular matrices. I'm wondering if the inequality for the product of matrices still holds in that case, i.e.,
$\operatorname{cond}(AB) \leq \operatorname{cond}(A)\operatorname{cond}(B)$
|
I wonder what is the difference between both functions.
In C++, the difference between new and malloc is easier: new allocates memory by calling the constructor.
What about PETSc ? In the example, it seems to be pretty close:
in dm/examples/tutorials/ex6.c:
struct _p_FA {
MPI_Comm comm[3];
PetscInt xl[3],yl[3]... |
I recently heard that in Linux, /dev/random and /dev/urandom are pseudo random number generators but not true random number generator.
So I am curious to know the difference between pseudo & true random number? In other words What is the difference between pseudo-randomness & true-randomness?
|
I am interested in solving a sequence of linear systems of the form:
$$A x_i = b_i$$
That is, all the systems use the same matrix $A$ but they have different right hand sides. The matrix $A$ is sparse symmetric positive definite.
I am currently using CHOLMOD to solve each system. Obviously, I factorize $A$ once (Chole... |
Suppose $A\in\mathbb{R}^{n\times n}$ is a banded matrix, i.e., a matrix with all of its nonzero elements on the main diagonal, i.e., $\alpha_{i,i}\neq 0$, the first superdiagonal, i.e., $\alpha_{i,i+1}\neq 0$, through the $k$-th superdiagonal, i.e., $\alpha_{i,i+k}\neq 0$, the first subdiagonal, i.e., $\alpha_{i-1,i}\n... |
For my program assignment I need to write a preconditioned steepest descent algorithm. I have psedo-code from my professor which is here:
From reading in my text on this method they say that $P$ is the preconditioned matrix but they do not define it in any way shape or form. I am not sure at all, but by my professors p... |
In the (iterative) Conjugate Gradient (CG) algorithm: https://en.wikipedia.org/wiki/Conjugate_gradient_method
The initial search direction $p_{0}$ is set to the initial residual $r_{0}$. But I can't see why this choice? Can I get this choice of $p_{0}$ from any of the equations presented in the article?
Thanks!
|
I am working on an astrophysical research in which we relate the cumulative number of Damped Lyman Alpha HI clouds/galaxies, namely their number densities, $\frac{dN_{DLA}}{dz}(>M, z=0),$ to the hosting Dark Matter halo mass function, $\frac{dn_{h}}{d(\log M)}$, and the incidence cross section area, $\sigma_{DLA}$, in ... |
I have a working C++ function:
/// Structure for surface nodes
// Each node has a current x- and y-position and a reference x- and y-position.
struct nstruct {
/// Constructor
node_struct() {
x = 0;
y = 0;
x_ref = 0;
y_ref = 0;
Ax = 0;
Ay = 0;
}
/// Elements
double x; // current x-position
doubl... |
I am in the process of collecting material for a class in computational methods. It will include introductions into numerical methods for ordinary differential equations (Runge-Kutta methods, multi-step methods) and parabolic and hyperbolic partial differential equations (finite differences, spectral methods, finite vo... |
I've been learning CFD theory for 4 months (which includes FEA, FDM AND FVM) and now I want to start running simulations. As a novice to CFD software, I would appreciate some advice on where to start, e.g., OpenFoam, Matlab, Fortran? (I am comfortable with programming and learning coding languages).
|
I wanted to clarify the idea of the exact line search in steepest descent method.
An exact line search involves starting with a relatively large step size ($\alpha$) for movement along the search direction $(d)$ and iteratively shrinking the step size until a decrease of the objective function is observed. Is this cor... |
Given a domain $\Omega$ with 2 subdomains $\Omega_1,\Omega_2$ as figure below
Level set equation $$ \partial_t\varphi + U\cdot\nabla\varphi =0 $$
$U$ is velocity only presents inside $\Omega_1$. We assume $U$ is irrotational, i.e. $\nabla \times U=0$, which implies that the velocity field can be derived from a potentia... |
So given an objective function $f({\bf x})$, I would like to include a positivity constraint when I perform the fixed point iteration:
$${\bf x}^{(t+1)}={\bf x}^{(t)} - \text{H}_f^{-1}\nabla f({\bf x}^{(t)}),$$
for ${\bf x}^{(0)}>{\bf 0}$.
The best way I've found to do it is to add a log barrier to the objective functi... |
Given the advection equation for an incompressible flow field
$$\frac{\partial c}{\partial t} + \mathrm{Pe} \frac{\partial c}{\partial x} = 0$$
what would the best method be for discretizing this without introducing any numerical diffusion or oscillations? Specifically when we have step changes in boundary conditions, ... |
Assume I know eigen-pairs $(\epsilon_i,\vec\phi_i)$ for matrix operator $\hat H$ that $ \hat H \vec \phi_i = \epsilon_i \vec \phi_i $
Now I have slightly perturbed $\hat H' = \hat H + \hat R$ were perturbation $\hat R$ is small with respect to $\hat H$ (in some sence, e.g. Frobenius norm ?). Now I would like to find ei... |
I asked a similar question on the Mathematics stack exchange here without much success, so I thought I'd ask it with a more practical bent here.
Suppose we have a Hermitian matrix $H$ with (for the moment) distinct eigenvalues. Let $\{u_1,u_2,\ldots,u_n\}$ be an orthonormal eigenbasis. Most linear algebra packages I kn... |
There are two independent tetrahedral FEM grids. Second grid is subset of the first. By subset, I mean: nodes from the second grid are exactly in the same positions as some nodes from the first grid. The numbering of nodes is completely different in both grids. I need to renumber nodes from the second grid according to... |
this is a classical problem, but I need help to pinpoint what I am missing.
Problem:
In MATLAB
(exp(1) + 10^12) - 10^12
gives you a double which equal to e, up to 5 correct digits. But I thought it would be 4.
One has exp(1) + 10^12 = 1.000000000002718e+12, where 1.000000000002718 contains 16 digits, the precision w... |
I have a function evaluated on a regular 5D grid with 21 points per dimension (so $21^{5}$ points total).
I need to evaluate the integral of the function over all 5 dimensions, so I was planning on using one of the composite Newton-Cotes formulae (i.e. trapezium rule, Simpson's rule, Boole's rule etc.)
I'm wondering:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.