\documentclass[addpoints,11pt]{exam} \usepackage{url} \usepackage{color} \usepackage{hyperref} \pagestyle{headandfoot} \runningheadrule \firstpageheadrule \firstpageheader{Scientific Computing}{Project Assignment}{11/05/2014 -- 11/06/2014} %\runningheader{Homework 01}{Page \thepage\ of \numpages}{23. October 2014} \firstpagefooter{}{}{} \runningfooter{}{}{} \pointsinmargin \bracketedpoints %%%%% listings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{listings} \lstset{ basicstyle=\ttfamily, numbers=left, showstringspaces=false, language=Matlab, breaklines=true, breakautoindent=true, columns=flexible, frame=single, % captionpos=t, xleftmargin=2em, xrightmargin=1em, % aboveskip=11pt, %title=\lstname, % title={\protect\filename@parse{\lstname}\protect\filename@base.\protect\filename@ext} } %\printanswers %\shadedsolutions \begin{document} %%%%%%%%%%%%%%%%%%%%% Submission instructions %%%%%%%%%%%%%%%%%%%%%%%%% \sffamily % \begin{flushright} % \gradetable[h][questions] % \end{flushright} \begin{center} \input{../disclaimer.tex} \end{center} %%%%%%%%%%%%%% Questions %%%%%%%%%%%%%%%%%%%%%%%%% \begin{questions} \question The temporal evolution of the membrane voltage $V(t)$ of a passive neuron is described by the membrane equation \begin{equation} \label{passivemembrane} \tau \frac{dV}{dt} = -V + E \end{equation} where $\tau=10$\,ms is the membrane time constant and $E(t)$ is the reversal potential that also depends on time $t$. Such a differential equation can be numerically solved with the Euler method. For this the time is discretized by a time step $\Delta t=0.1$\,ms. The $i$-th time point is then at time $t_i = i \cdot \Delta t$. In matlab we get the time points $t_i$ simply by \begin{lstlisting} dt = 0.1; tmax = 100.0; time = [0.0:dt:tmax]; % t_i \end{lstlisting} When the membrane potential at time $t_0 = 0$ is $V_0$, the so called ``initial condition'', then we can iteratively compute the membrane potentials $V_i$ for successive time points $t_i$ according to \begin{equation} \label{euler} V_{i+1} = V_i + (-V_i + E_i) \frac{\Delta t}{\tau} \end{equation} \begin{parts} \part Write a function that computes the time course of the membrane potential of the passive membrane. The function gets as input arguments the initial condition $V_0$, the vector with the time course of $E(t)$, the value of the membrane time-constant $\tau$, and the time step $\Delta t$. \part In order to test your function set $V_0=1$\,mV and $E(t)=0$ and compute $V(t)$ for $t_{max}=50$\,ms. Plot $V(t)$ and compare it to the expected result of $V(t) = \exp(-t/\tau)$. Why is $V=0$ the resting potential of this neuron? \part Response of the passive membrane to a step input. Set $V_0=0$. Construct a vector for the input $E(t)$ such that $E(t)=0$ for $t<20$\,ms and $t>70$\,ms and $E(t)=10$\,mV for $20$\,ms $