All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
53 views

Method to calculate solution of a linear equation system?

I am searching a solution method for the following equation system of equation systems: Let $A, B \in \mathbb{R}^{n \times n}$ be s.p.d. Matrices and $O$ be the zero matrix of the same size. Further ...
2
votes
1answer
84 views

Step size and stability of Euler forward method

I'm trying to calculate the maximum step size that provides stability for the following nonlinear IVP using the Euler forward method: $u'(t) = -200tu(t)^2,\qquad u_0 = 1, \qquad t\in [0,3]$, with ...
1
vote
2answers
50 views

What's the difference between the 2 ways of definitions of function handle? which is robust and better?

Recently, I have been studying Krylov subspace iterative methods. I find the matlab robust command pcg and the new concept of the function handle to return a matrix-vector product. Then I use help pcg ...
7
votes
3answers
355 views

Does a symmetric positive definite matrix also have $\mathbf{A} = \mathbf{L}^T\mathbf{L}$ (where $\mathbf{L}$ is a lower triangular matrix)?

As we know, for a symmetric positive definite (SPD) matrix $\mathbf{A}$, there is a theorem about the Cholesky factorization $\mathbf{A}= \mathbf{L}\mathbf{L}^T$, where $\mathbf{L}$ is a lower ...
0
votes
0answers
28 views

Why does the matlab command **chol(A)** slower than **chol(A,'lower')** for a large sparse SPD matrix?

For a SPD matrix A, there exists Cholesky factorization $A=LL^T$ or $A=R^TR$, where L, R are a lower and upper triangular matrix, respectively. Also in matlab, there has a command R = chol(A) which ...
0
votes
2answers
66 views

How can I calculate the exponential integral?

(I originally asked this in a different exchange.) I'm writing a program that uses the prime-counting function. Right now, I'm using x/log(x), but I want to ...
2
votes
0answers
56 views

What is appropriate boundary condition for Poisson pressure equation?

I'm doing CFD simulations in unstructured grids. Well, it's a bit different from conventional unstructured grids that are used mainly in FEM or FVM as tetrahedral meshes. Mine is a voxelized mesh of ...
0
votes
0answers
55 views

Lax-wendroff for stiff source terms

I am interested in problems of the form $$ u_t = F(u) + S(u) $$ where $F(u) = - div(f(u))$ and $S(u)$ is a stiff source term. I am looking for any existing works which develop Lax-Wendroff type ...
2
votes
2answers
150 views

simple example of an adaptive mesh refinement code

I have been writing an adaptive mesh refinement (amr) code. As a prototype for the code, I have been looking at an adaptive mesh refinement code written by my adviser (written in c). I find looking at ...
1
vote
1answer
83 views

Are there any commercial CFD codes that implement a Discontinuous Galerkin scheme?

I've been reading about the Discontinuous Galerkin discretization scheme and it's application to CFD for fluid flow. It seems to be a promising method for simulating turbulent flows, by using higher-...
4
votes
0answers
63 views

Probability approximation: monte carlo VS sde

I have a probability measure $\mu$ (say, in $\mathbb{R}^{d}$, with density) and I want to approximate it numerically. Today I noticed that my measure is ergotic for a certain Stochastic Differential ...
1
vote
1answer
117 views

Solving nonlinear PDE with finite difference based on Newton-Krylov

I am now working on solving MHD equations with finite difference method, which include nonlinear equations: $$ \frac{\partial\rho}{\partial t}+\nabla\cdot\left[\left(\rho_0+\rho\right){v}\right]-\...
9
votes
4answers
4k views

Order of MATLAB FFT frequencies

This wikibook states that the output of MATLAB's FFT corresponds with the wavenumbers ordered as: $$k=\left\{0,1,...,\frac{n}{2},-\frac{n}{2}+1,-\frac{n}{2}+2,...,-...
0
votes
1answer
40 views

Can we use interpolation function of different order to represent different degrees of freedom in a FEM element?

Consider a line element in FEM. Let each node have 3 DOF. They are x and y translation DOF and temperature. Can we use interpolation functions of different orders for the translation DOFs and ...
1
vote
1answer
35 views

How can I determine if there is a closed-loop path in a graph?

Assuming I have a computer representation of a graph presented in the figure below: How can I find out whether there are some close-loops inside the graph, like the one marked in red (or more ...
1
vote
0answers
26 views

Solving a system of PDEs with no-flux boundary conditions (finite difference discretization)

I am interested in solving a system of linear PDEs with the finite difference method and I'm having trouble to solve the no-flux boundary condition correctly. \begin{align} \frac{\partial n}{\partial ...
1
vote
0answers
21 views

Speedup of CPU Pipelining by number of steps [closed]

When a CPU has $K$ steps the speed up of using pipelining compared to non-pipelining is $K$. But what I want to know is, say I am a CPU designer and want to decide whether I should build $K$ or $N$ ...
1
vote
0answers
238 views

Showing date in Paraview's Annotate Time Filter

I have a time dependent data set where each frame corresponds to a certain date. I need to show the time annotation, much like what Annotate Time Filter does, but show the date instead of time as a ...
2
votes
1answer
90 views

Residual value goes to NaN while solving a system of nonlinear equations

I am solving a system of coupled nonlinear equations using Newton's method, similar to $$\begin{split} c_A(A, B)\partial_tA&=\nabla\left(k_A(A, B)\nabla A\right) + f_A(A, B, t)\\ c_B(A, B)\...
10
votes
1answer
503 views

How to sample points in hyperbolic space?

Hyperbolic space in the Poincaré upper half space model looks like ordinary $\Bbb R^n$ but with the notion of angle and distance distorted in a relatively simple way. In Euclidean space I can sample a ...
0
votes
0answers
40 views

Imposing decaying boundary conditions on a non linear ode

I am trying to solve $a^{2}y''=y+y^3$ numerically. This equation models a potential and goes to $\infty $ for $x\to0$ hence I get the singularity to be of order $\frac{1}{x}$ by keeping only the y^{3} ...
1
vote
1answer
67 views

How to compute all the eigenvalues of a large sparse matrix using matlab?

In matlab, there are 2 commands named "eig" for full matrices and "eigs" for sparse matrices to compute eigenvalues of a matrix. And eig(A) computes all the eigenvalues of a full matrix and eigs(A) ...
-1
votes
1answer
36 views

Recursive Algorithm to Calculate Determinant via Expansion of Minors in C#

I have been recently trying to attempt to write an algorithm in C# that would calculate the determinant of a matrix via recursion using the expansion of minors method. I understand that there are ...
5
votes
0answers
31 views

Symmetric sparse direct solvers in scipy

scipy.linalg.solve, in its newer versions, has a parameter assume_a that can be used to specify that the matrix $A$ is symmetric ...
1
vote
1answer
294 views

1-D turbulent energy spectra in homogeneous direction (non-isotropic)

I am trying to compute the one-dimensional energy spectra for my channel-flow simulation. I have already written a post-processing script to achieve this; however, I need to validate my code before ...
1
vote
1answer
51 views

What is the format of saving sparse matrix in MATLAB?

We know that for lagre sparse matrices, we can use compressed sparse row (CSR) or compressed sparse column (CSC) format to store the sparse matrices so that we can save CPU memory. And the coordinate ...
0
votes
0answers
26 views

What is Voronoi particle tracking?

I've been trying to track this down, but google is giving paywall papers that don't appear to be directly related to computational science, or simply don't explain the source algorithm. There's an ...
0
votes
0answers
18 views

Direct and Inverse efficient mapping of 3D cartesian positions in a 1D array

I saved a sample of $N$ Cartesian locations $\{x_i, y_j, z_k\}$ inside a one-dimensional array $\mathbf{a} = \{a_l\}_{l = 1}^N$. How can I access back (efficiently) the $l$-location of the array $\...
-1
votes
1answer
42 views

Smoothed Particle Hydrodynamics: Weird clustering of particles. Is that normal?

I implemented a rather simple SPH simulation using a cubic-spline-kernel and a simple non-iterative pressure solver as described in this PDF in equation 9. I followed algorithm 1 of that paper (...
5
votes
1answer
76 views

Understanding butcher tableau when it comes to implicit methods

I've been learning about butcher tables and am having some difficulty understanding how to translate them when it comes to implicit methods. Specifically, I'm looking at backwards Euler: \begin{array}...
2
votes
1answer
106 views

How to perform an eigendecomposition of a general complex matrix with arbitrary precision in C/C++

I need to obtain the Eigenvectors of a general complex matrix, but with quadruple precision. Is anyone aware of a means to do this? I currently use Tux Eigen, and I see that in their unsupported ...
2
votes
0answers
56 views

What exactly is the cause(s) of blow-up for too-large step size in a method like RK4?

I have been working on creating a few home-made numerical methods, and I am using them to visualize text-book problems from my Strogatz dynamics textbook. It feels like a good way to learn numerical ...
0
votes
0answers
15 views

Offline Parameter Estimation for second order system - Ordinary Least Squares

I have a second order system which is described by the following differential equation: $\ \ddot{y}+α_{1}*\dot{y}=b_{0}*u $ where $\ y $ is the output of the system and $\ u $ is the input of the ...
3
votes
1answer
129 views

Sparse matrices origins

I am using the sparse matrices provided by the University of Florida Sparse Matrix Collection and most matrices are accompanied with little description of the problem or discipline from which the ...
6
votes
3answers
341 views

Nonlinear eigenvalue problem - MATLAB code

I'm trying to solve a nonlinear eigenvalue problem in MATLAB, still without success. It's a problem about graphene plasmonics. The nonlinear eigenvalue problem is given below: \begin{equation} \frac{...
0
votes
0answers
12 views

Solving SDEs in R until a prespecified value is reached

I am trying to solve a system of SDEs in R using the Diffeqr package. A simplified version of the system: ...
3
votes
1answer
93 views

How to use matlab command 'fft' to solve Ax=b arising from Poisson equation?

I want to ask a question about fast solver to the Poisson equation with Homogenous boundary conditions as follows: $$-\Delta u = f.$$ After centered difference using $n+2$ equidistance points in all ...
4
votes
1answer
257 views

Quadrature and quadrature-free discontinuous galerkin method for non-linear PDE

Quadrature-free DG method using nodal Lagrangian basis are computationally very efficient. I have seen many papers using this method for linear PDE but almost no literature for non-linear PDE like ...
1
vote
0answers
40 views

Hybrid Ellpack-Itpack (ELL) + COO Sparse Matrix Representation decomposition threshold

Hybrid ELL-COO sparse matrix representation can be done as in the picture, I was looking intensively, however I couldn't find out what is the threshold of decomposing the original matrix into ELL part ...
2
votes
0answers
18 views

Normalising DFTs Correctly

I have been playing around with convolutions in scipy's signal package: ...
0
votes
0answers
16 views

Efficient Alternatives to Operator Splitting in NLSE

Lately i've been trying to decide my thesis theme and i've become interested in adaptive finite elements and finite volumes algorithms. However, I need my thesis to fit into a physics related theme. ...
0
votes
0answers
13 views

How to handle system of chemical reactions for a batch reactor SciPy solver

I have a system of chemical reactions where the rate equations represent a batch reactor model. The model is a system of ODEs which is solved with the SciPy ...
0
votes
0answers
86 views

What algorithm do BLAS and ATLAS use for matrix multiplication?

I have searched and what I understood was that they use the naive one with several memory and cache optimizations. However, I wanted to know whether they are using the Strassen or the Coppersmith-...
3
votes
3answers
4k views

How to implement Gauss-Laguerre Quadrature in Python?

To get the hang of Gauss-Laguerre integration I have decided to calculate the following integral numerically, which can be compared to the known analytical solution: \begin{align} \int_0^{\infty} s^...
0
votes
0answers
22 views

Interpreting results of using no-flux boundary condition

I am solving for solute transport in 1 D. $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2} - v\frac{\partial C}{\partial x}$$ No-flux boundary condition is imposed at both the ...
1
vote
0answers
15 views

Live audio processing using c++ (standard or external libs 'ue4')

My goal is to get audio from the input of another device (either connected to computer throught aux or audio interface threw rca or coaxil(from an external device playing audio live) adapters to line ...
4
votes
1answer
40 views

Low rank update of QR of inverse

I am in a situation where as part of a sort of inverse power method scheme, I want to very often perform the following step: Apply a symmetric rank one update $uu^\top$ to my inverse matrix $A^{-1}$ ...
1
vote
1answer
65 views

Implementing Robin Boundary condition (finite difference)

I'm interested in applying Robin boundary condition to a convection-diffusion problem in 1D. In the following system, $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2} - v\frac{\...
0
votes
0answers
24 views

Splitting coupled non-linear diffusion equations into blocks

Two coupled linear diffusion equations $$\begin{split}\partial_ta&=\nabla(\nabla a)\\ \partial_tb&=\nabla(\nabla b)\end{split}$$ can be split into blocks by putting everything onto one side, ...
1
vote
1answer
43 views

Why am I getting this DCPError?

I'm trying to optimize a binary portfolio vector to be greater than a benchmark using CVXPY. ...

15 30 50 per page