[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XGKJH38S0H33N3F3ER8V4D":3,"skill-same:01M6XGKJH38S0H33N3F3ER8V4D":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":14,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":59,"install":60,"resources":73},"01M6XGKJH38S0H33N3F3ER8V4D","dynamical-systems",null,"Analyze nonlinear dynamical systems — phase portraits, fixed points, stability analysis, bifurcation diagrams, Poincare sections, Lyapunov exponents, and chaos detection. Use for any autonomous or non-autonomous ODE system where qualitative behavior matters.","fadrienne\u002FMyGitHub","fadrienne","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F197874571?v=4","01M6X64V8VWCRSMFZ4EPS2BWXG","Francesca Adrienne","01M6X64VD5MW4F9PHDWQKS7ZAF",0,"MIT","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fopenscience\u002Fbackend\u002Fcli\u002Fskills\u002Fphysics\u002Fdynamical-systems\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"Dynamical Systems","systems","portrait","Nonlinear","Bifurcation","Phase Portrait","phase","for","synthetic","ode","analysis","physics","scipy","numpy","diagrams","use","autonomous","analyze","system","matplotlib","2026-11-10 10:12:30",false,"---\nname: dynamical-systems\ndescription: Analyze nonlinear dynamical systems — phase portraits, fixed points, stability analysis, bifurcation diagrams, Poincare sections, Lyapunov exponents, and chaos detection. Use for any autonomous or non-autonomous ODE system where qualitative behavior matters.\ncategory: physics\nversion: 1.0.0\nauthor: Synthetic Sciences\nlicense: MIT\ntags: [Dynamical Systems, Phase Portrait, Bifurcation, Chaos, Lyapunov, Stability, Nonlinear]\ndependencies: [\"scipy>=1.11.0\", \"numpy>=1.24.0\", \"matplotlib>=3.7.0\"]\n---\n\n# Dynamical Systems Analysis\n\n## Overview\n\nQualitative and quantitative analysis of nonlinear dynamical systems. Phase portraits, fixed point classification, stability analysis, bifurcation diagrams, Poincare sections, and Lyapunov exponent computation.\n\n## When to Use\n\n- Visualizing flow in phase space (2D and 3D systems)\n- Finding and classifying fixed points (stable\u002Funstable nodes, spirals, saddles, centers)\n- Bifurcation analysis (how qualitative behavior changes with parameters)\n- Detecting chaos (Lyapunov exponents, sensitivity to initial conditions)\n- Poincare sections for periodicity analysis\n- Limit cycle detection and characterization\n\n## Core Workflows\n\n### 1. Phase Portrait (2D System)\n\n```python\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.integrate import solve_ivp\n\ndef system(t, y, mu=1.0):\n    \"\"\"Van der Pol oscillator\"\"\"\n    x, v = y\n    return [v, mu * (1 - x**2) * v - x]\n\n# Vector field on a grid\nx_range = np.linspace(-4, 4, 20)\nv_range = np.linspace(-6, 6, 20)\nX, V = np.meshgrid(x_range, v_range)\nU = V\nW = 1.0 * (1 - X**2) * V - X\n\nfig, ax = plt.subplots(figsize=(10, 8))\n\n# Streamlines\nax.streamplot(X, V, U, W, density=1.5, color='gray', linewidth=0.5, arrowsize=1)\n\n# Sample trajectories from different ICs\ncolors = plt.cm.viridis(np.linspace(0, 1, 6))\nfor i, ic in enumerate([[0.1, 0], [3, 0], [0, 4], [-2, -3], [1, -5], [4, 4]]):\n    sol = solve_ivp(system, (0, 30), ic, t_eval=np.linspace(0, 30, 3000),\n                    rtol=1e-10, atol=1e-12)\n    ax.plot(sol.y[0], sol.y[1], color=colors[i], linewidth=1.2)\n    ax.plot(ic[0], ic[1], 'o', color=colors[i], markersize=6)\n\n# Fixed points\nax.plot(0, 0, 'rx', markersize=12, markeredgewidth=3, label='Unstable fixed point')\n\nax.set_xlabel('x', fontsize=13)\nax.set_ylabel('dx\u002Fdt', fontsize=13)\nax.set_title('Van der Pol Oscillator Phase Portrait (μ=1)', fontsize=14)\nax.legend(fontsize=11)\nax.grid(True, alpha=0.3)\nplt.savefig('phase_portrait.png', dpi=150, bbox_inches='tight')\n```\n\n### 2. Fixed Point Analysis\n\n```python\nfrom scipy.optimize import fsolve\n\ndef rhs(y, mu=1.0):\n    \"\"\"Autonomous system: dy\u002Fdt = f(y)\"\"\"\n    x, v = y\n    return [v, mu * (1 - x**2) * v - x]\n\ndef jacobian(y, mu=1.0):\n    \"\"\"Jacobian matrix J_ij = df_i\u002Fdy_j\"\"\"\n    x, v = y\n    return np.array([\n        [0, 1],\n        [-2*mu*x*v - 1, mu*(1 - x**2)]\n    ])\n\n# Find fixed points\ny_guess = [0, 0]\nfp = fsolve(rhs, y_guess)\nprint(f\"Fixed point: ({fp[0]:.4f}, {fp[1]:.4f})\")\n\n# Classify via eigenvalues of Jacobian\nJ = jacobian(fp)\neigenvalues = np.linalg.eigvals(J)\nprint(f\"Eigenvalues: {eigenvalues}\")\n\n# Classification logic\ndef classify_fixed_point(eigenvalues):\n    real_parts = eigenvalues.real\n    imag_parts = eigenvalues.imag\n\n    if np.all(np.abs(imag_parts) \u003C 1e-10):\n        # Real eigenvalues\n        if np.all(real_parts \u003C 0):\n            return \"Stable node\"\n        elif np.all(real_parts > 0):\n            return \"Unstable node\"\n        else:\n            return \"Saddle point\"\n    else:\n        # Complex eigenvalues\n        if np.all(real_parts \u003C 0):\n            return \"Stable spiral\"\n        elif np.all(real_parts > 0):\n            return \"Unstable spiral\"\n        else:\n            return \"Center\"\n\nprint(f\"Classification: {classify_fixed_point(eigenvalues)}\")\n```\n\n### 3. Bifurcation Diagram\n\n```python\ndef logistic_map_bifurcation(r_range, n_discard=500, n_plot=200):\n    \"\"\"Bifurcation diagram for the logistic map x_{n+1} = r * x_n * (1 - x_n)\"\"\"\n    r_values = []\n    x_values = []\n\n    for r in r_range:\n        x = 0.5  # initial condition\n        # Discard transients\n        for _ in range(n_discard):\n            x = r * x * (1 - x)\n        # Collect steady-state iterates\n        for _ in range(n_plot):\n            x = r * x * (1 - x)\n            r_values.append(r)\n            x_values.append(x)\n\n    return np.array(r_values), np.array(x_values)\n\nr_range = np.linspace(2.5, 4.0, 2000)\nr_vals, x_vals = logistic_map_bifurcation(r_range)\n\nfig, ax = plt.subplots(figsize=(12, 7))\nax.scatter(r_vals, x_vals, s=0.01, c='black', alpha=0.5)\nax.set_xlabel('r', fontsize=13)\nax.set_ylabel('x*', fontsize=13)\nax.set_title('Logistic Map Bifurcation Diagram', fontsize=14)\nax.grid(True, alpha=0.2)\nplt.savefig('bifurcation.png', dpi=200, bbox_inches='tight')\n```\n\nFor continuous systems, use numerical continuation:\n\n```python\ndef continuous_bifurcation(rhs_func, param_range, y_init, param_name='mu'):\n    \"\"\"\n    Simple parameter continuation for fixed point bifurcations.\n    Tracks fixed points as a parameter varies.\n    \"\"\"\n    fixed_points = []\n    stabilities = []\n    y_guess = y_init\n\n    for param in param_range:\n        fp = fsolve(lambda y: rhs_func(y, param), y_guess, full_output=True)\n        if fp[2] == 1:  # converged\n            y_guess = fp[0]  # use as next guess\n            # Compute stability\n            J = np.zeros((len(y_guess), len(y_guess)))\n            eps = 1e-8\n            f0 = np.array(rhs_func(y_guess, param))\n            for j in range(len(y_guess)):\n                y_pert = y_guess.copy()\n                y_pert[j] += eps\n                J[:, j] = (np.array(rhs_func(y_pert, param)) - f0) \u002F eps\n            eigs = np.linalg.eigvals(J)\n            stable = np.all(eigs.real \u003C 0)\n            fixed_points.append(y_guess.copy())\n            stabilities.append(stable)\n        else:\n            fixed_points.append(np.full_like(y_guess, np.nan))\n            stabilities.append(False)\n\n    return np.array(fixed_points), np.array(stabilities)\n```\n\n### 4. Lyapunov Exponent (Variational Method)\n\n```python\ndef largest_lyapunov(rhs, y0, t_total=100, dt_renorm=1.0, rtol=1e-10):\n    \"\"\"\n    Compute largest Lyapunov exponent via variational equations.\n    Method: Benettin et al. (1980), Wolf et al. (1985).\n    \"\"\"\n    n = len(y0)\n\n    def rhs_with_variational(t, Y):\n        y = Y[:n]\n        delta = Y[n:2*n]\n        dydt = np.array(rhs(t, y))\n        # Numerical Jacobian\n        eps = 1e-8\n        J = np.zeros((n, n))\n        f0 = dydt\n        for j in range(n):\n            y_pert = np.array(y)\n            y_pert[j] += eps\n            J[:, j] = (np.array(rhs(t, y_pert)) - f0) \u002F eps\n        ddelta_dt = J @ delta\n        return np.concatenate([dydt, ddelta_dt])\n\n    # Random initial tangent vector\n    np.random.seed(42)\n    delta0 = np.random.randn(n)\n    delta0 \u002F= np.linalg.norm(delta0)\n    Y = np.concatenate([y0, delta0])\n\n    lyap_sum = 0.0\n    n_steps = int(t_total \u002F dt_renorm)\n    running = []\n\n    for i in range(n_steps):\n        t0, t1 = i * dt_renorm, (i + 1) * dt_renorm\n        sol = solve_ivp(rhs_with_variational, (t0, t1), Y,\n                        method='RK45', rtol=rtol, atol=rtol*1e-2)\n        Y = sol.y[:, -1]\n        norm = np.linalg.norm(Y[n:2*n])\n        lyap_sum += np.log(norm)\n        Y[n:2*n] \u002F= norm\n        running.append(lyap_sum \u002F ((i+1) * dt_renorm))\n\n    lambda_max = lyap_sum \u002F t_total\n    return lambda_max, running\n\n# Example: Lorenz system\ndef lorenz(t, y, sigma=10, rho=28, beta=8\u002F3):\n    x, y_, z = y\n    return [sigma*(y_-x), x*(rho-z)-y_, x*y_-beta*z]\n\nlam, running = largest_lyapunov(lorenz, [1, 1, 1], t_total=200)\nprint(f\"Largest Lyapunov exponent: λ_max = {lam:.4f} s⁻¹\")\nprint(f\"Expected for Lorenz: ~0.91 s⁻¹\")\n```\n\n### 5. Poincare Section\n\n```python\ndef poincare_section(rhs, y0, t_total, section_var=2, section_val=None,\n                     direction='positive'):\n    \"\"\"\n    Compute Poincare section by detecting crossings of a hyperplane.\n    section_var: index of variable defining the section\n    section_val: value at which to take the section (default: mean of trajectory)\n    \"\"\"\n    sol = solve_ivp(rhs, (0, t_total), y0,\n                    t_eval=np.linspace(0, t_total, int(t_total * 1000)),\n                    rtol=1e-10, atol=1e-12)\n\n    if section_val is None:\n        section_val = np.mean(sol.y[section_var])\n\n    # Find crossings\n    y_section = sol.y[section_var] - section_val\n    crossings = []\n\n    for i in range(1, len(y_section)):\n        if direction == 'positive' and y_section[i-1] \u003C 0 and y_section[i] >= 0:\n            # Linear interpolation for precise crossing\n            frac = -y_section[i-1] \u002F (y_section[i] - y_section[i-1])\n            point = sol.y[:, i-1] + frac * (sol.y[:, i] - sol.y[:, i-1])\n            crossings.append(point)\n        elif direction == 'negative' and y_section[i-1] >= 0 and y_section[i] \u003C 0:\n            frac = y_section[i-1] \u002F (y_section[i-1] - y_section[i])\n            point = sol.y[:, i-1] + frac * (sol.y[:, i] - sol.y[:, i-1])\n            crossings.append(point)\n\n    return np.array(crossings)\n\n# Example: Lorenz attractor Poincare section at z = 27\ncrossings = poincare_section(lorenz, [1, 1, 1], t_total=500,\n                             section_var=2, section_val=27.0)\nplt.scatter(crossings[:, 0], crossings[:, 1], s=0.5, c='black')\nplt.xlabel('x')\nplt.ylabel('y')\nplt.title('Poincaré Section of Lorenz Attractor (z = 27)')\nplt.savefig('poincare_section.png', dpi=150)\n```\n\n## Fixed Point Classification Reference\n\n| Eigenvalues | Type | Behavior |\n|---|---|---|\n| λ₁ \u003C λ₂ \u003C 0 (real) | Stable node | All trajectories approach FP |\n| 0 \u003C λ₁ \u003C λ₂ (real) | Unstable node | All trajectories leave FP |\n| λ₁ \u003C 0 \u003C λ₂ (real) | Saddle | Attracted along one axis, repelled along other |\n| α ± iβ, α \u003C 0 | Stable spiral | Spirals inward |\n| α ± iβ, α > 0 | Unstable spiral | Spirals outward |\n| ± iβ (pure imaginary) | Center | Closed orbits (conservative systems) |\n\n## Common Bifurcation Types\n\n| Bifurcation | What Happens | How to Detect |\n|---|---|---|\n| Saddle-node | Two FPs collide and annihilate | One eigenvalue crosses zero |\n| Transcritical | Two FPs exchange stability | Eigenvalue crosses zero, FPs persist |\n| Pitchfork | Symmetric FP splits into two | Eigenvalue crosses zero with symmetry |\n| Hopf | FP → limit cycle | Complex eigenvalue pair crosses imaginary axis |\n| Period-doubling | Limit cycle doubles period | Floquet multiplier crosses -1 |\n\n## Troubleshooting\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| Phase portrait arrows too small\u002Flarge | Vector field magnitude varies | Normalize arrows or use `streamplot` |\n| Fixed point finder doesn't converge | Bad initial guess | Try multiple guesses on a grid |\n| Lyapunov exponent not converging | Integration time too short | Increase `t_total` (10-100× Lyapunov time) |\n| Poincare section too sparse | Not enough crossings | Increase integration time |\n| Bifurcation diagram missing branches | Continuation step too large | Decrease parameter step size |\n","# Dynamical Systems Analysis\n\n## Overview\n\nQualitative and quantitative analysis of nonlinear dynamical systems. Phase portraits, fixed point classification, stability analysis, bifurcation diagrams, Poincare sections, and Lyapunov exponent computation.\n\n## When to Use\n\n- Visualizing flow in phase space (2D and 3D systems)\n- Finding and classifying fixed points (stable\u002Funstable nodes, spirals, saddles, centers)\n- Bifurcation analysis (how qualitative behavior changes with parameters)\n- Detecting chaos (Lyapunov exponents, sensitivity to initial conditions)\n- Poincare sections for periodicity analysis\n- Limit cycle detection and characterization\n\n## Core Workflows\n\n### 1. Phase Portrait (2D System)\n\n```python\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.integrate import solve_ivp\n\ndef system(t, y, mu=1.0):\n    \"\"\"Van der Pol oscillator\"\"\"\n    x, v = y\n    return [v, mu * (1 - x**2) * v - x]\n\n# Vector field on a grid\nx_range = np.linspace(-4, 4, 20)\nv_range = np.linspace(-6, 6, 20)\nX, V = np.meshgrid(x_range, v_range)\nU = V\nW = 1.0 * (1 - X**2) * V - X\n\nfig, ax = plt.subplots(figsize=(10, 8))\n\n# Streamlines\nax.streamplot(X, V, U, W, density=1.5, color='gray', linewidth=0.5, arrowsize=1)\n\n# Sample trajectories from different ICs\ncolors = plt.cm.viridis(np.linspace(0, 1, 6))\nfor i, ic in enumerate([[0.1, 0], [3, 0], [0, 4], [-2, -3], [1, -5], [4, 4]]):\n    sol = solve_ivp(system, (0, 30), ic, t_eval=np.linspace(0, 30, 3000),\n                    rtol=1e-10, atol=1e-12)\n    ax.plot(sol.y[0], sol.y[1], color=colors[i], linewidth=1.2)\n    ax.plot(ic[0], ic[1], 'o', color=colors[i], markersize=6)\n\n# Fixed points\nax.plot(0, 0, 'rx', markersize=12, markeredgewidth=3, label='Unstable fixed point')\n\nax.set_xlabel('x', fontsize=13)\nax.set_ylabel('dx\u002Fdt', fontsize=13)\nax.set_title('Van der Pol Oscillator Phase Portrait (μ=1)', fontsize=14)\nax.legend(fontsize=11)\nax.grid(True, alpha=0.3)\nplt.savefig('phase_portrait.png', dpi=150, bbox_inches='tight')\n```\n\n### 2. Fixed Point Analysis\n\n```python\nfrom scipy.optimize import fsolve\n\ndef rhs(y, mu=1.0):\n    \"\"\"Autonomous system: dy\u002Fdt = f(y)\"\"\"\n    x, v = y\n    return [v, mu * (1 - x**2) * v - x]\n\ndef jacobian(y, mu=1.0):\n    \"\"\"Jacobian matrix J_ij = df_i\u002Fdy_j\"\"\"\n    x, v = y\n    return np.array([\n        [0, 1],\n        [-2*mu*x*v - 1, mu*(1 - x**2)]\n    ])\n\n# Find fixed points\ny_guess = [0, 0]\nfp = fsolve(rhs, y_guess)\nprint(f\"Fixed point: ({fp[0]:.4f}, {fp[1]:.4f})\")\n\n# Classify via eigenvalues of Jacobian\nJ = jacobian(fp)\neigenvalues = np.linalg.eigvals(J)\nprint(f\"Eigenvalues: {eigenvalues}\")\n\n# Classification logic\ndef classify_fixed_point(eigenvalues):\n    real_parts = eigenvalues.real\n    imag_parts = eigenvalues.imag\n\n    if np.all(np.abs(imag_parts) \u003C 1e-10):\n        # Real eigenvalues\n        if np.all(real_parts \u003C 0):\n            return \"Stable node\"\n        elif np.all(real_parts > 0):\n            return \"Unstable node\"\n        else:\n            return \"Saddle point\"\n    else:\n        # Complex eigenvalues\n        if np.all(real_parts \u003C 0):\n            return \"Stable spiral\"\n        elif np.all(real_parts > 0):\n            return \"Unstable spiral\"\n        else:\n            return \"Center\"\n\nprint(f\"Classification: {classify_fixed_point(eigenvalues)}\")\n```\n\n### 3. Bifurcation Diagram\n\n```python\ndef logistic_map_bifurcation(r_range, n_discard=500, n_plot=200):\n    \"\"\"Bifurcation diagram for the logistic map x_{n+1} = r * x_n * (1 - x_n)\"\"\"\n    r_values = []\n    x_values = []\n\n    for r in r_range:\n        x = 0.5  # initial condition\n        # Discard transients\n        for _ in range(n_discard):\n            x = r * x * (1 - x)\n        # Collect steady-state iterates\n        for _ in range(n_plot):\n            x = r * x * (1 - x)\n            r_values.append(r)\n            x_values.append(x)\n\n    return np.array(r_values), np.array(x_values)\n\nr_range = np.linspace(2.5, 4.0, 2000)\nr_vals, x_vals = logistic_map_bifurcation(r_range)\n\nfig, ax = plt.subplots(figsize=(12, 7))\nax.scatter(r_vals, x_vals, s=0.01, c='black', alpha=0.5)\nax.set_xlabel('r', fontsize=13)\nax.set_ylabel('x*', fontsize=13)\nax.set_title('Logistic Map Bifurcation Diagram', fontsize=14)\nax.grid(True, alpha=0.2)\nplt.savefig('bifurcation.png', dpi=200, bbox_inches='tight')\n```\n\nFor continuous systems, use numerical continuation:\n\n```python\ndef continuous_bifurcation(rhs_func, param_range, y_init, param_name='mu'):\n    \"\"\"\n    Simple parameter continuation for fixed point bifurcations.\n    Tracks fixed points as a parameter varies.\n    \"\"\"\n    fixed_points = []\n    stabilities = []\n    y_guess = y_init\n\n    for param in param_range:\n        fp = fsolve(lambda y: rhs_func(y, param), y_guess, full_output=True)\n        if fp[2] == 1:  # converged\n            y_guess = fp[0]  # use as next guess\n            # Compute stability\n            J = np.zeros((len(y_guess), len(y_guess)))\n            eps = 1e-8\n            f0 = np.array(rhs_func(y_guess, param))\n            for j in range(len(y_guess)):\n                y_pert = y_guess.copy()\n                y_pert[j] += eps\n                J[:, j] = (np.array(rhs_func(y_pert, param)) - f0) \u002F eps\n            eigs = np.linalg.eigvals(J)\n            stable = np.all(eigs.real \u003C 0)\n            fixed_points.append(y_guess.copy())\n            stabilities.append(stable)\n        else:\n            fixed_points.append(np.full_like(y_guess, np.nan))\n            stabilities.append(False)\n\n    return np.array(fixed_points), np.array(stabilities)\n```\n\n### 4. Lyapunov Exponent (Variational Method)\n\n```python\ndef largest_lyapunov(rhs, y0, t_total=100, dt_renorm=1.0, rtol=1e-10):\n    \"\"\"\n    Compute largest Lyapunov exponent via variational equations.\n    Method: Benettin et al. (1980), Wolf et al. (1985).\n    \"\"\"\n    n = len(y0)\n\n    def rhs_with_variational(t, Y):\n        y = Y[:n]\n        delta = Y[n:2*n]\n        dydt = np.array(rhs(t, y))\n        # Numerical Jacobian\n        eps = 1e-8\n        J = np.zeros((n, n))\n        f0 = dydt\n        for j in range(n):\n            y_pert = np.array(y)\n            y_pert[j] += eps\n            J[:, j] = (np.array(rhs(t, y_pert)) - f0) \u002F eps\n        ddelta_dt = J @ delta\n        return np.concatenate([dydt, ddelta_dt])\n\n    # Random initial tangent vector\n    np.random.seed(42)\n    delta0 = np.random.randn(n)\n    delta0 \u002F= np.linalg.norm(delta0)\n    Y = np.concatenate([y0, delta0])\n\n    lyap_sum = 0.0\n    n_steps = int(t_total \u002F dt_renorm)\n    running = []\n\n    for i in range(n_steps):\n        t0, t1 = i * dt_renorm, (i + 1) * dt_renorm\n        sol = solve_ivp(rhs_with_variational, (t0, t1), Y,\n                        method='RK45', rtol=rtol, atol=rtol*1e-2)\n        Y = sol.y[:, -1]\n        norm = np.linalg.norm(Y[n:2*n])\n        lyap_sum += np.log(norm)\n        Y[n:2*n] \u002F= norm\n        running.append(lyap_sum \u002F ((i+1) * dt_renorm))\n\n    lambda_max = lyap_sum \u002F t_total\n    return lambda_max, running\n\n# Example: Lorenz system\ndef lorenz(t, y, sigma=10, rho=28, beta=8\u002F3):\n    x, y_, z = y\n    return [sigma*(y_-x), x*(rho-z)-y_, x*y_-beta*z]\n\nlam, running = largest_lyapunov(lorenz, [1, 1, 1], t_total=200)\nprint(f\"Largest Lyapunov exponent: λ_max = {lam:.4f} s⁻¹\")\nprint(f\"Expected for Lorenz: ~0.91 s⁻¹\")\n```\n\n### 5. Poincare Section\n\n```python\ndef poincare_section(rhs, y0, t_total, section_var=2, section_val=None,\n                     direction='positive'):\n    \"\"\"\n    Compute Poincare section by detecting crossings of a hyperplane.\n    section_var: index of variable defining the section\n    section_val: value at which to take the section (default: mean of trajectory)\n    \"\"\"\n    sol = solve_ivp(rhs, (0, t_total), y0,\n                    t_eval=np.linspace(0, t_total, int(t_total * 1000)),\n                    rtol=1e-10, atol=1e-12)\n\n    if section_val is None:\n        section_val = np.mean(sol.y[section_var])\n\n    # Find crossings\n    y_section = sol.y[section_var] - section_val\n    crossings = []\n\n    for i in range(1, len(y_section)):\n        if direction == 'positive' and y_section[i-1] \u003C 0 and y_section[i] >= 0:\n            # Linear interpolation for precise crossing\n            frac = -y_section[i-1] \u002F (y_section[i] - y_section[i-1])\n            point = sol.y[:, i-1] + frac * (sol.y[:, i] - sol.y[:, i-1])\n            crossings.append(point)\n        elif direction == 'negative' and y_section[i-1] >= 0 and y_section[i] \u003C 0:\n            frac = y_section[i-1] \u002F (y_section[i-1] - y_section[i])\n            point = sol.y[:, i-1] + frac * (sol.y[:, i] - sol.y[:, i-1])\n            crossings.append(point)\n\n    return np.array(crossings)\n\n# Example: Lorenz attractor Poincare section at z = 27\ncrossings = poincare_section(lorenz, [1, 1, 1], t_total=500,\n                             section_var=2, section_val=27.0)\nplt.scatter(crossings[:, 0], crossings[:, 1], s=0.5, c='black')\nplt.xlabel('x')\nplt.ylabel('y')\nplt.title('Poincaré Section of Lorenz Attractor (z = 27)')\nplt.savefig('poincare_section.png', dpi=150)\n```\n\n## Fixed Point Classification Reference\n\n| Eigenvalues | Type | Behavior |\n|---|---|---|\n| λ₁ \u003C λ₂ \u003C 0 (real) | Stable node | All trajectories approach FP |\n| 0 \u003C λ₁ \u003C λ₂ (real) | Unstable node | All trajectories leave FP |\n| λ₁ \u003C 0 \u003C λ₂ (real) | Saddle | Attracted along one axis, repelled along other |\n| α ± iβ, α \u003C 0 | Stable spiral | Spirals inward |\n| α ± iβ, α > 0 | Unstable spiral | Spirals outward |\n| ± iβ (pure imaginary) | Center | Closed orbits (conservative systems) |\n\n## Common Bifurcation Types\n\n| Bifurcation | What Happens | How to Detect |\n|---|---|---|\n| Saddle-node | Two FPs collide and annihilate | One eigenvalue crosses zero |\n| Transcritical | Two FPs exchange stability | Eigenvalue crosses zero, FPs persist |\n| Pitchfork | Symmetric FP splits into two | Eigenvalue crosses zero with symmetry |\n| Hopf | FP → limit cycle | Complex eigenvalue pair crosses imaginary axis |\n| Period-doubling | Limit cycle doubles period | Floquet multiplier crosses -1 |\n\n## Troubleshooting\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| Phase portrait arrows too small\u002Flarge | Vector field magnitude varies | Normalize arrows or use `streamplot` |\n| Fixed point finder doesn't converge | Bad initial guess | Try multiple guesses on a grid |\n| Lyapunov exponent not converging | Integration time too short | Increase `t_total` (10-100× Lyapunov time) |\n| Poincare section too sparse | Not enough crossings | Increase integration time |\n| Bifurcation diagram missing branches | Continuation step too large | Decrease parameter step size |\n",{"name":5,"tags":44,"author":48,"license":15,"version":49,"category":30,"description":7,"dependencies":50},[19,24,23,45,46,47,22],"Chaos","Lyapunov","Stability","Synthetic Sciences","1.0.0",[51,52,53],"scipy>=1.11.0","numpy>=1.24.0","matplotlib>=3.7.0","main","4aa39efd1cdab0b4657ecee16c92a92011a5b10f","openscience\u002Fbackend\u002Fcli\u002Fskills\u002Fphysics\u002Fdynamical-systems","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub","https:\u002F\u002Fgithub.com\u002Ffadrienne","2026-10-28 00:43:09",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add fadrienne\u002FMyGitHub --skill dynamical-systems",{"tool":66,"command":67},"bunx","bunx skills add fadrienne\u002FMyGitHub --skill dynamical-systems",{"tool":69,"command":70},"pnpm","pnpm dlx skills add fadrienne\u002FMyGitHub --skill dynamical-systems","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fopenscience\u002Fbackend\u002Fcli\u002Fskills\u002Fphysics\u002Fdynamical-systems\u002FSKILL.md",true,[],[75,104,129,163,190,217],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":86,"publishedAt":39},"01M7167B28PK20HP7R7ZED2DY0","statistical-power","Sample size calculation, power analysis, and effect size conversion for scientific studies. Use BEFORE data collection (a priori) to determine required N, or after (post-hoc) to compute achieved power. Covers parametric tests (t-test, ANOVA, chi-square, proportions, correlation, regression), simulation-based power for complex\u002Fclustered\u002Fnested designs, and power curves. Use this skill when someone asks 'how many samples do I need', 'what is my power', 'what effect size can I detect', or any variant. Pairs with \u002Fexperimental-design (choose design first, then compute power) and \u002Fstatistical-analysis (analyze data after collection).","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-power\u002FSKILL.md",[81],{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[87,88,89,31,90,91,92,93,94,95,96,29,97,98,99,36,100,101,102,103],"power","statistical power","effect","regression","choose","design","uv","when","Bash","collection","calculation","ANOVA","conversion","t-test","chi-square","simulation","sample",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":113,"publishedAt":39},"01M71677EBCM8EPCE9BZCK8505","statistical-analysis","Guided statistical analysis with test selection and reporting. Use when you need help choosing appropriate tests for your data, assumption checking, power analysis, and APA-formatted results. Best for academic research reporting, test selection guidance. For implementing specific models programmatically use statsmodels.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fstatistical-analysis\u002FSKILL.md",[110],{"categoryNo":111,"categoryName":112,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000008","测试与质量",[29,114,87,115,116,117,94,118,119,120,26,121,34,122,123,124,125,126,127,128],"statistical analysis","academic research","implementing","selection","you","reporting","data","tests","with","test","research","results","statsmodels","models","help",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":144,"publishedAt":39},"01M71673R93XAHFH81DBNVNG7H","scientific-writing","Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA\u002FAMA\u002FVancouver), figures\u002Ftables, reporting guidelines (CONSORT\u002FSTROBE\u002FPRISMA), for research papers and journal submissions.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fscientific-writing\u002FSKILL.md",[135,138,139],{"categoryNo":136,"categoryName":137,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},{"categoryNo":140,"categoryName":141,"taxonomyType":142,"taxonomyTypeDesc":143},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[145,146,147,148,149,150,151,152,153,154,95,155,156,157,158,159,160,161,119,162],"writing","scientific","scientific writing","Citations","deep","deep research","never","papers","journal","false","api","prisma","structure","openrouter","Outlines","core skill","read","features",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":173,"publishedAt":39},"01M7166ZPKXBF4EBPHVTJPQBB1","scientific-visualization","Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib\u002Fseaborn\u002Fplotly with publication styles. For quick exploration use seaborn or plotly directly.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fscientific-visualization\u002FSKILL.md",[169,172],{"categoryNo":170,"categoryName":171,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000013","分析与可视化",{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},[174,146,175,176,177,178,179,180,181,153,94,182,183,184,185,186,187,188,26,189],"visualization","scientific visualization","error","ready","quick","exploration","meta-skill","Meta","safe","plotly","annotations","formatting","Publication","figures","panel","submission",{"skillNo":191,"name":192,"nameZh":6,"description":193,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":194,"categories":195,"keywords":202,"publishedAt":39},"01M7166VXJWQSSC3RQZP60WBGR","research-code","Debug, profile, review, and restructure Python research and analysis code. Use when analysis scripts crash, produce wrong results, run too slowly, or need a correctness review. Covers: reading tracebacks and diagnosing root causes, hypothesis-driven debugging, reviewing code for common statistical\u002Fnumerical errors, profiling data pipelines, improving reproducibility (seeds, environments, determinism), and structuring analysis scripts for sharing. Distinct from \u002Fexploratory-data-analysis (which understands data) and \u002Fstatistical-analysis (which chooses and runs tests) — this skill focuses on the code itself.","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fresearch-code\u002FSKILL.md",[196,199],{"categoryNo":197,"categoryName":198,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":200,"categoryName":201,"taxonomyType":142,"taxonomyTypeDesc":143},"01JBSEEDCAT000000000000030","开发工程师",[203,204,124,205,206,207,208,93,209,94,95,29,210,211,212,213,214,215,161,216],"code","research code","which","memory","data-analysis","errors","debugging","common","review","data pipelines","run","scripts","line","write",{"skillNo":218,"name":219,"nameZh":6,"description":220,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":221,"licenseFileUrl":6,"sourceHtmlUrl":222,"categories":223,"keywords":230,"publishedAt":39},"01M7166CF5HSR7SVZYZFWTDX55","markdown-mermaid-writing","Comprehensive markdown and Mermaid diagram writing skill. Use when creating any scientific document, report, analysis, or visualization. Establishes text-based diagrams as the default documentation standard with full style guides (markdown + mermaid), 24 diagram type references, and 9 document templates.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Ffadrienne\u002FMyGitHub\u002Fblob\u002Fmain\u002Fscientific-agent-skills\u002Fskills\u002Fmarkdown-mermaid-writing\u002FSKILL.md",[224,227,228,229],{"categoryNo":225,"categoryName":226,"taxonomyType":84,"taxonomyTypeDesc":85},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":136,"categoryName":137,"taxonomyType":84,"taxonomyTypeDesc":85},{"categoryNo":82,"categoryName":83,"taxonomyType":84,"taxonomyTypeDesc":85},{"categoryNo":140,"categoryName":141,"taxonomyType":142,"taxonomyTypeDesc":143},[145,231,232,233,234,33,174,235,236,94,95,29,237,238,239,240,241,242,146,161],"markdown mermaid writing","mermaid","markdown","community","project","default","team","guides","text","documentation","references","diagram"]