SDA_2.2.2_EmaJokubaityte (2)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Exercise 2.2.2 from ’2.

2 Fixed Points and Stability’ in Nonlinear


Dynamics and Chaos
Course: Sistemas Dinámicos y Aplicaciones
Student: Ema Jokubaityte

Problem Statement
Analyze the following equations graphically. In each case, sketch the vector field on the real line, find all
the fixed points, classify their stability, and sketch the graph of x(t) for different initial conditions. Then try
for a few minutes to obtain the analytical solution for x(t); if you get stuck, don’t try for too long since in
several cases it’s impossible to solve the equation in closed form!

ẋ = 1 − x14

In this problem, it is needed to:


1. Find all the fixed points.

2. Classify their stability.


3. Sketch the vector field.
4. Sketch x(t) for different initial conditions.
5. Attempt to obtain an analytical solution for x(t), if possible.

Solution

1. Finding Fixed Points


To determine the fixed points, the function needs to be equaled to zero (ẋ = 0):

1 − x14 = 0

Which results to:

x14 = 1

Thus, the fixed points are x = ±1, since only these values satisfy x14 = 1.

2. Stability Analysis
To determine stability, the derivative of f (x) = 1 − x14 :

f ′ (x) = −14 · x13

1
Evaluating f ′ (x) at each fixed point:

• At x = 1: f ′ (1) = −14, which is negative, so x = 1 is a stable fixed point.

• At x = −1: f ′ (−1) = 14, which is positive, so x = −1 is an unstable fixed point.

Therefore, solutions that start near x = 1 will tend to move towards it, while those near x = −1 will
move away.

3. Vector Field
The vector field plot below illustrates the flow of solutions based on the function ẋ = 1 − x14 . - The flow is
towards the fixed point at x = 1, confirming it is stable. - The flow is away from the fixed point at x = −1,
confirming it is unstable.

4. Behavior of x(t) for Various Initial Conditions


By analyzing the vector field, we can deduce the following behaviors for x(t):
• If x(0) > 1, the solution x(t) will decrease towards the stable fixed point at x = 1.

• If 0 < x(0) < 1, the solution x(t) will increase towards x = 1.


• If −1 < x(0) < 0, the solution x(t) will increase, moving away from the unstable point at x = −1.
• If x(0) < −1, the solution x(t) will decrease further away from x = −1.

2
This analysis shows that regardless of initial conditions, solutions will tend towards x = 1 or diverge
away from x = −1.

5. Analytical Solution Attempt


The equation ẋ = 1−x14 is highly nonlinear, making an analytical solution for x(t) challenging. For practical
purposes, is it better to focus on the qualitative behavior (approaching x = 1 or diverging from x = −1).

3
The Python code provided below was used to create ’Vector Field’ and ’Various Initial Conditions’ Plots.

1 import numpy as np
2 import matplotlib.pyplot as plt
3 from scipy.integrate import solve_ivp
4
5 # Define the function for the differential equation
6 def f(x):
7 return 1 - x**14
8
9 # Generate x values for plotting the function (vector field)
10 x_values = np.linspace(-2, 2, 400)
11 f_values = f(x_values)
12
13 # Plot the function to illustrate the vector field
14 plt.figure(figsize=(10, 6))
15 plt.plot(x_values, f_values, label=r"$\dot{x} = 1 - x^{14}$", color="blue")
16 plt.axhline(0, color='black', linewidth=0.5)
17 plt.axvline(0, color='black', linewidth=0.5)
18
19 # Mark fixed points
20 fixed_points = [-1, 1]
21 for fp in fixed_points:
22 plt.plot(fp, f(fp), 'go' if fp == 1 else 'ro', markersize=8,
23 label=f"Fixed Point: {fp} ({'Stable' if fp == 1 else 'Unstable'})")
24
25 # Add arrows to indicate direction of flow
26 for x in np.linspace(-2, 2, 10):
27 sign = np.sign(f(x))
28 plt.arrow(x, 0, 0, sign * 0.1, head_width=0.05, head_length=0.1, fc='black', ec='black')
29
30 plt.title(r"Vector Field and Fixed Points for $\dot{x} = 1 - x^{14}$")
31 plt.xlabel("x")
32 plt.ylabel(r"$\dot{x}$")
33 plt.legend()
34 plt.grid(True)
35 plt.show()
36
37 # Initial conditions for x(t)
38 def dx_dt(t, x):
39 return 1 - x**14
40
41 initial_conditions = [9, 2, 1.5, 1.1, 0.5, 0, -0.5, -0.9, -1.1, -1.5, -2]
42 t_span = (0, 5)
43 t_eval = np.linspace(0, 5, 400)
44
45 plt.figure(figsize=(10, 6))
46
47 # Solve and plot for each initial condition
48 for x0 in initial_conditions:
49 sol = solve_ivp(dx_dt, t_span, [x0], t_eval=t_eval, method='RK45')
50
51 # Clip y values to limit within the y-axis boundary
52 clipped_y = np.clip(sol.y[0], -1e1000000000, 2)
53 if x0 in [9, 3]:
54 plt.plot(sol.t, clipped_y, linestyle='--', linewidth=3, label=f'x(0) = {x0}')
55 else:
56 plt.plot(sol.t, clipped_y, linestyle='-', label=f'x(0) = {x0}')
57
58 plt.title("Solutions $x(t)$ for Various Initial Conditions")
59 plt.xlabel("Time $t$")
60 plt.ylabel("$x(t)$")
61 plt.legend(loc='upper right')
62 plt.grid(True)
63 plt.xlim(-0.1, 3)
64 plt.ylim(-5, 10)

You might also like