Index: sm/workshop/2012/Talks/08_Inverse_methods/08_Inverse_methods.tex
===================================================================
--- /issm/workshop/2012/Talks/08_Inverse_methods/08_Inverse_methods.tex	(revision 14035)
+++ 	(revision )
@@ -1,274 +1,0 @@
-%Preamble {{{
-\documentclass[9pt,notes=hide]{beamer}    % Document class: beamer %8 pts is also a good option
-\usetheme[jpl,headstyle=institute,fnolabel=,sidebar=.15\paperwidth,footstyle=low,footsep={ $\cdot$ },TPomitframeno]{Pasadena}
-\useinnertheme{MLHacks}              % ISSM bonuses (ghostframes for example)
-\usepackage[T1]{fontenc}             % T1 encoding is better for foreign langages
-\usepackage{aeguill,aecompl}         % Virtual fonts
-\usepackage{amsmath,amssymb,amsfonts}% Mathematical symbols (useful for equations)
-\usepackage{bm}                      % maths letters, real = IR
-\usepackage{xcolor}                  % We can define new colors
-\usepackage{graphicx}                % Include pictures
-\usepackage{times}                   % Use Times Font instead of default
-\usepackage{appendixnumberbeamer}
-\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}
-\usepackage{booktabs}                        %nice tables (toprule, bottomrule,...)
-\graphicspath{                       % directories where the pictures are located
-{Graphics/}
-}
-\hypersetup{pdfstartview={Fit}}     % Acrobat reader: open fit to screen
-
-\setbeamercovered{transparent} %invisible, transparent, dynamic, highly dynamic
-%}}}
-%Newcommands {{{
-\newcommand*{\MAT}[1]{\ensuremath{\mathbf{#1}} }        %Matrice name (Bold)
-\newcommand*{\VEC}[1]{\ensuremath{\bm{#1}} }            %Vector name (Bold Italic)
-\newcommand*{\SET}[1]{\ensuremath{\mathcal{#1} }}       %Set, Space (italic)
-\newcommand*{\R}[0]{{\mathbb R}}                       %real set IR
-\newcommand*{\N}[0]{{\mathbb N}}                       %natural set IN
-\newcommand*{\Trace}[1]{\text{Tr}\left( #1\right)}     %trace (Tr(A))
-\newcommand*{\abs}[1]{\left| #1\right|}                %absolute value |x|
-\newcommand*{\norm}[1]{\lVert#1\rVert}                 %norm ||x||
-\newcommand*{\grad}[1]{\nabla #1}
-\newcommand*{\divergence}[1]{\nabla \cdot #1}
-\newcommand*{\Divergence}[1]{\nabla \cdot #1}
-\newcommand*{\eps}[0]{\dot{\bm \varepsilon}}          %strain rate tensor
-\newcommand*{\epseff}[0]{\ensuremath{\dot{\varepsilon}_{e} }} %effective strain rate
-\newcommand*{\epscomp}[0]{\dot{\varepsilon}}          %strain rate tensor component
-\newcommand*{\stress}[0]{{\bm \sigma}}                %stress tensor
-\newcommand*{\devstress}[0]{\stress'}                 %deviatoric stress tensor
-\newcommand*{\stresscomp}[0]{\ensuremath{\sigma}}     %stress tensor component
-\newcommand*{\vel}[0]{\VEC{v}}                        %velocity vector
-\newcommand*{\velbar}[0]{\VEC{\bar{v} }}              %velocity vector BAR
-\newcommand*{\velobs}[0]{\ensuremath{\VEC{v}^{\text{obs}} }}%velocity obs
-\newcommand*{\ubar}[0]{\ensuremath{\overline{v}_x}}   %velocity vector BAR
-\newcommand*{\vbar}[0]{\ensuremath{\overline{v}_y}}   %velocity vector BAR
-\newcommand*{\vx}[0]{\ensuremath{v_x}}                %vx
-\newcommand*{\vy}[0]{\ensuremath{v_y}}                %vy
-\newcommand*{\vz}[0]{\ensuremath{v_z}}                %vz
-\newcommand*{\vxobs}[0]{\ensuremath{v_x^{\text{obs}} }}%vx obs
-\newcommand*{\vyobs}[0]{\ensuremath{v_y^{\text{obs}} }}%vy
-\newcommand*{\pressure}[0]{p}                         %pressure
-\newcommand*{\nx}[0]{\ensuremath{n_x}}                %nx
-\newcommand*{\ny}[0]{\ensuremath{n_y}}                %ny
-\newcommand*{\nz}[0]{\ensuremath{n_z}}                %nz
-\newcommand*{\Lagrangian}[0]{\ensuremath{\mathcal{L} }}
-\newcommand*{\Cost}[0]{\ensuremath{\mathcal{J} }}
-\newcommand*{\Ms}[0]{\ensuremath{\dot{M}_s}}
-\newcommand*{\Mb}[0]{\ensuremath{\dot{M}_b}}
-\newcommand*{\inner}[2]{\ensuremath{\langle #1 , #2 \rangle}}               %inner product <.,.>
-\newcommand*{\BigO}[1]{\mathcal{O}\left( #1\right) }     %Big O landau notation
-
-%%Automatically insert outline slide at the begining of each new section (very nice!)
-%\AtBeginSection[]{
-%\begin{frame}<beamer>
-%	\ghostframe                      %do not count slide
-%	\frametitle{Outline}             % title of the slide
-%	\tableofcontents[currentsection]
-%\end{frame}
-%}
-%}}}
-%Presentation properties{{{
-%between brackets    []: shown on headers and footers of every slide (must be short)
-%between parenthesis (): shown on title page only (long)
-\title[Inverse Methods]{Ice Sheet System model}
-\subtitle{Inverse Methods}
-\author[M. Morlighem]{
-Eric       \textsc{Larour}\inst{1},
-Eric       \textsc{Rignot}\inst{1,3},
-\textbf{Mathieu    \textsc{Morlighem}}\inst{1,2},
-H\'el\`ene \textsc{Seroussi}\inst{1,2}
-Chris      \textsc{Borstad}\inst{1},
-Feras      \textsc{Habbal}\inst{1,3},
-Daria      \textsc{Halkides}\inst{1,4},
-Behnaz     \textsc{Khakbaz}\inst{1},
-John       \textsc{Schiermeier}\inst{1},
-Nicole     \textsc{Schlegel}\inst{1}
-\vspace{1em}
-}
-\institute[Jet Propulsion Laboratory]{
-\inst{1}Jet Propulsion Laboratory - California Institute of Technology\\
-\inst{2}Laboratoire MSSMat, \'Ecole Centrale Paris, France\\
-\inst{3}University of California, Irvine\\
-\inst{4}Joint Institute for Regional Earth System Science \& Engineering, UCLA
-}
-\conference[ISSM Workshop 2012]{ISSM Workshop 2012}
-\date[]{\hspace{-15em}December 2012\hspace{3em}\copyright Copyright 2012. All rights reserved}
-\logo{\includegraphics[width=8em]{ISSMlogo}}
-%}}}
-\begin{document}
-
-%Title slide %{{{
-\begin{frame}[plain] %No headers or footers
-	%Do not change, this page is automatically generated
-	\ghostframe
-	\titlepage
-\end{frame} %}}}
-\begin{frame}{Outline}%{{{
-	\tableofcontents
-\end{frame}%}}}
-\section{Introduction}
-\subsection{Model equations}
-\begin{frame} \frametitle{Ice flow model equations}%{{{
-	\vspace{-10pt}
-	\uncover<+->{\begin{block}{Field equations}
-		\begin{enumerate}
-			\item Stokes flow:
-				\begin{equation}
-					\nabla \cdot \stress + \rho \VEC{g} = \VEC{0}
-				\end{equation}
-			\item Incompressibility:
-				\begin{equation}
-					\divergence{\vel}=0
-				\end{equation}
-			\item Constitutive law:
-				\begin{equation}
-					\devstress
-					= \stress + \pressure\;\MAT{I} 
-					= 2\mu\eps 
-					\hspace{3em} 
-					\mu = \dfrac{\only<3>{\color{red}}B}{2 \; \epseff^{1-1/n}}
-				\end{equation}
-		\end{enumerate}
-	\end{block}}
-	\uncover<+->{\begin{block}{Boundary conditions}
-		\renewcommand\arraystretch{1.7}
-		\begin{tabular}[b]{lll}
-			Ice/Air interface: Free surface &
-			$\stress \cdot\VEC{n}=P_{atm}\;\VEC{n}\simeq\VEC{0}$ &
-			on $\Gamma_s$ \\
-			Ice/Ocean interface: water pressure &
-			$\stress \cdot\VEC{n}=P_w\;\VEC{n}$ &
-			on $\Gamma_w$ \\
-			Ice/Bedrock interface (1): lateral friction &
-			$ \left(\stress \cdot\VEC{n} + {\only<3->{\color{red}}\alpha}^2\vel\right)_{\parallel} = \VEC{0}$ &
-			on $\Gamma_b$ \\
-			Ice/Bedrock interface (2): impenetrability &
-			$\vel\cdot\VEC{n}=-\Mb\,\nz$ & 
-			on $\Gamma_b$ \\
-			+ Dirichlet condition
-		\end{tabular}
-	\end{block}}
-	\note{Ice follows a Stokes flow: we neglect the acceleration. We also neglect the Coriolis
-	effects.
-	Ice is also an incompressible fluid so the divergence of the velocity is zero.
-	Ice being an incompressible fluid, it's consitutive law inly involves the deviatoric stress, and
-	ice is modeled as a viscous fluid so the deviatoric stress is proportional to the deviatoric
-	stress. The viscosity follows Glen's law, which is non linear because it depends on the effective
-	strain rate.
-	For the boundary conditions, the upper surface is considered stress free, air pressure being
-	negligible, water pressure is applied at the ice/ocean interface. Under grounded ice, it is a
-	combination of Dirichlet and Neuman conditions: there is lateral friction along the plane
-	tangential to the interface, and an impenetrability condition along the normal. (CLICK)
-	Now some parameters of these equations are not well understood and must be inferred from
-	observation. It is the case of the friction coefficient $\alpha$ in red here. To infer the
-	friction under the ice, we use an inversion method.}
-\end{frame} %}}}
-\subsection{Inverse problem}
-\begin{frame} \frametitle{Inverse problems}%{{{
-	\begin{itemize}
-		\item Basal friction and ice hardness are difficult to measure
-		\item Use extra datasets to infer unknows
-		\item[$\rightarrow$] ex: surface velocities derived from InSAR
-	\end{itemize}
-	\uncover<2->{\begin{block}{PDE-constrained optimization}
-		Minimize cost function
-		\begin{equation}
-			{\mathcal J}\left(\vel,\alpha\right)
-			= \frac{1}{2} \int_{\Gamma_s} \left(\vx-\vxobs\right)^2 + \left(\vy-\vyobs\right)^2 dS
-			+ {\mathcal R}\left(\alpha\right)
-		\end{equation}
-		Subject to:
-		\renewcommand\arraystretch{1.5}
-		\begin{equation}
-			\begin{array}{rcll}
-				\nabla \cdot \mu\left(\grad{\vel}+\grad{\vel}^T\right)-\grad{\pressure}+ \rho \VEC{g} & = & \VEC{0} & \text{ in $\Omega$}\\
-				\divergence{\vel}  & = & 0 & \text{ in $\Omega$}\\
-				\stress\cdot\VEC{n} & = & \VEC{f} & \text{ on $\Gamma_s\cup\Gamma_w$}\\
-				\left(\stress \cdot\VEC{n} + \alpha^2\vel\right)_{\parallel} & = &\VEC{0} & \text{ on $\Gamma_b$} \\
-				\vel\cdot\VEC{n} & = & -\Mb\,\nz & \text{ on $\Gamma_b$}
-			\end{array}
-		\end{equation}
-	\end{block}}
-	\note{We rely on surface velocities to infer those parameter using inverse methods. The
-	optimization problem is defined as follows:\\
-	We seek for a minimum of a cost function J that is defined as the difference between the modeled
-	and the observed surface velocity, plus a regularizing term usualy Tikhonov, under the constraint
-	that the modeled velocity must obey the stress-balance equations.}
-\end{frame} %}}}
-\subsection{Algorithm}
-\begin{frame} \frametitle{Algorithm of resolution}%{{{
-	\begin{center}
-		\includegraphics[width=\textwidth]{algo_cm0.pdf}
-	\end{center}
-\end{frame} %}}}
-
-\section{Hands on 1 (ice rigidity)}
-\begin{frame} \frametitle{Hands on 1 (ice rigidity)}%{{{
-	\lstinputlisting[firstnumber=3,firstline=3,lastline=10,basicstyle=\lstbasicfont\scriptsize]{Code/runme.m}
-	\vspace{-1.5em}
-	\lstinputlisting[firstnumber=25,firstline=25,lastline=29,basicstyle=\lstbasicfont\scriptsize]{Code/Square.par}
-	\vspace{-1em}
-	\begin{center}
-		\includegraphics[width=.4\textwidth]{TrueB}
-		\hspace{1em}
-		\includegraphics[width=.4\textwidth]{VelObs}
-	\end{center}
-\end{frame} %}}}
-\subsection{Initial state}
-\begin{frame} \frametitle{Start from constant hardness}%{{{
-	\lstinputlisting[firstnumber=16,firstline=16,lastline=25]{Code/runme.m}
-	\begin{center}
-		\includegraphics[width=.4\textwidth]{BInit}
-		\hspace{1em}
-		\includegraphics[width=.4\textwidth]{VelInit}
-	\end{center}
-\end{frame} %}}}
-\subsection{Inversion}
-\begin{frame} \frametitle{Inverse method}%{{{
-	\lstinputlisting[firstnumber=31,firstline=31,lastline=48,tabsize=1,basicstyle=\lstbasicfont\scriptsize]{Code/runme.m}
-\end{frame} %}}}
-\begin{frame} \frametitle{Inverse method}%{{{
-	\begin{center}
-		\includegraphics[width=.45\textwidth]{BFinal}
-		\includegraphics[width=.45\textwidth]{VelFinal}
-	\end{center}
-\end{frame} %}}}
-
-\section{Hands on 2 (friction)}
-\begin{frame} \frametitle{Hands on 2 (friction)}%{{{
-	\begin{itemize}\itemsep=+1em
-		\item Same example but now for a grounded glacier:
-		\item Changes step 1:
-			\begin{enumerate}\itemsep=+.5em
-				\item increase bed and surface elevation by 100 m
-				\item mask is now all grounded
-				\item $B=1.8\times10^8$ uniform
-				\item friction coefficient: 50, and 10 for $600000<x<400000$
-			\end{enumerate}
-		\item Changes step 2:
-			\begin{enumerate}\itemsep=+.5em
-				\item friction coefficient uniform (50)
-			\end{enumerate}
-		\item Changes step 3:
-			\begin{enumerate}\itemsep=+.5em
-				\item We now invert for {\tt'FrictionCoefficient'}
-				\item Do we keep the same cost function ?
-				\item gradient now scaled to 10
-				\item we want the parameter to be between 1 and 100
-			\end{enumerate}
-	\end{itemize}
-\end{frame} %}}}
-
-%Thanks slide{{{
-\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{Thanksbg}}
-\begin{frame}[plain]
-	\ghostframe
-	\begin{center}
-		\vspace*{-0.1\paperheight}
-		\hspace*{-0.15\paperwidth}\Huge{Thanks!}
-	\end{center}
-	\note{Thank you very much for your attention}
-\end{frame}
-\usebackgroundtemplate{}
-%}}}
-\end{document}
Index: sm/workshop/2012/Talks/08_Inverse_methods/Makefile
===================================================================
--- /issm/workshop/2012/Talks/08_Inverse_methods/Makefile	(revision 14035)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#Makefile for beamer
-TARGET=08_Inverse_methods
-
-export TEXINPUTS=$(JPL_SVN)/publications/templates/beamer/Theme/Pasadena//:
-
-all: one
-
-one: 
-	pdflatex -halt-on-error -file-line-error $(TARGET).tex
-	open $(TARGET).pdf
-
-complete: 
-	pdflatex -halt-on-error -file-line-error -draftmode $(TARGET).tex
-	#bibtex $(TARGET)
-	pdflatex -halt-on-error -file-line-error -draftmode $(TARGET).tex
-	pdflatex -halt-on-error -file-line-error $(TARGET).tex
-	open $(TARGET).pdf
-
-bib:
-	bibtex $(TARGET)
-
-links:
-	ln -s $(ISSM_DIR)/publications/templates/beamer/Theme/Pasadena/*.sty .
-	ln -s $(ISSM_DIR)/publications/templates/beamer/Theme/Pasadena/general/*.sty .
-	ln -s $(ISSM_DIR)/publications/templates/beamer/Theme/Pasadena/subtheme/*.sty .
-	ln -s $(ISSM_DIR)/publications/templates/beamer/Theme/Pasadena/ML/*.sty .
-	ln -s $(ISSM_DIR)/publications/templates/beamer/Theme/Pasadena/graphics/JPL/*.pdf .
-
-unlinks: 
-	find . -maxdepth 1 -type l -print | xargs rm
-
-open:
-	open -a /Applications/Adobe\ Reader\ 9/Adobe\ Reader.app/ $(TARGET).pdf
-
-clean: 
-	rm -f ${TARGET}.{dvi,ps,pdf,toc,log,aux,out,nav,snm,bbl,blg,vrb}
-
-allclean: 
-	make clean
-	make unlinks
Index: sm/workshop/2012/Talks/08_Inverse_methods/mcode.sty
===================================================================
--- /issm/workshop/2012/Talks/08_Inverse_methods/mcode.sty	(revision 14035)
+++ 	(revision )
@@ -1,280 +1,0 @@
-%%
-%%   This is file `mcode.sty'
-%%
-%%   It is supposed to help you easily include MATLAB source code
-%%   into LaTeX document,  but have it nicely highlighted, using
-%%   the great listings package.
-%%
-%%   PLEASE NOTE that this package does nothing but save you from
-%%   figuring out some configurations  in setting up the LISTINGS
-%%   package. ALL the work is done by that package!  Thus, please
-%%   refer your questions to the listings package documentation.
-%%
-%%   Usage: You have three ways of including your MATLAB code. As
-%%   environment,  as inline object and directly from an external
-%%   file.
-%%
-%%   1) Environment:
-%%
-%%          \begin{lstlisting}
-%%             YOUR CODE HERE
-%%          \end{lstlisting}
-%%
-%%
-%%   2) Inline object:
-%%
-%%          Bla bla \mcode{CODEFRAGMENT} bla bla.
-%%
-%%
-%%   3) Include external file (in environment form)
-%%
-%%          \lstinputlisting{YOUR-FILE.m}
-%%
-%%
-%%   For your convenience this package has the following options:
-%%
-%%   - bw  if you intend to print the document (highlighting done
-%%         via text formatting (bold, italic) and shades of gray)
-%%   
-%%   - numbered  if you want line numbers
-%%
-%%   - autolinebreaks  if you want  the package to  automatically
-%%          wrap your  code.  This is buggy as it  may well break
-%%          break syntax and it  doesn't work well with comments.
-%%          You REALLY should wrap your code manually.
-%%
-%%   - useliterate   if you want  some characters / relations  in
-%%          your code to be replace with something more readable.
-%%          Example: ~= becomes $\neq$, >= becomes $\geq$,  delta
-%%          becomes $\delta$ and so on.
-%%
-%%   - framed  if you want a frame  around the source code blocks
-%%
-%%   - final  if you have  ``gloablly'' set the draft option, the
-%%         listings package will  not output the code at all.  to
-%%         force it to  do so anyway,  load this package with the
-%%         final option (passes the ``final'' on to listings).
-%%
-%%   For example, you may use \usepackage[numbered,framed]{mcode}
-%%   in your document preamble.
-%%   
-%%   Note:  Inside code blocks you  can escape to LaTeX text mode
-%%   using §...§.  For ex. §text and some math: $x^2$§,  which is
-%%   especially  useful  in comments  for putting  nicely typeset
-%%   equations etc.  To get the same  colour/style as in the rest
-%%   of the comment use \mcommentfont, i.e. §\mcommentfont $x^2$§
-%%
-%%   To change the font used,  edit the first line in the "custo-
-%%   mise below" section.  And feel free to  edit other things as
-%%   well.  Refer to the documentation of the listings package to
-%%   see what  else you could do.  If an extra small font  is re-
-%%   quired,  use  {\fontfamily{pcr}\fontsize{3}{4.6}\selectfont}
-%%   in the definition of \lstbasicfont.
-%%
-%%   Author:
-%%      Florian Knorn | florian@knorn.org | www.florian-knorn.com
-%%
-%%   Version history:
-%%      2.2  --  Bugfix (thanks Willi Gerbig!)
-%%      2.1  --  Finally automatic detection between end and end
-%%      2.0  --  New options for line breaking and literate prog.
-%%      1.8  --  Fixed typo in documentation regarding §...§
-%%      1.7  --  Added MATLAB block comment syntax %{ ...... %}
-%%      1.6  --  Added some infos, dealing with keyword ``end''
-%%      1.5  --  Tweaked check to see wether textcomp is loaded
-%%      1.4  --  Fixed misconfig (mathescape now set to false)
-%%      1.3  --  Purely cosmetic (tabs replaced by spaces)
-%%      1.2  --  Added \lstset{showstringspaces=false}
-%%      1.1  --  Added \mcode command and [final] option
-%%      1.0  --  Release
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%              D O N ' T    T O U C H    T H I S                %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\fileversion{2.2}
-\def\filedate{2011/08/26}
-
-\typeout{-- Package: `mcode' \fileversion\space <\filedate> --}
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{mcode}[\filedate\space\fileversion]
-
-% for bw-option
-\newif\ifbw
-\DeclareOption{bw}{\bwtrue}
-
-% numbered option
-\newif\ifnumbered
-\DeclareOption{numbered}{\numberedtrue}
-
-% final option
-\newif\iffinal
-\DeclareOption{final}{\finaltrue}
-
-% autolinebreaks option
-\newif\ifautolinebreaks
-\DeclareOption{autolinebreaks}{\autolinebreakstrue}
-
-% literate programming (replace certain characters/relations
-\newif\ifuseliterate
-\DeclareOption{useliterate}{\useliteratetrue}
-
-% framed option
-\newif\ifframed
-\DeclareOption{framed}{\framedtrue}
-
-\DeclareOption*{% default
-  \PackageWarning{mcode}{Unknown option `\CurrentOption' !}%
-}
-\ProcessOptions
-
-\ifbw\typeout{ - settings optimized for printing (bw formating)}
-\else\typeout{ - settings optimized for display (colour formating)}\fi
-\ifnumbered\typeout{ - line numbering enabled}\else\fi
-\ifuseliterate\typeout{ - literate programming (character replacements) enabled}\else\fi
-\ifautolinebreaks\typeout{ - automatic line breaking enabled (careful, buggy!)}\else\fi
-\ifframed\typeout{ - framed listings}\else\fi
-
-% This command allows you to typeset syntax highlighted Matlab
-% code ``inline''.  The font size \small seems to look best...
-\newcommand{\mcode}[1]{\lstinline[basicstyle=\lstbasicfont\small]|#1|}
-
-% check if color command exists
-\ifx\color\undefined%
-  \RequirePackage{xcolor}%
-\fi
-
-% check if listings has been loaded
-\ifx\lstset\undefined%
-  \iffinal
-    \RequirePackage[final]{listings}
-  \else
-    \RequirePackage{listings}
-  \fi
-\fi
-
-% Check if textcomp has been loaded (this package is needed for
-% upright quotes '' (instead of typographic ones `´)...
-\ifx\textquotesingle\undefined% 
-  \RequirePackage{textcomp}%
-\fi
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                C U S T O M I S E   B E L O W                  %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-% ---------------------------------------------------------------------------------
-% default font
-\def\lstbasicfont{\fontfamily{pcr}\selectfont\footnotesize}
-
-% ---------------------------------------------------------------------------------
-% matlat languate definition
-\lstdefinelanguage{matlabfloz}{%
-  alsoletter={...},%
-  morekeywords={%                             % keywords
-  break,case,catch,continue,elseif,else,end,for,function,global,%
-  if,otherwise,persistent,return,switch,try,while,...},%
-  comment=[l]\%,                              % comments
-  morecomment=[l]...,                         % comments
-  morecomment=[s]{\%\{}{\%\}},                % block comments
-  morestring=[m]'                             % strings 
-}[keywords,comments,strings]%
-
-% ---------------------------------------------------------------------------------
-% general definitions
-\lstset{%
-  basicstyle={\lstbasicfont},                 % set font
-  showstringspaces=false,                     % do not emphasize spaces in strings
-  tabsize=3,                                  % number of spaces of a TAB
-  mathescape=false,escapechar=§,              % escape to latex with §...§
-  upquote=true,                               % upright quotes
-  aboveskip={1.5\baselineskip},               % a bit of space above listings
-  columns=fixed                               % nice spacing
-}
-
-% ---------------------------------------------------------------------------------
-% define colours and styles
-\ifbw % use font formating and gray 'colors'
-	\def\mcommentfont{\color[gray]{.75}\itshape} %comments light gray and italic
-  \lstset{language=matlabfloz,                % use our version of highlighting
-    keywordstyle=\bfseries,                   % keywords in bold
-    commentstyle=\mcommentfont,               % comments 
-    stringstyle=\color[gray]{0.5}             % strings darker gray
-  }
-\else% notbw => use colors : )
-	\def\mcommentfont{\color[rgb]{.133,.545,.133}} %comments in green
-  \lstset{language=matlabfloz,                % use our version of highlighting
-    keywordstyle=\color[rgb]{0,0,1},          % keywords in blue
-    commentstyle=\mcommentfont,               % comments
-    stringstyle=\color[rgb]{.627,.126,.941}   % strings in purple
-  } 
-\fi%bw
-
-% ---------------------------------------------------------------------------------
-% automatic line breaking --- warning, this is buggy and
-% doesn't break comments correctly!
-\ifautolinebreaks
-	\newsavebox{\lbreakdots}\sbox{\lbreakdots}{\lstbasicfont\mcommentfont...}
-	\lstset{breaklines=true,breakatwhitespace=true,prebreak=\usebox{\lbreakdots}}
-\fi
-
-% ---------------------------------------------------------------------------------
-% literate replacements
-% the following is for replacing some matlab relations like >= or ~=
-% by the corresponding LaTeX symbols, which are much easier to read ...
-\ifuseliterate
-	\lstset{%
-		literate=%
-			{~}{{$\neg$}}1 %               \neg
-			{<=}{{\tiny$\leq$}}1 %         \leq
-			{>=}{{\tiny$\geq$}}1 %         \geq
-			{~=}{{\tiny$\neq$}}1 %         \neq
-			{delta}{{\tiny$\Delta$}}1 %    \Delta
-			{(end)}{\lstbasicfont (end)}{5} % black ``end'' when indexing last vector element
-			{({ }end)}{\lstbasicfont ({ }end)}{6}
-			{(end{ })}{\lstbasicfont (end{ })}{6}
-			{({ }end{ })}{\lstbasicfont ({ }end{ })}{7}
-			{:end}{\lstbasicfont :end}{4}
-			{:{ }end}{\lstbasicfont :{ }end}{5}
-			{end:}{\lstbasicfont end:}{4}
-			{end{ }:}{\lstbasicfont end{ }:}{5}
-			{,end}{\lstbasicfont ,end}{4}
-			{,{ }end}{\lstbasicfont ,{ }end}{5}
-	}
-\else
-	\lstset{%
-		literate=%
-			{(end)}{\lstbasicfont (end)}{5} % black ``end'' when indexing last vector element
-			{({ }end)}{\lstbasicfont ({ }end)}{6}
-			{(end{ })}{\lstbasicfont (end{ })}{6}
-			{({ }end{ })}{\lstbasicfont ({ }end{ })}{7}
-			{:end}{\lstbasicfont :end}{4}
-			{:{ }end}{\lstbasicfont :{ }end}{5}
-			{end:}{\lstbasicfont end:}{4}
-			{end{ }:}{\lstbasicfont end{ }:}{5}
-			{,end}{\lstbasicfont ,end}{4}
-			{,{ }end}{\lstbasicfont ,{ }end}{5}
-	}
-\fi%literates
-
-% ---------------------------------------------------------------------------------
-% line numbering
-\ifnumbered% numbered option
-  \lstset{%
-    numbersep=3mm, numbers=left, numberstyle=\tiny, % number style
-  }
-\fi
-
-\ifframed%   framed option
-  \lstset{%
-    frame=single,                             % frame
-  }
-  \ifnumbered%
-    \lstset{%
-      framexleftmargin=6mm, xleftmargin=6mm   % tweak margins
-    }
-  \fi
-\fi
-
-\endinput
-%% End of file `mcode.sty'.
