All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
10 views

Solving a set of boundary value problems

I am trying to solve the set of coupled boundary value problems such that; $$ U'' +\frac{\alpha}{\sigma c_k}B'+ 2U_0\lambda^2(\cosh{\lambda z})^{-2}\tanh{\lambda z = 0}, \\ B'' + \frac{1}{\zeta C_k}U' ...
-1
votes
0answers
29 views

Moreau Yosida approximation [closed]

Definition: Let $(X,d$) be a metric space and let $f:X\to\mathbb{R}$ be a bounded function. (that is, there is some $M>0$ such that $|f(x)|\leq M$ for all $x\in X$). Then the lower and upper ...
1
vote
0answers
27 views

Evaluating integral $F(r_2) = \frac{1}{r_2^n} \int_0^{r_2} r_1^n f(r_1)\ \mathrm{d}r_1$ without growing instability

I have the following expression to be numerically integrated in a vector-based library (e.g. numpy, MATLAB, etc), $$ F(r_2) = \frac{1}{r_2^n} \int_0^{r_2} r_1^n f(r_1)\ \mathrm{d}r_1, $$ where $n$ is ...
2
votes
1answer
55 views

Bareiss algorithm vs. LU-decomposition

I at the moment try to fully understand the Bareiss algorithm for calculating determinants. One question that came to my mind is the following: Why is LU-decomposition much more often used than the ...
-1
votes
0answers
25 views

Code for computing the Partial Fréchet Distance [closed]

I am looking for a code (Python, Matlab, R) to compute the partial Frechet distance. That is a similarity measure for curves that takes into account partial matchings. References Buchin, K., Buchin,...
2
votes
1answer
40 views

Compute distances from a vector to a matrix of vectors

Let $\vec{a} \in \mathbb{R}^\alpha$, and let $H$ be a rank 3 tensor with dimensions $M_{[i \in \mathbb{N}]} \times N_{[j \in \mathbb{N}]} \times \alpha_{[k \in \mathbb{N}]}$ (where the subscript are ...
1
vote
0answers
21 views

How to properly compute weights for Weighted Least Squares (WLS)?

I want to apply the weighted least squares method in order to identify parameters of a dynamic process. The process is described by a second order differential equation of the form: $$ \ddot{y}+a_1\...
0
votes
0answers
41 views

Successive over relaxion for banded matrix

How can i possibly code a SOR for a banded matrix of this format: $$\begin{bmatrix} A_{P_{1}} & A_{E_{1}} & 0 & 0 \\ A_{W_{2}} & A_{P_{2}} & A_{E_{2}} & 0 \\ 0 & A_{W_{3}} ...
1
vote
0answers
33 views

Numerical errors due to terms of the form $\frac{1}{r}$ (r goes to 0 at the boundary) while using finite difference method

I am trying to solve a system of differential equations using finite difference method. There are few terms of the form $\frac{A(r)}{r}$, both $A(r)$ and r go to zero at the boundary. Analytically ...
0
votes
1answer
22 views

Defining system of ODEs: only size-1 arrays can be converted to Python scalars [closed]

I am trying to define the following system of ODES in python: $$ \left(\frac{dP}{dt}\right)=\sqrt{ \left(1-\frac{3}{P}\right)\left(2+\frac{4}{P^2}\right)\\ } $$ $$ \frac{d\varphi}{dt}=\frac{1}{P^2} $$...
-1
votes
1answer
31 views

Matrix requirements for cusparse*csrgemm2

I would like to perform a matrix multiplication like: $C=A*B*A'$ using cusparse library function cusparseDcsrgemm2. To do this I split it into two matrix-matrix multiplications where all matrices ...
3
votes
1answer
53 views

Arbitrary Precision Optimization Libraries?

Are there any well-known optimization libraries (ideally with Python bindings or even in Python) supporting (unconstrained) minimization (of $f:\mathbb{R}^n \to \mathbb{R}$ for $n$ for $n\sim 10^1,10^...
1
vote
0answers
41 views

Residual of Poisson equation with periodic boundaries

I am trying to write a multigrid solver for Poisson's equation, $-\Delta u=f$, on the unit square, $\Omega=(0,1)^2$ with periodic boundaries. My primary source has been Multigrid by Trottenberg, ...
4
votes
1answer
133 views

The velocity Verlet method and variable time steps

Does the velocity Verlet handle variable time steps? I found controversial statements about it. In the paper Skeel, R. D., "Variable Step Size Destabilizes the Stömer/Leapfrog/Verlet Method", BIT ...
1
vote
2answers
50 views

Writing code on the CPU while developing, running it on the GPU when live - which approach?

In my simulations I am using dense matrix-vector multiplications and 2D-fft transformations quite often, for matrix sizes of 8kx8k and up. Hence, I assume that using a GPU is beneficial for speeding ...
2
votes
1answer
64 views

Fourier spectral method for coordinate transformed heat equation

As the title said, I want to solve a coordinate transformed heat equation using fourier spectral method. In particular, I am interested in transforming an uniform grid into an adaptive non-uniform ...
-1
votes
0answers
39 views

Showing N = NP on-line [closed]

I have a theorem that proposes a method to build algorithms. All the algorithms produced by this method are in P ... they never go up to more than $6(n^{12})$ operations. Following that, I have ...
3
votes
1answer
67 views

Big Theta Complexity of Gaussian Elimination using Complete Pivoting

I already know the Big O for partial pivoting is $O(n^3)$ and remain the same for complete pivoting. I also know the big theta complexity for partial pivoting is $2/3 n^3$ I would like to know the ...
1
vote
2answers
77 views

Calculate cofactor-matrix efficiently [duplicate]

I've implemented an algorithm that can calculate the cofactor-matrix of a matrix in $\mathcal{O}(n^5)$. The algorithm just step-by-step iterates over the whole matrix ($\mathcal{O}(n^2)$) and for ...
1
vote
0answers
54 views

Are linear, CTCS codes always stable?

I would like to solve some equations which basically look like this $$\frac{\partial u}{\partial x}=F\left(v,\frac{\partial v}{\partial y},\frac{\partial^2 v}{\partial y^2}\right),$$ $$\frac{\partial ...
0
votes
0answers
54 views

Arnoldi Decomposition Algorithm

I try to get into GMRES via Arnoldi-Decomposition. For my understanding, I Implemented the Arnoldi-Decomposition in python. ...
0
votes
1answer
48 views

Solve convection-diffusion equation with a non-linear source term

I would like to solve this equation (which is adapted in my case, a plug flow reactor when a reaction occurs): $ \frac{df}{dt} = D \frac{d²f}{dz²} - u \frac{df}{dz} + r(z,t) $ with $r(z,t)= - k f^{n}...
0
votes
0answers
51 views

Zero error at nodes using FEM? [closed]

Reading the discussion at this link I got confused. I am solving, using Finite Element method, a simple Poisson problem, $$ -u''= f(x)\, ,$$ on a simple unit square domain where I have chosen ...
-3
votes
0answers
36 views

Unsteady 1-D Diffusion Equation using FVM [closed]

A one-dimensional slab of 1 m width and a constant thermal diffusivity of 1 $m^2$ /hr is initially at a uniform temperature of 100 ̊C. The surface temperatures of the left (x = 0) and right (x = L) ...
1
vote
0answers
49 views

Implementing Level Sets

I am trying to implement a basic level set program for fluid simulation in C++ and visualize it using SFML, so far I have the following simple program for propagating a circular curve: https://gist....
2
votes
1answer
101 views

Order of Accuracy Measurements on 1D Advection Methods

I am trying to learn about basics of computational fluid dynamics, at the moment on the simple example of linear advection in 1D. I am am currently testing the theoretical predictions of the order of ...
1
vote
1answer
64 views

Numerical integration methods: Explicit vs Semi-Implicit vs Newton-Euler 1, 2 and use in cyclone physics engine

I am trying to understand the difference between explicit Euler and semi-implicit Euler integration, where in explicit Euler the current position is calculated as $$x_{n+1} = x_n + v_n$$ and semi-...
1
vote
1answer
23 views

How to let OpenFOAM write output at fixed time intervals _and_ keep the last few steps?

As described in https://openfoam.com/documentation/user-guide/controlDict.php I can use writeControl timeStep writeInterval 1 purgeWrite 10 to keep the ...
0
votes
0answers
27 views

Why it doesn't matter to use velocity gradient or shear rate tensor to calculate wall shear stress?

The wall shear stress is defined based on Matyka et. al. eq. A.4: $$\vec{\tau} = 2 \mu (\mathbf{S} \cdot \vec{n} - (\vec{n} \cdot \mathbf{S} \cdot \vec{n})\vec{n})$$ Where $\mathbf{S} = \frac{1}{2} (...
0
votes
1answer
29 views

Truncation error plot with weird issue

I have a function f(x) = sin(x)/x^3 whose first derivative I am trying to estimate using 1st, 2nd and 4th order Finite Difference schemes. I tried to plot the ...
0
votes
0answers
23 views

Why am I not getting the flat phase when Fourier-transform a Fourier-limited Gaussian pulse?

I have been trying to obtain a spectrum and a spectral phase of a Gaussian pulse using the Fast Fourier Transform provided with numpy library in Python. Here are ...
1
vote
2answers
60 views

What are the alternatives for ABAQUS in generating an *.inp file from a CAD model

ABAQUS gives a .inp file (in pre-processing stage) where the information with regard to the preprocessed model is defined, information such as geometry, mesh type, number of elements, boundary ...
1
vote
0answers
37 views

Incorporating radiation boundary condition at the edge in finite difference

I am trying to solve the 2-d heat equation on a rectangle using finite difference method. I am confused as to how to incorporate non linear radiation boundary condition at the edge. $-k\frac{\partial ...
1
vote
0answers
26 views

Comparison of convection time - theoretical value vs computed

This is a follow up to my previous post here, I'm solving for convection in 1D $$\frac{\partial C}{\partial t} = - v\frac{\partial C}{\partial x}$$ The discretization of the above equation is ...
0
votes
0answers
76 views

Numerically solving nonlinear parabolic stochastic PDEs

For a project I'm doing, I have to numerically solve a nonlinear parabolic stochastic partial differential equation, of the form $$ u_t = u_{xx} + f(u)(u_x)^2 + a(u) + b(u)W(t, x), $$ where primes ...
-1
votes
1answer
80 views

Simulating 1D diffusion

I'm trying to understand the influence of Neumann boundary condition while simulating 1D diffusion equation $$ \frac{\partial C}{\partial t} = \nabla \cdot (D \nabla C). $$ The initial value is set ...
0
votes
0answers
73 views

Time-dependent Schrodinger equation implementation in FEniCS

For our Bachelors thesis we're trying to solve the Schrodinger equation $i\partial_tu = -\nabla^2u+Vu$ in FEniCS. Given the domain $[-5, 5]^2$ with an initial value of $u_0(x, y)=e^{(-2(x^2+y^2))}$ ...
0
votes
2answers
66 views

CSC Sparse Matrices: Why sort row data for Ax=b problems?

I have a matrix in Coordinate format and I will convert it to CSC. As a reference, the format I am using looks like this, but I am not using the pointerE matrix, which I think is superfluous. My ...
1
vote
0answers
42 views

Advantage of fractional Fourier transform over multiscale wavelet?

What could be the arguments of using fractional Fourier transform instead of multiscale wavelet for data analysis ? Optimization of the good time-frequency domain parameter? good in the sens of best ...
5
votes
1answer
104 views

Why lattice Boltzmann despite its huge number of mesh points still has worse accuracy in comparison to FEM for calculating wall shear stress?

I'm just doing a very simple experiment. I'm calculating wall shear stress based on Poiseuille flow for a pipe by using lattice Boltzmann method (LBM) and FEM to compare their values with the ...
4
votes
1answer
91 views

Underdetermined Minimum Volume Enclosing Ellipsoid

Given three vectors in $\mathbb{R}^{512}$, my task is to compute a Minimum Volume Enclosing Ellipsoid (MVEE). I have tried Kachiyan's algorithm, but it requires at least as many vectors as there are ...
1
vote
1answer
67 views

Unexpectedly Slow Convergence Implicit Euler

I'm solving the coupled ODE $$ \left[\begin{array}{c}x^\prime(z)\\p_x^\prime(z)\end{array}\right] = C(z)\cdot\left[\begin{array}{c}x(z)\\p_x(z)\end{array}\right] = \left[\begin{array}{cc}0& A(z)\\...
0
votes
0answers
32 views

exploding gradients in gradient descent procedure of multi-output ridge regression

Multi-output ridge regression: $$W^{*}=\underset{W}{\arg \min } \frac{1}{\mathcal{N}}\|Y-WX\|_{F}^{2}+\lambda\|W\|_{F}^{2}$$ There are $Q$ outputs, $N$ samples, and $P$ covariates (features). $\hat{...
-1
votes
0answers
16 views

Magnetic Flux Density Calculation From Predefined Current Density Distribution

I have a model where I can solve for the nodal current density values. What I want to do is to alter this nodal current density information by using MATLAB, then pass this new nodal current density ...
0
votes
1answer
28 views

Problems with first and second complement

What I know 1=negative,0=positive Example 1. 27-13=14 Example 2. -39+92=53 For example 1. 27 to binary is 11011 13 to binary is 1101 So 1101 change to two complement will ...
-1
votes
0answers
28 views

How to calculate derivative of binary cross entropy?

I'am beginner on neural network topics. I wan to learn how to calculate derivative binary cross entropy loss function. For this, I learn derivative and partial derivative. But it's still to complex ...
1
vote
0answers
41 views

Unsteady diffusion equation with spatial finite elements and Forward Euler in time

I have solved the unsteady diffusion equation using piece-wise linear Finite elements(triangles) for spatial discretisation and Forward Euler for temporal discretisation. I have the following mesh ...
1
vote
1answer
32 views

Augmented Dickey Fuller (ADF) test statistics GPU formulation

I have followed different sources of information and achieved the following formulation for the ADF $t$ test statistics. I implemented it to run several hundred thousands of ...
1
vote
0answers
23 views

Simplification of vertices and dihedral angle relations of a polygonal chain

I am trying to understand the generation of Cartesian coordinates of polygonal system or poly line with fixed bond angles and fixed link lengths. I assumed the bond angle to be the same and link ...
1
vote
1answer
34 views

Filtering out outliers in a vector field

I have a vector field that represents a incompressible fluid flow (ie. divergence-free, ideally) that contains a certain percentage of vectors that are completely incorrect, due to the procedure used ...

15 30 50 per page
1 2 3 4 5 170