Let us set \(Y\) to be equal to \(F^{-1} (U)\) where \(U\) is the uniform r. v. between 0 and 1. Now we can substitute the relation ship inthe equation as follows.

\[F_Y(a) = p( F^{-1}(U) \leq a)\]as \(F\) is monotonically increasing we could write,

\[F_Y(a) = p( U \leq F(a))\]As \(U\) is a r. v. following uniform distribution between 0 and 1, the above equation simplifies to,

\[F_Y(a) = F(a)\]What this shows is that, the CDF of a random variable \(Y\), where \(Y\) is defined to be equal to \(F^{-1} (U)\) has the same CDF as \(F\).

</script>

]]>In other words, this is a note to describe how poles of linear system is related to the eigen values of the coefficient matrix.

Let the governing equations be of the following form,

\[\dot{x}=Ax\]The laplace transform of the governing equations is as follows,

\[sx(s)-x(0)=Ax(s)\]Which essentially means the following,

\[x(t)=L^{-1}((sI-A)^{-1})x(0)\]Where \((sI-A)^{-1}\) is the resolvant matrix.

Using cramers rule one could compute the inverse of \(sI-A\) matrix. This will result in the \((i,~ j)\) entry of the matrix to be as follows,

\[-1^{(i+j)}\frac{\|\Delta_{ij}\|}{\|sI-A\|}\]Here the poles are governed byt the the term \(\|sI-A\|\) and it is also what governs the eigen values of \(A\). The subte difference comes when the some terms in the denominator gets cancelled by the numerator. This results in a scenario where some eigen values do not appear in the poles of the matrix as they cancel out. In other words all poles are eigen values of the matrix A and all eigen values need not appear as poles as they may get cancelled.

]]>Interestingly, there are sytems which come back to the same point after some iterations. Lets say the following is true,

\[x_{n+4} = x_{n} = f(f(f(f(x_n)))) = f^4(x_n)\]One computes the stability of a discrete system as above by computing its derivative. If the derivative is less than 1, then the system is stable else unstable.

So to compute the stability of the \(f^4(.)\) function one needs to find the following:

\[\frac{d}{dx_n}(f^4(x_n)) = \frac{d}{dx_n}(x_{n+4}) = \frac{dx_{n+1}}{dx_n}.\frac{dx_{n+2}}{dx_{n+1}}.\frac{dx_{n+3}}{dx_{n+2}}.\frac{dx_{n+4}}{dx_{n+3}}\]This is essentially the backpropagation update for the function \(f^4(.)\) with respect to the previous layer outputs \(x_n,x_{n+1}..\). While this is obvious for many, how this helps **me** is to understand what is kept constant when one takes the layer’s derivative.

That is as follows,

\[\frac{d}{dx_n}(x_{n+4}) = \frac{dx_{n+1}}{dx_n}.\frac{dx_{n+2}}{dx_{n+1}}.\frac{dx_{n+3}}{dx_{n+2}}.\frac{dx_{n+4}}{dx_{n+3}} = f'(x_n).f'(x_{n+1}).f'(x_{n+2}).f'(x_{n+3})\]Therefore, instead of taking the derivative of the overall function \(f^4(.)\), we could take the derivative of the function \(f(.)\) and just multiply.

Consequently, in general, one can just use \(f'(.)\) and apply the function on the \(n\) iterates of the function and get the derivative \(n^{th}\) application of the function. The interesting aspect is what is kept constant when one applies the function is clear here. Cheers.

Reference: Ott, E. (2002). Chaos in Dynamical Systems (2nd ed.). Cambridge: Cambridge University Press. doi:10.1017/CBO9780511803260

]]>Then came a point when I realized my needs are different. I wanted a site where I can do a bit of programming JavaScript and such. Also, I didn’t want to pay a premium. Moreover having followers and such were not my main priorities.

I got a domain name in namecheap. Built a template site in my local computer following advise from this set of YouTube videos. And, I was good to go.

Then the main issue was to get the content of old blogs and site pages to the new website. It turns out Jekyll provides an easy solution to this here

Installed the following plugin by running.

```
gem install hpricot open_uri_redirections
```

And ran this.

```
ruby -r rubygems -e 'require "jekyll-import";
JekyllImport::Importers::WordpressDotCom.run({
"source" => "wordpress.xml",
"no_fetch_images" => false,
"assets_folder" => "assets"
})'
```

Minor edits and moving some files to appropriate places - the site is ready.

One should note that Jekyll site is not dynamic and comes with its limitations. Some things taken for granted in WordPress.com would need more work like having a contact page. For which I used this tutorial.

Also I think doing dynamic tasks are going to be much harder.

]]>Let \(\phi(x(t))\) be the phase function. Then,

\[\frac{d\phi}{dt} = \frac{d\phi}{dx}.\frac{dx}{dt}=1\]However, we know, from the definition of the differential equations,

\[\frac{dx}{dt} = f(x)\]Therefore,

\[\frac{d\phi}{dx}.\frac{dx}{dt} = \frac{d\phi}{dx}.f(x) = 1\]This helps us get the following equation to compute phase function.

\[\frac{d\phi}{dx}.f(x) = 1\]Where \(\frac{d\phi}{dx}\) is the PRC.

Approximately,

\[PRC = \frac{1}{f(x(t))} = \frac{1}{\dot{\zeta}(t)}\]Where \(\zeta (t)\) is the limit cycle solution of the differential equation!

]]>So here is the second step, how to solve a tent map in javascript and plot it as it is getting iterated.

The map is defined as follows

\[x_{n+1} = 2~x_n ~\text{mod}~ 1\]The \(x_n\) are plotted with respect to the step numbers. Change the value given in the slider to provide the initial condition.

The javascript code is given below.

```
<script>
tentmap(0.45); // Running it to get the first graph
//Slider
var slider = document.getElementById("myRange");
var output = document.getElementById("demo");
output.innerHTML = slider.value;
slider.oninput = function() {
output.innerHTML = this.value/100;
tentmap(this.value/100);
}
//The functions
function tentmap(init)
{
var statei = init;
var xaxis = [0];
var yaxis = [statei];
var i ;
for (i = 0; i < 45; i++) {
xaxis.push(i);
statei = (2*statei)%1
yaxis.push(statei);
}
var trace1 = {
x: xaxis,
y: yaxis,
mode: 'lines', //use markers if you want just dots
type: 'scatter'
};
var data = [trace1];
Plotly.newPlot('myDiv', data);
}
</script>
```

The HTML is as follows.

```
<body>
<div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div>
<div class="slidecontainer">
<input type="range" min="0" max="100" value="50" class="slider" id="myRange">
<p>Value: <span id="demo"></span></p>
</div>
</body>
```

The code is taken from here

For HTML

```
<head>
<!-- Load plotly.js into the DOM -->
<script src='https://cdn.plot.ly/plotly-latest.min.js'></script>
</head>
<body>
<div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div>
</body>
```

For Java script

```
<script>
var trace1 = {
x: [1, 2, 3, 4,5],
y: [1,1,2,2,0],
mode: 'lines', //use markers if you want just dots
type: 'scatter'
};
var data = [trace1, trace2, trace3];
Plotly.newPlot('myDiv', data);
</script>
```

All in in one .md file in the _posts folder with correct naming. Results in the following figure.

]]>The following data shows the output from my accelerometer over time. This is me trying to blow air on me using my phone!

Let me take a diversion before I come back to saying how well I know that I don’t know the physiology of walking. It is easy to make a simple pendulum passively walk over an inclined plane. Many have developed simple passive walkers that do that. They have simply attached two sticks, set it up at some reasonably good initial conditions and let it walk over a plane. And it start walking. However, it turns out eventually the system runs out of energy and stops. Ah! So now all we need is to supply some energy to this system so that it doesn’t eventually fall down. Now back to human walking. In our body, ankles supply energy at every step pushing us the uphill while trekking. But the ankles need to know when to give the forces when not isn’t it? Also, what to do when there is an obstacle ahead. This is when things get interesting. The key word is coordinated though because when one ankle supplies the energy the other has to remain silent. The coordinated.. alternating.. oscillatory..inputs.

We have a set of neurons in the spinal cord known as central pattern generators. As the name suggest it provide a pattern alternating…oscillatory…of inputs to the muscles in the hope of controlling them. This is where the rivalry begins.. On, one side we have the mechanical system with ever so complicated input patterns under the influence of bumpy roads and obstacles and the other side we have neurons trying to control it to generate very predictable movement patterns.

Nature has a very weird way of dealing with these problems. Evolution. From simple life forms with rather simpler locomotion patterns to complicated ones like us design iteratively, but with one catch. Nature may not know clearly what to let go and what to keep when it comes to design. While Samsung galaxy Note 20 ultra let go of the older say 2x zoom optical sensor with the 5x zoom one for pro video modes, nature might note be able to that. It probably will keep both lenses or probably try to improve older one iteratively.

This iterative design results in a lot of components in the brain which supply to the pattern generators which was previously designed for the likes of swimming and crawling.. modified to accommodate quadrupeds … which again remodelled to accommodate bipeds. So we might never know exactly what is the minimum number of structures that can result in normal walking.

CPGs.. the pattern generators described earlier is supplied with the inputs from the midbrain reticular formation (MRF) and locus coeruleus (LC) (i told you). It turns out MRF is divided into NRGc and NRMc providing inhibitory input and the locomotor inputs to the CPGs respectively. PRF controlled by PPN supplies NRGc to provide that inhibitory input probably trying to suppress the muscle tone. MLR region kinda controls LC and NRMc in an excitatory way i think but don’t take my word for it. So now we have a crude excitatory and inhibitoryish systems controlling the CPG. This doesn’t end here.. These structures in turn regulated by the basal ganglia which has many substructures like STN, GPi, SNc etc. It is neurons of SNc which die in Parkinson’s disease.

Obviously, feedback plays a lot of role in walking. The primary afferents of the of the CPG supply them directly while sensory input also go to the Cerbellum and motor cortex (visual feedback)for further procrssing. Cerebellum is speculated to have developed a system to compute the inverse model and supply the information necessary to generate the correct torques to MRF. Amygdala, hippocampus, SLR, VTA, NAc supply some emotional component to it. People with anxiety causes freezing in Parkinson’s. And here goes one plausible explanation. But the exact workings are obviously unclear.

The point is the rest is pretty complicated.

More to follow as I understand the last part better.

]]>Let a neuron be spiking and

\[\begin{align} T_1&=\text{normal time period}\\ T_2&=\text{perturbed time period} \end{align}\]The perturbation is happening at time \(t_s\), therefore,

\[\begin{align} t_s/T_1&=\text{phase before perturbation}\\ T_2-t_s&=\text{time to next spike} \end{align}\]Then, the phase has become \((T_1-(T_2-t_s))/T_1\)

This therefore gives the following phase difference,

\[\begin{align} \Delta \phi &= \text{new phase} - \text{old phase}\\ &=((T_1-(T_2-t_s))/T_1)-t_s/T_1\\ &=(T_1-T_2)/T_1 \end{align}\]Here, \(T_1\), \(T_2\) are the timings. \(t_s\) is the time of perturbation. \(T_1\) is the free running period and \(T_2\) is the perturbed period.

]]>