<jupyter_start><jupyter_text>Demo: Van der Pol Oscillator  created by <NAME>, 11/21/18<jupyter_code>import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
    sys.path.append(module_path)
from pySINDy.sindy import SINDy
import numpy as np
import matplotlib.pyplot as plt
from pySINDy.utils.generator import van_der_pol_generator<jupyter_output><empty_output><jupyter_text>Set parameters to initialize the Van der Pol system<jupyter_code>mu = 1.2
xinit = [0.1, 5.0]
dt = 0.01
len_t = 100<jupyter_output><empty_output><jupyter_text>generate Van der Pol oscillator<jupyter_code>data = van_der_pol_generator(mu, xinit, dt, len_t)<jupyter_output><empty_output><jupyter_text>use SINDy model to fit the data and find coefficients<jupyter_code>model = SINDy(name='my_sindy_model')
model.fit(data, dt, poly_degree=3, cut_off=0.01)<jupyter_output>/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/findiff/findiff.py:242: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
  yd[ref_multi_slice] += w * y[off_multi_slice]<jupyter_text>display coefficients and corresponding term to the coefficients<jupyter_code>model.coefficients
model.descriptions
model.plot_coefficients<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10215053763440861, 'fraction_numerical': 0.019489247311827957, 'mean_word_length': 7.136612021857924, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '171709', 'license': 'MIT', 'n_tokens_mistral': 545, 'n_tokens_neox': 516, 'n_words': 124, 'path': 'examples/example-1-sindy-vanderpol.ipynb', 'repo_name': 'erma0x/pySINDy', 'size': '1492'}