Matlab_Tutorial_2

Matlab_Tutorial_2 - BCB570 MatlabTutorialII February3,2010...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
BCB 570 Matlab Tutorial II February 3, 2010 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Outline Symbolic Math Toolbox Jacobian Matrix Eigenvectors and Eigenvalues QR Decomposition ODE Tools Example 1: Glucose (p86) Example 2: Water Formation 2
Background image of page 2
Symbolic Math Toolbox (1/2) The Symbolic Math Toolbox for Matlab enables us to create symbolic variables and expressions >> syms E S ES EP P k1 k_1 k2 k_2 k3 k_3; >> dSdt = -(k1*E*S-k_1*ES); >> dEdt = -(k1*E*S-k_1*ES)+k2*ES; ... Matlab also performs operations such as simplification, expansion, or differentiation on symbolic expressions >> syms x y; % create symbolic variables x and y >> diff(x^2/3-x+5*y,x,2) % take second derivative w/ respect to x ans = 2/3 >> expand((x-1)*(y+1)/2) % expand an expression ans = x/2 - y/2 + (x*y)/2 - 1/2 >> simplify(x/2 - y/2 + (x*y)/2 - 1/2) % simplify an expression ans = ((x - 1)*(y + 1))/2 >> pretty((x-1)*(y+1)/2) % print a more readable expression (x - 1) (y + 1) --------------- 2 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Plotting functions as symbolic expressions: >> f = x/(2*pi) - 2*sin(x/pi) - 5; >> zeroes = solve(f); >> f1 = diff(f) f1 = 1/(2*pi) - (2*cos(x/pi))/pi >> critical_points = solve(f1) critical_points = pi*acos(1/4) -pi*acos(1/4) >> ezplot(f) >> hold >> plot(double(critical_points),double(subs(f,critical_points)),'ro') Symbolic Math Toolbox (2/2) 4 -6 -4 -2 0 2 4 6 -6.5 -6 -5.5 -5 -4.5 -4 -3.5 x x/(2 π ) - 2 sin(x/ π ) - 5 ‘ro’ specifies color = red, marker = empty circle options for plotting points Other graphics for symbolic expressions: ezplot3, ezpolor, ezcontour, ezmesh, ezsurf, etc.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/08/2010 for the course BCB 570 taught by Professor Juliedickerson during the Spring '10 term at Iowa State.

Page1 / 22

Matlab_Tutorial_2 - BCB570 MatlabTutorialII February3,2010...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online