Skip to content

Instantly share code, notes, and snippets.

@nmayorov
nmayorov / könig_vs_kasdin.ipynb
Created October 20, 2019 11:21
Colored noise generators comparison
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / colored_noise.py
Created June 30, 2019 16:28
Algorithm for colored noise generation
"""Generate colored noise."""
from __future__ import absolute_import, division, print_function
import numpy as np
from scipy.fftpack import rfft, irfft
from scipy.signal import fftconvolve
from scipy._lib._util import check_random_state
def _generate_fir_coefficients(exponent, n_samples):
h = np.empty(n_samples)
@nmayorov
nmayorov / bvp_benchmark.ipynb
Last active November 17, 2023 19:59
BVP benchmarks with boundary condition tolerance check
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / test_rotation_spline.ipynb
Created August 5, 2018 17:32
RotationSpline test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / canonical_constraint.py
Created February 1, 2018 10:05
Canonical constraint implementation for scipy.optimize
class CanonicalConstraint(object):
def __init__(self, n_eq, n_ineq, fun, jac, hess, keep_feasible):
self.n_eq = n_eq
self.n_ineq = n_ineq
self.fun = fun
self.jac = jac
self.hess = hess
self.keep_feasible = keep_feasible
@classmethod
@nmayorov
nmayorov / test_errors.ipynb
Created January 21, 2018 12:02
Interpolation errors of ODE solvers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / mc_simulation.ipynb
Last active November 15, 2017 21:32
LC phase transition Monte-Carlo simulation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / elec.py
Last active August 15, 2018 13:03
"ELEC" nonlinear optimization problem definition
import numpy as np
from scipy.linalg import block_diag
class ProblemELEC:
def __init__(self, n_electrons, random_state=0):
self.n_electrons = n_electrons
self.rng = np.random.RandomState(random_state)
def x0(self):
@nmayorov
nmayorov / compare_cython_with_solve_ivp.ipynb
Created December 1, 2016 16:49
Comparison of Python and Cython ODE integration
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nmayorov
nmayorov / profile_cython.ipynb
Created November 16, 2016 11:36
Profile with Cython complied function in ODE solvers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.