Lyapunov Exponents in MATLAB

In summary, the conversation is discussing how to calculate the Lyapunov exponent for a range of r values using MATLAB code. The code provided is mostly correct, but there are a few adjustments that need to be made, such as modifying the equation and using a numerical approximation to calculate the sum. The goal is to plot the Lyapunov exponent as a function of r.
  • #1
nlsherrill
323
1

Homework Statement


http://courses.ncsu.edu/py411/lec/001/hw6.pdf [Broken]

#1 part B specifically.



The Attempt at a Solution


For #1 part B I am confused. I have already done part A with MATLAB, and am having syntax issues with trying to compute the Lyapunov exponent(which is the last part of this code). Heres the code so far:

r_values = (3:0.1:6.5)';
iterations_per_value = 2000;
y = zeros(length(r_values), iterations_per_value);
y0 = 0.1;
y(:,1) = r_values.*y0*(1-y0)^2;
for i = 1:iterations_per_value
y(:,i+1) = r_values.*y(:,i).*(1-y(:,i)).^2;
end
plot(y(:,i), r_values)
grid on;

for i=1:2000
f(2000)=limit(1/2000*sum(ln(diff(r_values.*y0*(1-y0)^2))), 2000, inf);
y(i)=f(i-1);
end
sum(y);

The code is correct except for the last loop.

Here is a link to the equation:

http://hypertextbook.com/chaos/43.shtml [Broken]

Any help would be greatly appreciated.
 
Last edited by a moderator:
Physics news on Phys.org
  • #2


Hi there! It looks like you're on the right track with your code. However, there are a few things that need to be adjusted in order to correctly calculate the Lyapunov exponent.

Firstly, the equation you linked to is for calculating the Lyapunov exponent for a single value of r. In your code, you are trying to calculate it for a range of r values. This means you will need to modify the equation slightly to account for the different r values.

Secondly, in your for loop, you are trying to calculate the limit of a sum as n goes to infinity. This is not possible to do numerically, as the limit of a sum is not always equal to the sum of limits. Instead, you will need to use a numerical approximation, such as the trapezoidal rule or Simpson's rule, to calculate the sum.

Lastly, you will need to adjust your code to plot the Lyapunov exponent as a function of r, rather than plotting y against r.

I hope this helps! Let me know if you have any further questions.
 

1. What are Lyapunov exponents?

Lyapunov exponents are a mathematical concept used to measure the rate of separation of nearby trajectories in a dynamical system. They are used to determine the long-term behavior and predictability of a system.

2. How are Lyapunov exponents calculated?

Lyapunov exponents can be calculated using various methods, including the Gram-Schmidt orthogonalization process and the QR decomposition method. In MATLAB, the lyapunov function can be used to calculate the largest Lyapunov exponent of a system.

3. What is the significance of Lyapunov exponents in chaos theory?

In chaos theory, Lyapunov exponents play a crucial role in determining the chaotic behavior of a system. A positive Lyapunov exponent indicates sensitivity to initial conditions, which is a characteristic of chaotic systems.

4. Can MATLAB be used to analyze Lyapunov exponents?

Yes, MATLAB has built-in functions such as lyapunov and lyapunovopt that can be used to analyze Lyapunov exponents. These functions can be used to calculate the largest Lyapunov exponent, as well as to visualize the behavior of a system.

5. How can Lyapunov exponents be applied in real-world systems?

Lyapunov exponents have various applications in fields such as physics, biology, and engineering. They can be used to study complex systems, predict the behavior of chaotic systems, and design control strategies for chaotic systems.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
909
  • Engineering and Comp Sci Homework Help
Replies
2
Views
764
  • Introductory Physics Homework Help
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • Introductory Physics Homework Help
Replies
1
Views
946
  • Programming and Computer Science
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
5K
  • Advanced Physics Homework Help
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Programming and Computer Science
3
Replies
89
Views
4K
Back
Top