From 822bd0b04d1cce54c2fff57c4b206c51d1dcb940 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 22 Apr 2014 22:01:56 -0400 Subject: rename notes -> lectures --- lectures/lec01_intro | 17 +++++++++++++++ lectures/lec02_matlab1 | 24 +++++++++++++++++++++ lectures/lec03_matlab2 | 14 +++++++++++++ lectures/lec04_matlab3 | 26 +++++++++++++++++++++++ lectures/lec05_matlab4 | 2 ++ lectures/lec06_intro1 | 44 +++++++++++++++++++++++++++++++++++++++ lectures/lec07_intro2_eulers | 46 +++++++++++++++++++++++++++++++++++++++++ lectures/lec08_intro3 | 11 ++++++++++ lectures/lec09_intro4_stability | 22 ++++++++++++++++++++ 9 files changed, 206 insertions(+) create mode 100644 lectures/lec01_intro create mode 100644 lectures/lec02_matlab1 create mode 100644 lectures/lec03_matlab2 create mode 100644 lectures/lec04_matlab3 create mode 100644 lectures/lec05_matlab4 create mode 100644 lectures/lec06_intro1 create mode 100644 lectures/lec07_intro2_eulers create mode 100644 lectures/lec08_intro3 create mode 100644 lectures/lec09_intro4_stability (limited to 'lectures') diff --git a/lectures/lec01_intro b/lectures/lec01_intro new file mode 100644 index 0000000..7785b73 --- /dev/null +++ b/lectures/lec01_intro @@ -0,0 +1,17 @@ + +top down approach: + start with data, do stats, make predictions + see also Ma'ayan coursera course, "Network Analysis in Systems Bio" + +bottom up approach: + start with a model, run simulations to make predictions + scope: ODE, dynamics + beyond: parameter estimations, PDE, stochastics + +7 weeks, 25 lectures, 20 minutes each, 3-4 a week +questions at the end of lectures, "just for self" +5x homework assignments, required + +will discuss neuron firing a bit + +impression: will be very motivated diff --git a/lectures/lec02_matlab1 b/lectures/lec02_matlab1 new file mode 100644 index 0000000..53a8ac3 --- /dev/null +++ b/lectures/lec02_matlab1 @@ -0,0 +1,24 @@ + +'format compact' => less syntax + +self assess: + C) 13x4 + E) vertcat; different columns + +### julia notes: + +built-in types seem to default to just an array instead of, eg, 3x1 or 1x3. + +can transform with "'"; A'' != A? + +to vert/horiz cat, need to explicitly + +julia> size([1,2,3]) +(3,) + +julia> size([1,2,3]') +(1,3) + +julia> size([1,2,3]'') +(3,1) + diff --git a/lectures/lec03_matlab2 b/lectures/lec03_matlab2 new file mode 100644 index 0000000..0d5b19a --- /dev/null +++ b/lectures/lec03_matlab2 @@ -0,0 +1,14 @@ + +### julia notes + +for plotting, 'winston' is simple and matlab-like + 'gadfly' is nice/correct, using design paradigms + 'pyplot' is matplotlib + +for this class, at least to start, i'm going to try winston. + +Pkg.add("Winston") +using Winston +plot( cumsum(randn(1000)) ) + +in winston, fplot() is nice for plotting functions over ranges diff --git a/lectures/lec04_matlab3 b/lectures/lec04_matlab3 new file mode 100644 index 0000000..5388d38 --- /dev/null +++ b/lectures/lec04_matlab3 @@ -0,0 +1,26 @@ + + +mean() +std() +exp(x) -> e^x + + + +### julia notes + +ref: http://julia.readthedocs.org/en/latest/manual/noteworthy-differences/ +ref: http://sveme.org/julia-for-matlab-users-i.html + +use maximum() instead of max(). +doesn't return multiple values like matlab. use 'findmax' instead. + +anonymous function syntax: + + find(x-> x > 2, [1,2,3,4,5]) + +unpack using parens (tuples?), not brackets + +writedlm, readdlm instead of dlmwrite, dlmread +read/write instead of save/load? + +some built-ins like {sum, prod, max} are deep, not shallow like in matlab. diff --git a/lectures/lec05_matlab4 b/lectures/lec05_matlab4 new file mode 100644 index 0000000..7c5af12 --- /dev/null +++ b/lectures/lec05_matlab4 @@ -0,0 +1,2 @@ + +matlab has globals! diff --git a/lectures/lec06_intro1 b/lectures/lec06_intro1 new file mode 100644 index 0000000..97b2f39 --- /dev/null +++ b/lectures/lec06_intro1 @@ -0,0 +1,44 @@ + +Background: + +Ligands are little molecules (which could be proteins or chemicals or whatever) +which bind to a larger biomolecule (eg, a protein or DNA) called the receptor. +"Receptor/ligand" binding affinity refers to how strongly different ligands +want to attach to different receptors. Both binding (association) and +un-binding (dissociation) is happening all the time, so you get a (dynamic, or +possibly steady state) distribution of binding probability. + +ref: https://en.wikipedia.org/wiki/Ligand_(biochemistry) + +ODEs (ordinary differential equations) are those involving only a single +independent variable; eg, solving for x in terms of t, only having derivatives +dx/dt, (d^2 x / d x^2), etc. the order of the ODE is the highest order of +derivative. + +PDEs (partial differential equations) are those involving multiple independent +variables, and thus partial derivatives. Eg, x in terms of t and r, having +derivatives del x / del t, del x / del r, and del^2 x / (del t * del r). + +ref: https://en.wikipedia.org/wiki/Differential_equation#Ordinary_and_partial +--------- + +Law of mass action: rate of a reaction involving two quantities is proportional +to the product of the densities of both. + +Michaelis-Menten: approximation to solution of enzyme-catalyzed reaction +equation: + + d [S] / dt = (max reaction rate) * [S] / (Km + [S]) + + [S] is concentration of substrate S + Km is Michaelis constant, which is a specific substrate concentration + + (max reaction rate) =~ k_2 [E]_total + Km =~ (k_-1 + k_2) / (k_1) + + all assuming that enzyme E catalizes S into P with rates k_n: + + -> k_1 + [E] + [S] [ES] -> k_2 [E] + [P] + <- k_-1 + diff --git a/lectures/lec07_intro2_eulers b/lectures/lec07_intro2_eulers new file mode 100644 index 0000000..17630d2 --- /dev/null +++ b/lectures/lec07_intro2_eulers @@ -0,0 +1,46 @@ + +euler's method: + +dx/dt =~ ( x(t + Dt) - x(t) ) / Dt, for very small Dt + +so, x(t + Dt) = x(t) + f(x) * Dt, which is how to integrate the system + +"if Dt is too large, becomes highly unstable" (duh) + +scary MATLAB advice: +- watch out of totally crazy values (very high) +- non-negative values go negative + +MATLAB built-in ODE solvers: ode23, ode15s + +runge-kutta (use dxdt from between t_n and t_(n+1) ) +variable time-step methods + +summary: Euler's method sucks, news at 11. + +### misc julia notes + +the only place to find history (?!?!!) is in ~/.julia_history + +### codes + +using Winston + +a=20 +b=2 +c=5 +dt = 0.05 +tlast = 2 + +iterations = int( round(tlast/dt) ) +xall = zeros(iterations, 1) +x = c + +for i = 1:iterations + xall[i] = x + dxdt = a - b*x + x = x + dxdt*dt +end + +time = dt * [0:iterations-1]' +plot(time,xall) diff --git a/lectures/lec08_intro3 b/lectures/lec08_intro3 new file mode 100644 index 0000000..81bcae4 --- /dev/null +++ b/lectures/lec08_intro3 @@ -0,0 +1,11 @@ + +One method for determining stability of a system: + + plot derivative of value (eg, energy?) as a function of the value itself. + +Another: 2D phase plane analysis + + "stable limit cycle" + "stable fixed point" + +Short lecture, just old concepts. diff --git a/lectures/lec09_intro4_stability b/lectures/lec09_intro4_stability new file mode 100644 index 0000000..3462764 --- /dev/null +++ b/lectures/lec09_intro4_stability @@ -0,0 +1,22 @@ + +nullclines: set of points in phase space where one derivative is zero. + can often be derived analytically. + the intersections of nullclines are even more interesting; an intersection + in a 2-D phase space is a fixed point (equilibria) + +vectors in a vector field area point in the same direction (quadrant) until a +nullcline is crossed. the area is a "discrete region". + +"stable-limit cycle" is when there is a stable closed curve in phase space (as +oopposed to, eg, a fixed point) + +how to find if stable vs unstable? + +take the jacobian, and find the eigenvalues of the jacobian at the limit point. +if real parts are all positive, then unstable. if all negative, then stable. if +complex eigenvalues have positive real parts, then there is a stable limit +cycle. + +the 'bier_stability.m' script calculates eigenvalues numerically. + +PROJECT: re-write this script in julia -- cgit v1.2.3