#!/usr/bin/env python # coding: utf-8 # Kuramoto-Sivashinsky equation (KSE) # ================= # # KSE is a representative example of spatio-temporal chaos [1]. # # $$ # \frac{\partial u}{\partial t} # + u \frac{\partial u}{\partial x} # + \frac{\partial^2 u}{\partial x^2} # + \frac{\partial^4 u}{\partial x^4} # = 0 # $$ # # [1]: http://www.springer.com/us/book/9783642696916 # In[1]: get_ipython().run_line_magic('matplotlib', 'inline') import pandas as pd import matplotlib.pyplot as plt # In[2]: get_ipython().system(' cat examples/kse.rs') # In[3]: get_ipython().system(' cargo run --release --example kse > kse.csv') # In[4]: df = pd.read_csv("kse.csv", header=None).set_index(0) # In[5]: plt.figure(figsize=(10, 10)) plt.imshow(df, interpolation="bilinear") plt.ylabel("time", fontsize=20) plt.savefig("kse.png")