Skip to content

Commit

Permalink
Added and (I believe) fixed all the binder links for all the example …
Browse files Browse the repository at this point in the history
…notebooks.
  • Loading branch information
Alan Kaptanoglu authored and Alan Kaptanoglu committed Dec 5, 2021
1 parent 01a0bf9 commit dfcdb37
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 47 deletions.
7 changes: 5 additions & 2 deletions examples/10_PDEFIND_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"# PDEFIND Feature Overview\n",
"SINDy was originally used to discover systems of ordinary differential equations (ODEs) but was quickly extended to search partial differential equations (PDEs), since many systems exhibit dependence in both space and time. \n",
"\n",
"This notebook provides a simple overview of the PDE functionality of PySINDy, following the examples in the PDE-FIND paper (Rudy, Samuel H., Steven L. Brunton, Joshua L. Proctor, and J. Nathan Kutz. \"Data-driven discovery of partial differential equations.\" Science Advances 3, no. 4 (2017): e1602614.). Jupyter notebook written by Alan Kaptanoglu."
"This notebook provides a simple overview of the PDE functionality of PySINDy, following the examples in the PDE-FIND paper (Rudy, Samuel H., Steven L. Brunton, Joshua L. Proctor, and J. Nathan Kutz. \"Data-driven discovery of partial differential equations.\" Science Advances 3, no. 4 (2017): e1602614.). Jupyter notebook written by Alan Kaptanoglu.\n",
"\n",
"An interactive version of this notebook is available on binder\n",
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/10_PDEFIND_examples.ipynb)"
]
},
{
Expand Down Expand Up @@ -1465,7 +1468,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
27 changes: 5 additions & 22 deletions examples/11_SSR_FROLS_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
"cells": [
{
"cell_type": "markdown",
"id": "f2c6fdd0",
"metadata": {},
"source": [
"### SSR and FROLs (the greedy algorithms!) examples\n",
"There are many algorithms to solve the SINDy regression problem. SSR and FROLs are two popular greedy algorithms. Greedy algorithms iteratively truncate model coefficients, and search for the best model, based on some metric for success. These models work well in practice, but may have weak local convergence and may lack other algorithm guarantees. \n",
"\n",
"SSR algorithm based on Boninsegna, L., Nüske, F., & Clementi, C. (2018). Sparse learning of stochastic dynamical equations. The Journal of chemical physics, 148(24), 241723 and FROLS algorithm based on Billings, S. A. (2013). Nonlinear system identification: NARMAX methods in the time, frequency, and spatio-temporal domains. John Wiley & Sons.\n",
"Jupyter notebook written by Alan Kaptanoglu and Jared Callaham."
"Jupyter notebook written by Alan Kaptanoglu and Jared Callaham.\n",
"\n",
"An interactive version of this notebook is available on binder\n",
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/11_SSR_FROLS_examples.ipynb)"
]
},
{
"cell_type": "markdown",
"id": "2d117798",
"metadata": {},
"source": [
"Stepwise sparse regression (SSR) solves the problem by iteratively truncating the smallest coefficient during the optimization. There are many ways one can decide to truncate terms. We implement two popular ways: (1) truncating the smallest coefficient at each iteration; (2) chopping each coefficient, computing N - 1 models, and then choosing the model with the lowest residual error."
Expand All @@ -23,7 +24,6 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "af60b9cd",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -53,7 +53,6 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "c6a2adb0",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -96,7 +95,6 @@
},
{
"cell_type": "markdown",
"id": "7b2a932b",
"metadata": {},
"source": [
"### Define some functions for plotting performance as the greedy algorithms progress"
Expand All @@ -105,7 +103,6 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "7b57f140",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -184,7 +181,6 @@
},
{
"cell_type": "markdown",
"id": "f5dd9011",
"metadata": {},
"source": [
"### Note that the usage is a bit different because we save all the sparse models and we choose our favorite one afterwards. Below we show that we can track the MSE between the predicted and true derivative on a testing trajectory as the algorithm iterates, and then choose the model with the minimum MSE. "
Expand All @@ -193,7 +189,6 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "73ac8fb3",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -268,7 +263,6 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "0eda8aed",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -307,7 +301,6 @@
},
{
"cell_type": "markdown",
"id": "ed87b7b7",
"metadata": {},
"source": [
"Note that some of the frames do not have any red lines... that means the model for this iteration resulted in an unstable model when it was integrated forward. This often happens with nonsparse models!\n",
Expand All @@ -318,7 +311,6 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "7ff558fb",
"metadata": {},
"outputs": [
{
Expand All @@ -343,7 +335,6 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "e9ff19e5",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -412,7 +403,6 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "8c394722",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -450,7 +440,6 @@
},
{
"cell_type": "markdown",
"id": "dd5126c4",
"metadata": {},
"source": [
"# FROLS greedy algorithm\n",
Expand All @@ -461,7 +450,6 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "74f00770",
"metadata": {
"scrolled": true
},
Expand Down Expand Up @@ -489,7 +477,6 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "ed98bf66",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -558,7 +545,6 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "9bda98c0",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -596,7 +582,6 @@
},
{
"cell_type": "markdown",
"id": "1f0ef282",
"metadata": {},
"source": [
"### Let's compare all three methods as the noise steadily increases, cross-validated over 10 noise instantiations"
Expand All @@ -605,7 +590,6 @@
{
"cell_type": "code",
"execution_count": 12,
"id": "3970b7fa",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -687,7 +671,6 @@
},
{
"cell_type": "markdown",
"id": "aa3336b4",
"metadata": {},
"source": [
"### Summary\n",
Expand All @@ -711,7 +694,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
7 changes: 5 additions & 2 deletions examples/12_weakform_SINDy_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"# Weak/Integral SINDy Feature Overview\n",
"It is often difficult to identify dynamical systems in the presence of substantial noise. Towards that end, a number of publications have used SINDy to identify the weak-formulation (integral formulation) of the system of ODEs or PDEs. This allows one to avoid taking high-order derivatives of noisy data (high-order derivatives of noisy data will amplify the noise). \n",
"\n",
"This notebook provides a simple overview of the weak form PDE functionality of PySINDy, following the examples in the PDE-FIND paper (Rudy, Samuel H., Steven L. Brunton, Joshua L. Proctor, and J. Nathan Kutz. \"Data-driven discovery of partial differential equations.\" Science Advances 3, no. 4 (2017): e1602614) and Reinbold, P. A., Gurevich, D. R., & Grigoriev, R. O. (2020). Using noisy or incomplete data to discover models of spatiotemporal dynamics. Physical Review E, 101(1), 010203. Jupyter notebook written by Alan Kaptanoglu."
"This notebook provides a simple overview of the weak form PDE functionality of PySINDy, following the examples in the PDE-FIND paper (Rudy, Samuel H., Steven L. Brunton, Joshua L. Proctor, and J. Nathan Kutz. \"Data-driven discovery of partial differential equations.\" Science Advances 3, no. 4 (2017): e1602614) and Reinbold, P. A., Gurevich, D. R., & Grigoriev, R. O. (2020). Using noisy or incomplete data to discover models of spatiotemporal dynamics. Physical Review E, 101(1), 010203. Jupyter notebook written by Alan Kaptanoglu.\n",
"\n",
"An interactive version of this notebook is available on binder\n",
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/12_weakform_SINDy_examples.ipynb)"
]
},
{
Expand Down Expand Up @@ -1546,7 +1549,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
5 changes: 4 additions & 1 deletion examples/13_ensembling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"\n",
"This notebook provides an overview of the basic and advanced functionality of using ensemble methods in PySINDy. Ensembling robustifies the SINDy method. Written by Alan Kaptanoglu and Urban Fasel. \n",
"\n",
"An interactive version of this notebook is available on binder\n",
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/13_ensembling.ipynb)\n",
"\n",
"There are many variants of ensembling/subsampling strategies and post-processing methods. We will show the following useful variants below: <br> <br>\n",
"Ensembling: <br>\n",
"**V1: Sample $n_\\text{subset}$ of the data time series with replacement, generate $n_\\text{models}$ <br>\n",
Expand Down Expand Up @@ -1070,7 +1073,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
5 changes: 4 additions & 1 deletion examples/14_cavity_flow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"\n",
"This Jupyter notebook example is written by Jared Callaham and demonstrates the use of SINDy to learn a model for the quasiperiodic dynamics in a shear-driven cavity at Re=7500, following [Callaham, Brunton, and Loiseau (2021)](https://arxiv.org/abs/2106.02409). It will focus on working through a relatively involved fluid dynamics example, rather than comparing optimizers, libraries, etc. This example also includes some other more advanced SINDy \"tricks\" like using dynamic mode decomposition to rotate the generalized coordinates and co-opting some of the SINDy infrastructure to perform nonlinear dimensionality reduction.\n",
"\n",
"An interactive version of this notebook is available on binder\n",
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/14_cavity_flow.ipynb)\n",
"\n",
"As in the cylinder wake example (see notebook 3), the reduced-order model appproximates the 2D time-varying velocity field $\\mathbf{u}(\\mathbf{x}, t)$ with the POD expansion\n",
"$$\n",
"\\mathbf{u}(\\mathbf{x}, t) = \\sum_{j=1}^r \\boldsymbol{\\psi}_j(\\mathbf{x}) a_j(t).\n",
Expand Down Expand Up @@ -1034,7 +1037,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
6 changes: 5 additions & 1 deletion examples/15_pysindy_lectures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
"source": [
"# Summary of PySINDy YouTube tutorial videos\n",
"\n",
"This notebook is a summary of the PySINDy YouTube lectures found here. These examples show how to use the SINDy method in practice, addressing the following practical questions:\n",
"This notebook is a summary of the PySINDy YouTube lectures found [here](https://www.youtube.com/playlist?list=PLN90bHJU-JLoOfEk0KyBs2qLTV7OkMZ25). \n",
"An interactive version of this notebook is available on binder\n",
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/15_pysindy_lectures.ipynb)\n",
"\n",
"These examples show how to use the SINDy method in practice, addressing the following practical questions:\n",
"1. #### How does one choose the thresholding parameter $\\lambda$?\n",
"2. #### How to make SINDy more robust? <br>\n",
" a) Smoothing and more robust derivatives <br>\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/1_feature_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
},
"source": [
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.4.3?filepath=examples/1_feature_overview.ipynb)"
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/1_feature_overview.ipynb)"
]
},
{
Expand Down Expand Up @@ -2703,7 +2703,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions examples/2_introduction_to_sindy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.4.3?filepath=examples/2_introduction_to_sindy.ipynb)"
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/2_introduction_to_sindy.ipynb)"
]
},
{
Expand Down Expand Up @@ -454,7 +454,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions examples/3_original_paper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.4.3?filepath=examples/3_original_paper.ipynb)"
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/3_original_paper.ipynb)"
]
},
{
Expand Down Expand Up @@ -1302,7 +1302,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions examples/4_scikit_learn_compatibility.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.4.3?filepath=examples/4_scikit_learn_compatibility.ipynb)"
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/4_scikit_learn_compatibility.ipynb)"
]
},
{
Expand Down Expand Up @@ -397,7 +397,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions examples/5_differentiation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.4.3?filepath=examples/5_differentation.ipynb)"
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/5_differentation.ipynb)"
]
},
{
Expand Down Expand Up @@ -793,7 +793,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions examples/6_deeptime_compatibility.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.4.3?filepath=examples/6_deeptime_compatibility.ipynb)"
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/6_deeptime_compatibility.ipynb)"
]
},
{
Expand Down Expand Up @@ -202,7 +202,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down
4 changes: 2 additions & 2 deletions examples/7_plasma_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.4.3?filepath=examples/7_plasma_examples.ipynb)"
"[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dynamicslab/pysindy/v1.5.1?filepath=examples/7_plasma_examples.ipynb)"
]
},
{
Expand Down Expand Up @@ -1920,7 +1920,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
},
"toc": {
"base_numbering": 1,
Expand Down

0 comments on commit dfcdb37

Please sign in to comment.