All Questions

Filter by
Sorted by
Tagged with
-2
votes
0answers
21 views

Difficulties on Mathematica code to solve Christoffel Symbols of a particular metric [migrated]

DISCLAIMER: PLEASE DO NOT PUNISH ME FOR THE .JPGs I) The Problem There's a particular metric $[1],[2]$ in general relativity which is written as: $$ds^{2} = -[c^2-v_{s}^2f(r_{s})^2]dt^2+v_{s}f(r_{s}...
2
votes
1answer
39 views

How to extract connected components from persistence diagram?

From the given point cloud (Fig. 1), I use Scipy-TDA to extract persistence diagram (Fig. 2). What I'm interested in is to extract 3 circles. For example, I'd like to know 3 center points and labels ...
-1
votes
0answers
9 views

How to extract text from several .json files and put all of them in a single file? [closed]

I have a bunch of .json files, say 1000. To read each files I run the following code in MATLAB fname = 'C:\Users...\d90f3c62681e.json'; val = jsondecode(fileread(fname)); the output is as follows. <...
0
votes
0answers
28 views

How long should the hyperelastic equations be solved before updating the mesh?

How long should the hyperelastic equations be solved before updating the mesh? To be specific, I'm interested in the hyperelastic model with a neo-Hookean solid: $$ \nabla\cdot\sigma + f = \rho\ddot{...
-1
votes
0answers
19 views

Why this LJ molecular dynamics result doesn't converge?

I am doing a molecular dynamics simulation of Leonard Jones 6-12 potential.But instead of converging to a particular value. It always stays between -5.58 to -5.62. The standard value is -5.517. The ...
-1
votes
0answers
10 views

integrate.solve_ivp bugged

I am trying to solve an ODE with solve_ivp, but I am getting strange errors. Documentation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html ...
3
votes
0answers
18 views

Numerical flux and source term in FVM (Burger's like equation)

I'm trying to solve the following equation with FVM $$u_t + f(u)_x = g(u)$$ where $g$ is some smooth function of $u$ and $f(u) = \frac{u^2}{2}$. This is really similar to Burger's equation, except ...
2
votes
0answers
13 views

Adaptive Runge-Kutta for Stochastic (Projected) Gross-Pitaevskii Equation

I am using the XMDS library for solving the stochastic (projected) Gross-Pitaevskii equation $$i \hbar \partial \Phi\left(\mathbf{r},t\right)_t=\hat{\mathcal{P}}\left\{(1-i \gamma)\left(\hat{H}_{\...
-1
votes
1answer
31 views

Detecting degenerate triangles with very thin structures

Between the two ears in the following bunny images, there are some degenerate triangles I want to detect. It looks like a volume-less thin slits. If the question is not clear, please let me know.
1
vote
1answer
128 views

Efficient CRS vectors evaluation using elements connectivities

What is an efficient way of evaluating the column (col_ind) and the row (row_ptr) vectors for the CRS (Compressed Row Storage) storage format using the Connectivity Array? The Connectivity Array is a ...
4
votes
1answer
117 views

An optimization method for bounding the eigenvalues of a unknown non symmetric matrix

Given a positive objective function $f$ that acts on a real-valued matrix $A$, I am interested in the following problem $$\underset{A \in \mathbb{R}^{n \times n}}{\text{minimize}} \quad f(A) \quad \...
56
votes
4answers
9k views

How mature is the “Julia” scientific computing language project?

I'm considering learning a new language to use for numerical/simulation modelling projects, as a (partial) replacement for the C++ and Python that I currently use. I came across Julia, which sounds ...
6
votes
2answers
205 views

Is this system of diffusion equations well-posed?

I’m using a standard Crank-Nicholson algorithm to solve this system of two coupled diffusion equations: $$\dot{u} - \dot{v} = \frac{\partial}{\partial x} \left( \alpha(x) \frac{\partial u}{\partial x}...
5
votes
0answers
138 views

Solve ill-posed linear system without transposing matrices?

I am attempting to use an iterative solver to solve $p$ in $$ Jp = -r $$ where $J$ is an $m\times m$ matrix ($m$ is in the order of $10^5$ and never explicitly stored). $J$ is a dense matrix ...
6
votes
1answer
490 views

Jacobi preconditioner not reducing condition number?

Let's say you have a general matrix $A$, with diagonal entries $a_{ii} = d>0$. (No assumptions are made about the off-diagonal elements.) Then Jacobi preconditioning doesn't improve condition ...
-1
votes
1answer
27 views

Why addCylinder function not respecting the given coordinates?

I tried to generate 3 very simple cylinders, each other connected to it end, however the cylinder get connected to an unexistent point in space as the image shows: It was supposed to each segment be ...
7
votes
2answers
4k views

How to get all intersections between two simple polygons in O(n+k)

Basically the formulation of the problem I'd like to solve is very simple. Given 2 simple polygons (without self-intersections) report all intersecting edge pairs in O(n+k) time, where n - is a total ...
4
votes
2answers
52 views

MInimizing cost function using iterative search for a minimum method

I want to estimated the parameters $\ \hat{\theta} $ of a model using an iterative search for the minimum of a cost function. The cost function is defined as follows: $$ V_N(\hat{\theta}) = \frac{1}{...
4
votes
2answers
113 views

Fast algorithm for computing the similarity between two arrays

Suppose there are two arrays (They have the same length), I want to give a quantitative description about the similarity between them. I define a formula like this, which means we can shuffle them ...
2
votes
1answer
65 views

Generating Random Orthogonal Matrices in C++

I'm looking for an open-source library for the generation of random n-dimensional orthogonal matrices in C++. In python, it looks like such a function is available in the NumPy package. But I was not ...
-1
votes
1answer
28 views

Numpys `tensordot` and what is happening mathematically

I've encountered a program where np.tensordot was used, so I tried looking it up but I can't really understand what this function is doing... I feel rather ...
1
vote
1answer
56 views

Is C++ and Object-Oriented Numeric Computing for Scientists and Engineers by Daoqi Yang still relevant?

I'm looking to learn C++ primarily from a scientific computation perspective. The approach of the textbook seems ideal to me as it covers C++ from first principles with an emphasis on numerical ...
2
votes
1answer
83 views

Sparse matrix-matrix multiplication using AVX2

I have two sparse general matrices stored in CSR format I need to multiply. Is there any chance to gain performance using AVX2? In general the matrices are big (hundreds of millions of non-zeros and ...
1
vote
1answer
126 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
0answers
45 views

Solve the 1D Poisson equation by integrate twice the charge density

Let's say I have a set of data (1-D array) called charge density along the $z$ direction (obtained from DFT calculation), and I want to integrate it twice with respect to $z$ coordinates points (i.e., ...
-1
votes
0answers
11 views

How to detect fraud rows given possible states? [closed]

Suppose we have a database with attributes Player_ID, Source_of_app, Post_install_activity. Post_install_activity includes 4 possible actions (e.g. "install", "lvl_reached_3", "lvl_reached_5", "...
1
vote
0answers
18 views

Optimality conditions for optimal control: BVP - DAE

I am solving an optimal control problem of the form $$ \min_u \qquad\int_0^T \langle u(t), u(t) \rangle \, \mathrm{d}t \\ s.t. \quad \dot{x} = \tilde{f}(x) + u, \quad x(0)=x_0 \\ \qquad \tilde{\Phi}(...
2
votes
1answer
332 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
0answers
26 views

First-principles benchmark of CFD solver

A decade ago I saw a ~20 coupled state + random number problem that was used as a benchmark for meteorological CFD tools. It had a fractal dimension (of the chaotic attractor) around 2.3, I think. I ...
0
votes
1answer
114 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} + ...
7
votes
1answer
96 views

Numerically stable and fast sum of last K elements in sequence

Suppose I have a long, possibly infinite, sequence $x := [x_1, x_2, ...]$, and I want to use it to compute another sequence $y:=[y_1, y_2, ...]$ where each element is the sum of the last K elements of ...
-1
votes
0answers
27 views

Linear advection equation: 1D wave with reflection at boundaries (solid walls)

I recently asked a question about this topic, but too much was unclear to me at the time which yielded poor response. (You can find the previous question here). Anyway, I am now trying to solve the ...
1
vote
0answers
35 views

Inverse Newton Method for optimization: is this the correct algorithm?

I am trying to implement the algorithm in this article. I have already asked a question before about it here, and I am trying to figure out what I am doing wrong. This time, it's this section of the ...
5
votes
1answer
42 views

Is there an efficient algorithm for calculation of continued fraction expansion from decimal digits?

Suppose to calculate the continued fraction expansion of $\pi$, the common-sense algorithm would be to take the decimal part, perform inversion, which will give the next term as integer part, and the ...
3
votes
0answers
35 views

Spectral solver on em-pic

I'm recently studying for the spectral solver to implement EM-PIC code. I read an article and have some questions. Many PIC codes uses spectral solver to overcome numerical artifacts on FDTD. In the ...
0
votes
1answer
38 views

Is this behaviour normal for a Leonard Jones monte carlo simulation?

I am simulating a Leonard Jones fluid using MC simulation. The code always uses a reduced unit. I want to find the potential energy of the system.Periodic boundary condition implemented . I have ...
1
vote
1answer
65 views

What is the maximum attainable accuracy with a given set of $\alpha,\beta$?

I am using LeVeque's book: https://faculty.washington.edu/rjl/fdmbook/ Suppose I want to compute $u''$ using FDM with $\alpha=\beta=2$ (centered) so the FDM is $$ u''=\sum_{m = - \alpha}^\beta a_mu(...
-1
votes
0answers
45 views

Solving ODE for Mosquito Densities

I am trying to calculate the densities of mosquitoes at different life cycle stages. I want to use historical weather data (such as air and water temperature) and compare the results of the model to ...
-1
votes
0answers
34 views

Computing node, cell and face incidence in 3D structured meshes

I'm developing a PDE discretization algorithm that works on 3D uniform structured meshes. For this algorithm, I often have to traverse the mesh nodes and get the ids of all the faces and all the cells ...
-1
votes
1answer
32 views

How to get free energy surface of a 3d Ising Spin system using Monte Carlo simulation?

I am doing a Monte Carlo Simulation of the properties of a 3D Ising Spin system. I want to get the free energy surface of the spin system from the simulation. It is a magnetization vs free energy ...
1
vote
0answers
67 views

Linearize non-linear PDE with BCs to hyperbolic problem: How does linearization affect BCs?

I am working with the Shallow Water equations that is a system of non-linear PDEs that simulate water waves propagation on some domain, in my cases the $x$-axis. I have here a GIF showing the results (...
2
votes
1answer
74 views

Solving ODEs with nonlinear constraints

I'm trying to solve an ODE problem. Let's say $\mathbf{x}(t)$ represents the position of a particle at time $t$, and $\mathbf{u}(\mathbf{x},t)$ is a velocity field defined in Cartesian coordinates on ...
-1
votes
0answers
26 views

Pseudocode for implementing Tunneling Algorithm

I‘m searching for coding examples (Python, matlab, C++, ...) of the tunneling algorithm for finding global minimums in terms of Optimization. Even though some Users have claimed to implement the ...
3
votes
0answers
100 views

Automatically generate constraints for trajectory optimization

This is a follow up to my previous post here I'm interested in performing trajectory optimization from the problem mentioned in abov link. I want to supply the following as dynamical constraints to ...
4
votes
0answers
122 views

Explanation of subspace strategy regarding CG described in Golub's book

I was wondering about the last paragraph in Matrix Computations (4th edition) by Golub, Chapter 11 (11.3.3), specifically his explanation of subspace strategy for Conjugate Gradient. Note that in ...
0
votes
0answers
22 views

Question regarding OpenFOAM objectRegistry and related subjects [closed]

I am trying to understand objectRegistry, IOobject, regIOobject, etc in OpenFOAM and I have already gone through the wiki pages. They have cleared some of the doubts but not all. Questions regarding ...
0
votes
1answer
57 views

Why the magnetisation shows abrupt behaviour for this 3D ising spin system

I am trying to simulate a 3D Ising spin system (+1 & -1) using Monte Carlo Metropolis Algorithm. I want to get different physical quantities from this simulation like magnetization, Average Energy,...
1
vote
2answers
95 views

Solving a parameter estimation problem using trajectory optimization

This is a follow-up to my previous question here I've the following system of equations for studying information flow in the below graph, $$ \frac{d \phi}{dt} = -M^TDM\phi + \text{noise ...
0
votes
0answers
37 views

2D diffusion equation using Finite Volume Method

i am working on an assignment problem: Consider a two-dimensional rectangular plate of dimension L = 1 m in the x direction and H = 2 m in the y direction. The plate material has constant thermal ...
5
votes
0answers
63 views

Efficient way to find eigenvalues of complex symmetric matrix with real off-diagonal elements

My goal is to find all eigenvalues (and eigenvectors) in a given range of magnitudes of a complex symmetric matrix with real off-diagonal elements (only diagonal elements are complex). Currently I'm ...

15 30 50 per page
1
2 3 4 5
172