<jupyter_start><jupyter_text>相図のプロットOriginal code made by Prof. Kinefuchi$$\begin{cases}    \dot{x}_{1}=x_1-2x_2+1 \\    \dot{x}_{2}=x_1-x_2+3\end{cases}$$<jupyter_code>import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>微分方程式の定義<jupyter_code># Ridht-hand side of the differential equation
def rhs(t,x):
    dx1 = x[0] - 2.0 * x[1] + 1.0
    dx2 = x[0] - x[1] + 3.0
    dxdt = [dx1,dx2]
    return dxdt<jupyter_output><empty_output><jupyter_text>初期値の設定<jupyter_code># initial condition
x_ini = [[-5,-7],[-5,-6],[-5,-5],[-5,-4],[-5,-3],[-5,-2],[-
5,-1],[-5,0]]
# Interval of integration
t_span=[0,100]<jupyter_output><empty_output><jupyter_text>微分方程式解法<jupyter_code># Integration for each initial condition
for xi in x_ini:
    sol = solve_ivp(rhs,t_span,xi,rtol=1e-10,atol=1e-10)
    x1 = sol.y[0,:]
    x2 = sol.y[1,:]
    plt.plot(x1,x2,'b-')

    # Figure
plt.xlabel('x1')
plt.ylabel('x2')
plt.axis('equal')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19398642095053345, 'fraction_numerical': 0.055286129970902036, 'mean_word_length': 5.070588235294117, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '79372', 'license': 'MIT', 'n_tokens_mistral': 509, 'n_tokens_neox': 494, 'n_words': 70, 'path': 'Math/ODE Phase diagram/phase_diagram_python.ipynb', 'repo_name': 'stakum/Lecture_Materials', 'size': '1031'}