# How to implement chaotic sender and receiver with ordinary differential equations?

I am referring this paper, and trying to implement chaotic sender and receiver, to decode message, as given in section $V^{th}$ Chaotic signal masking. The process that I want to implement is figure 6 of the same paper, where we have Lorenz system given by equations: : \begin{align} \frac{\mathrm{d}x}{\mathrm{d}t} &= \sigma (y - x), \\ \frac{\mathrm{d}y}{\mathrm{d}t} &= x (\rho - z) - y, \\ \frac{\mathrm{d}z}{\mathrm{d}t} &= x y - \beta z. \end{align} [from Wikipedia]and $\sigma=16; \rho=45.6; \beta=8$ for real applications the parameters have been scaled.

My MATLAB code is given here:

clear all;
close all;
clc;
%Solution for the Lorenz equations in the time interval [0,100] with initial conditions [1,1,1].
sigma=16;
beta=4;
rho=45.6;
f = @(t,a) [-sigma*a(1)/10 + sigma*a(2)/10; rho*a(1)/10 - a(2)/10 - (a(1)*a(3))/200; -beta*a(3)/20 + (a(1)*a(2))/100];
%'f' is the set of differential equations and 'a' is an array containing values of x,y, and z variables.
%'t' is the time variable
[t,a] = ode45(f,[0 10],[1 1 1]);%'ode45' uses adaptive Runge-Kutta method of 4th and 5th order to solve differential equations
% plot3(a(:,1),a(:,2),a(:,3))
m_t= rand(1,size(a,1))<=0.5;
s_t=a(:,1)+ m_t';
f = @(t,a_r) [-sigma*a_r(1)/10 + sigma*a(1)/10; rho*a_r(1)/10 - a(1)/10 - (a_r(1)*a(1))/200; -beta*a(1)/20 + (a_r(1)*a(1))/100];
[t,a_r] = ode45(f,[0 10],[1 1 1]);
m_t_est=s_t(1:size(a_r,1),:)-a_r(:,1);
l=m_t(:,1:size(a_r,1))'-m_t_est;
plot(l)


part of this code has been taken from Wikipedia: Lorenz system, and modified suitably, my problem is twofold:

1. I am not sure as how this ODE is working as integrating from 1 to 10 the size I am getting is like size(a_r(:,1))=61. How to decide the size of given function?
2. The plot of difference between received waveform and transmitted is like this:

which is quite fine, for some samples but increases dramatically.

Am I doing this the right way or something is really wrong?

• You may want a really small tolerance when integrating a chaotic system. – Chris Rackauckas Mar 10 '17 at 15:17
• Can I ask you please elucidate? I am a communication engineer working first time on chaos! – Userhanu Mar 10 '17 at 15:20
• In general, referring to a paper that you expect people to read before they can understand your question doesn't work very well here. It is much more effective to explain your question in more detail. Beyond that, my impression is that you want to solve two systems of ODE where the solution from the first is somehow used as input for the second. If that is the case, it looks to me like your approach is almost certainly incorrect. How did you get your MATLAB code from the definition of the Lorenz equations-- is this just some scaling that you have applied? – Bill Greene Mar 10 '17 at 15:42
• Chaotic systems have sensitive dependence to errors. Different flows will diverge exponentially fast. So if you're solving equations at default tolerances like 10^-6 abstol, that's fine for many equations, but it means that you'll globally diverge from the true solution rather quickly on a chaotic system. – Chris Rackauckas Mar 10 '17 at 17:24
• In many cases you can actually quantify the effects. This page shows an uncertainty quantification of a slightly more efficient algorithm than ode45 on the Lorenz system, and you can see that there is a high probability that by t=10 the true solution of the Lorenz system my be "on the other wing" (see the plot, 10 runs with ProbInts noise for UQ shows the likely divergence of trajectories). To get around this, you need very small tolerances to simulate chaotic systems properly. – Chris Rackauckas Mar 10 '17 at 17:26