All Questions

Filter by
Sorted by
Tagged with
-2
votes
0answers
22 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}...
-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. <...
-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
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 ...
0
votes
0answers
29 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
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
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 ...
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
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}(...
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 ...
-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
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 ...
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 ...
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 ...
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
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(...
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}{...
-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 ...
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
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
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
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 ...
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 ...
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
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 ...
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,...
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 ...
2
votes
0answers
33 views

Lexicographically order matrix into a vector

I am trying to implement the algorithm contained in this article here. It is about solving a 2 and 2.5D Fredholm integral, focused on bidimensional NMR experiments. I've made significant progress, ...
-1
votes
2answers
45 views

2d Schrodinger Equation via matrix diagonalization in C

I am trying to solve the time-independent Schrodinger equation in two dimensions via discrete matrix diagonalization. I want the energy eigenvalues and the corresponding eigenfunctions for a given ...
-1
votes
0answers
20 views

How can I compute electronic coupling 'H' for estimating the standard rate k_o from Marcus-Hush-Chidsey theory during heterogenous electron transfer?

I am trying to calculate the Marcus-Hush rate constant k_o for heterogeneous electron transfer in the context of a monolayer redox couple as described in Eq. (11) in this paper [ doi:10.1016/j....
1
vote
0answers
56 views

Compute mass matrix in vibrations problem by using finite element method

I have to compute the mass matrix of a Hexahedral mesh. There are 3 methods to compute mass matrix. I'm interested in one method which consists of dividing the mass of the element by the number of ...
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 ...
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 (...
-1
votes
0answers
28 views

Why does torque kill my Job? [closed]

I am using PBS Torque scheduler to run my replica exchange molecular dynamics jobs. I am using Sander.MPI of AMBER to run some DFTB simulations. The problem I am having is that my jobs keep crashing ...
-2
votes
0answers
37 views

How do I use Newton's Method to Solve this semilinear equation?

I have a semilinear system $$\frac{du}{dx} = -\lambda u(x)$$ With boundary conditions $$u(0) = C$$ $$u(L) = Ce^{-\lambda L}$$ Below is my attempt at Newton's method. The logic is i) Use a central-...
2
votes
0answers
29 views

Convergent Finite Difference Scheme for Parabolic Equation

Consider the PDE $$u_t = b_{11}u_{xx} + 2b_{12}u_{xy} + b_{22}u_{yy},$$ where $b_{11}, b_{22} > 0$, and $b_{12}^2 < b_1b_2$. In Strikwerda's book, the ADI scehme \begin{align*} \left( 1 - \frac{...
4
votes
1answer
112 views

Absence of Discontinuity in Specific Heat Plot Simulated by Ising Model

I am working on 2D Ising model, when I plot "specific heat vs temperature", I can't see any discontinuity at critical temperature around Tc ~ 2.7K. I am enclosing results of all other thermodynamic ...
2
votes
1answer
46 views

Best ways to avoid singularities in kernels when solving integral equations numerically

Take a Fredholm integral equation $$ u(x) - \lambda \int_{-1}^{1} K(x,y)u(y) \, \mathrm{d} y = f(x) $$ and discretize it via (say) Gaussian quadrature with nodes $\{x_j\}$ and weights $\{w_j\}$ to get ...
0
votes
0answers
26 views

Prerequisites to understand Line Integral Convolution paper

I am learning techniques like line integral convolution to visualize vector fields in Python and want to make an implementation myself. However. I have no experience with texture advection methods. ...
0
votes
0answers
100 views

Creating positive definite matrix

I'm trying to create a big (50.000x50.000) positive definite correlation matrix . The matrix should be correlations of effects on phenotypes ascribable to people sharing the same environment. I have ...
0
votes
1answer
35 views
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 ...

15 30 50 per page
1
2 3 4 5
172