All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
11 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: ...
-1
votes
0answers
9 views
2
votes
0answers
16 views

Normalising DFTs Correctly

I have been playing around with convolutions in scipy's signal package: ...
0
votes
0answers
12 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. ...
2
votes
1answer
97 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 ...
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 ...
4
votes
0answers
58 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
37 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 ...
-2
votes
0answers
15 views

Implementing Housholder QR decomposition in Python

I am struggling to get my implementation of householder qr decompostion to generate the correct answers. I have been working on this for days and cannot workout where my code is going wrong. Any help ...
1
vote
0answers
38 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 ...
0
votes
0answers
20 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 ...
3
votes
1answer
82 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 ...
1
vote
0answers
14 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
35 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
57 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
22 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
41 views

Why am I getting this DCPError?

I'm trying to optimize a binary portfolio vector to be greater than a benchmark using CVXPY. ...
3
votes
0answers
41 views

Efficient evaluation of spherical harmonic expansions

Assume I know that I can express an approximation of a function by $$ \sum_{l=0}^{k}\left( \sqrt{A_l} z_{l,0}^1 L_{l,0}(\theta)+\sqrt{2A_l}\sum_{m=1}^l L_{l,m}(\theta)(z_{l,m}^1 \cos(m\phi)+z_{l,m}^2\...
-1
votes
1answer
40 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 (...
1
vote
1answer
28 views

Why the iteration steps become twice if the step size reduces half for CG methods?

For CG method for SPD matrices, (Ax = b arising from Poisson equation with homogeneous boundary condition) we know that the convergence theorem: After m steps of iteration, the error $e^{(m)}=x-x_m$ ...
-1
votes
0answers
15 views

Counting number of calls to union operation while creating disjoint set from an undirected graph

I am working through an algorithms book, and I am having trouble understanding the solution to a problem in the book. This is found in the Introductions to Algorithms book in Chapter 21 on disjoint ...
-1
votes
0answers
73 views

Solving one dimensional diffusion equation

This is a followup to my previous post here. I'm solving a 1 D diffusion equation using Dirichlet boundary conditions on both the boundaries, left and right. $$\frac{\partial C}{\partial t} = D\...
1
vote
0answers
29 views

How to use matlab **fft** function or other fast methods to solve a convection-diffusion system quickly?

for a convection-diffusion equation with Dirichlet boundary conditions as follows: $$-u''+qu'=f$$ Using centered difference for $u''$ and $u'$, we get a linear system $$Ax=b$$where matrix $A$ is ...
3
votes
2answers
52 views

Optimal line such that maximum points are between an upper and lower boundary

I have some 2D data and would like to find a line $y = mx + b$ such that a maximum number of points from the data is captured within the area between $y = mx + b + margin$ and $y = mx + b - margin$. ...
1
vote
0answers
54 views

Solving diffusion equation using finite difference method

I am solving an 1-dimensional diffusion equation with Neumann boundary condition at outlet and constant concentration, C, at the inlet. In the end, I want to observe how the concentration diffuses ...
1
vote
1answer
79 views

Numerical derivative in python

I am trying to take the numerical derivative of a dataset. My first attempt was to use the gradient function from numpy but in that case the graph of the derivative ...
2
votes
0answers
68 views

Extracting FEM matrices in matlab pde toolbox

I am trying to follow the dynamic linear elasticity in Matlab, link here. My goal is to extract the FE Matrices using the function assembleFEMatrices in matlab and solve the resulting system of second-...
-1
votes
0answers
24 views

Confusion on time complexity for the following loop? [closed]

I understand the second for loop is log n time, the while loop is log base 3 n time but I am confused on the first for loop? Can someone explain, is that just o(n)? What does j = n-m really do? ...
1
vote
1answer
37 views

stretch elliptic mesh to fit a circle

I've generated a 2D O-mesh around an airfoil. Unfortunately, the mesh O shape is not a perfect circle as you can see in the figure below (in the figure I plotted only the mesh nodes in blue). The red ...
2
votes
2answers
137 views

Does iterative method work for singular consistent linear system Ax=b?

Recently, I have been studied iterative methods for large sparse linear system Ax=b, where A is nonsingular, so there is a unique solution x. And the stopping criterion is usually chosen with norm(b-...
3
votes
1answer
101 views

Solving an SDE with time-dependent parameter in R

I am trying to solve a system of SDEs in R using the Diffeqr package. Let's reduce the system to a simple ODE: ...
0
votes
1answer
33 views

How to find the nearest point inside a list in a given direction

Being $\bar{\mathbf{x}} \in \mathbb{R}^3$ a point and $S =\{\mathbf{x}\}_{i=1}^N \in \mathbb{R}^3$ a sample of N points. I am looking for a simple algorithm to determine the nearest point in $S$ in ...
-1
votes
1answer
87 views

Imposing periodic boundary condition for linear advection equation - Node problem

I've spent the whole day trying to figure out what is the correct way to impose (and implement) periodic boundary conditions $u(0,t)=u(1,t)$ for all $t>0$ for the simple advection equation $u_t + v ...
1
vote
1answer
57 views

Why should one use a tree structure to represent discrete function spaces?

In FEM/FV codebases, I stumbled upon the fact that the discretized functionspaces are represented within the code as a tree structure. I find this very puzzling. Example: lets say somebody wants to ...
-3
votes
1answer
77 views

Does a new proposed method for solving Ax=b must beat matlab command 'A\b' be a successful method?

I have a question about direct and iterative method. Many people including me often say that for very large sparse linear system, Ax=b, an iterative method is necessary because of cpu memory. I also ...
5
votes
2answers
121 views

How to solve calculus of variations problems numerically?

For example, how to solve the well-known isoperimetric problem (i.e., to enclose the largest area with a fixed-length curve)? We can simplify things a bit and fix the two ends of the curve at $[a,0]$,...
0
votes
0answers
94 views

Jacobian-free approach for time-dependent equations for implicit time-stepping

When solving time-dependent non-linear equations, such as the non-linear diffusion equation $$\partial_tu=\nabla\left(D(u)\nabla u\right)$$ usually Newton's method is applied, with (coupled with the ...
0
votes
0answers
28 views

Solving Parabolic PDE using Matlab

I have the following pde (Burger's equation) for $\epsilon>0: u_t+u.u_x=\epsilon.u_{xx}$ and $x\in \mathbb{R},t>0$ and the initial condition: $u(x,0)=\phi(x)=1_{(-\infty,0)}(x)$. I want ...
-3
votes
0answers
66 views

Newton-Krylov on GPGPU

I have questions on Newton-Krylov method implementations. What is the fastest implementation of this method which uses sparse matrices and utilizes GPGPUs? What is the fastest open-source ...
1
vote
1answer
37 views

Gmsh meshes flat faces incorrectly for cylindrical faces

I have some C++ code that generates meshes from step files and then analyses these meshes for visibility of the faces from different viewing directions. I currently use CGAL but I would like to switch ...
0
votes
1answer
49 views

Analytic formula for $\arg\max_{\|z\|_\infty \le 1}z^T A z$, where $A=uu^T+vv^T$

Let $u$ and $v$ be column vectors of size $n \gg 1$ (not both zero), and consider the matrix $A:=uu^T+vv^T$ Question What is an analytic formula for $\arg\max_{\|z\|_\infty \le 1}z^TAz=\arg\max_{\|z\...
-2
votes
0answers
32 views

Are 2nd spatial derivatives useful for integrating ODEs?

In discussion of adaptive integrators for ODEs, I see a lot of discussion of how second derivatives in time can be approximated using finite differences, i.e., take several steps, and use numerical ...
0
votes
0answers
23 views

How to ensure values stay within range?

e.g. water in a height map Choosing a range with a margin of error for typical model behaviour seems practical. Could we instead (1). predict maximum values; or (2). have a natural maximum? 1. ...
0
votes
0answers
44 views

Determining the indices of a VTK mesh

I am trying to assign fixed constraint at specific indices of VTK mesh, however, I only can view STL file in a blender as follows: Upon assigning the favored indices in my scene at the SOFA physics ...
0
votes
1answer
61 views

Robin Boundary Condition with Implicit Upwind - Finite Difference Method for 2D Convection-Diffusion Equation

I am trying to solve a problem with 2D Convection-Diffusion equation with U = Concentration ($mg/m^{2}$) using Implicit Upwind Finite Difference Method like this $$ \frac{\partial U}{\partial t} + ...
0
votes
0answers
25 views

Run different architecture on a PC with coprocessors [closed]

Before I start, I'm sorry if this is offtopic here, but I couldn't find a more suitable site where to post this question. Inrecently saw a video of an old machintosh computer running msdos software, ...
0
votes
0answers
15 views

I have a trouble determining appropriate transition matrix

M.Sc students of the Department of statistics, FUTA are expected to do course work for a year and write their thesis the following year before graduating. A student has a probability of 0.25 of ...
3
votes
0answers
43 views

Is there an open-source material database management GUI?

Does somebody know an open-source GUI for the management of a small material database? I have a spreadsheet with some materials in it. Each materials has some temperature-dependent properties like ...
3
votes
1answer
84 views

Analytic formula for leading eigenvector of $uu^T + vv^T$?

Let $u$ and $v$ be nonzero column vectors of size $n$ and consider the $n \times n$ positive-definite matrix $A:=uu^T + vv^T$. In this post https://math.stackexchange.com/a/112201/168758, the ...
1
vote
0answers
14 views

Get interpolated values in user defined 2D grid Paraview

I have a 2D flow and would like to obtain the value of certain scalar field in a set of points forming a regular mesh. These points should not coincide with the nodes of the actual mesh used in the ...

15 30 50 per page