Last active
May 2, 2019 04:35
-
-
Save marekyggdrasil/17f61c8defdeaec4bf99e928b961f385 to your computer and use it in GitHub Desktop.
I encountered a problem related to usage of lambda functions to pass extra arguments to initial value problem solved from SciPy while used inside of Jupyter notebook environment. Perhaps someone more experienced with Jupyter could help out in the comments.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.integrate import solve_ivp | |
import numpy as np | |
def exponential_decay(t, y, alpha, beta): return -alpha*y + beta | |
for alpha in np.linspace(0.5, 0.7, 5) : | |
beta = 1. | |
sol = solve_ivp(lambda t, y: exponential_decay(t, y, alpha, beta), [0, 10], [2, 4, 8]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment