\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{promise123} \pdfinfo{ /Title (final.pdf) /Creator (Cheatography) /Author (promise123) /Subject (Final Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Final Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{promise123} via \textcolor{DarkBackground}{\uline{cheatography.com/27564/cs/8023/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}promise123 \\ \uline{cheatography.com/promise123} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 13th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{4} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{final exam}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{{\bf{Data types}}: Numeric data,Singles,Doubles,› Integers,Character data,Logical data,Arrays of arrays (cell arrays and structure arrays), symbolic data \newline % Row Count 4 (+ 4) {\bf{manipulate expression by hand}}: STEM courses evaluate u on how think,Never trust anything comes out of a computer.{\bf{Familiar with CAS:}}Scientific expressions can become unwieldy to work by hand,Human mistakesCareless,Absent-minded,Easily distracted,Badhandwriting. \newline % Row Count 10 (+ 6) {\bf{symbolic engine is}} {\emph{MuPad}} by SciFace Software previously {\emph{MAPLE}}; MuPad was discontinued as a stand-aloneprogram, and now is only available in MATLAB. \newline % Row Count 14 (+ 4) \{\{fa-flag\}\}: {\bf{declaring MATLAB symbols}}:`y = sym('x') ` give y a value of x ;`syms x` give x a value of x; `p = sym('a{\emph{(1-e\textasciicircum{}2)') Output: p = -a}}(e\textasciicircum{}2 - 1)` {\bf{{\emph{ expression:}}}}can define a symbolcontaining symbols that are otherwiseunavailable in the Workspace; `my\_p = sym('p == a{\emph{(1-e\textasciicircum{}2)')› Output:p == -a}}(e\textasciicircum{}2 - 1)` entire {\bf{{\emph{equation}}}} \newline % Row Count 21 (+ 7) \{\{fa-square\}\}{\bf{`simplify`}}:simplifyexpressions or equations using MuPad's rules(use `pretty` with `simplify`:easier to read); `{\bf{expand}}:` multiplies out all of the parts of the expression or equation;`{\bf{factor}}`: factors the expression or equation;`{\bf{collect}}`: collects like terms;`{\bf{numden}}`:find the numerator and denominator of an expression NOT equations; `{\bf{solve}}`:(symbolicroot-finding) set the expression equal to zero and solve it, solve systems of linear or non\{\{fa-exclamation-circle\}\} cannot solve higher-order systems with linear algebra, results are assignedin {\emph{alphabetical order}};`{\bf{subs}}`: substituting\# or other ;`{\bf{ symfun}}`: symbolic function; can usethe result to evaluate different inputs\{\{fa-flag\}\}:`syms x y` \newline % Row Count 36 (+ 15) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{final exam (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{`f = x\textasciicircum{}2 + x` \newline % Row Count 1 (+ 1) `g = symfun(f,y)`-{}-{}-{}-{}-{}-{}-`g(y) = x\textasciicircum{}2 + x`; `{\bf{ezplot}}`:plotting for symbolic expression, need a defult range\{\{fa-flag\}\}:`f = sym('x\textasciicircum{}2') ` `ezplot(f, {[}-10,10{]})` \newline % Row Count 5 (+ 4) \{\{fa-square\}\}:{\bf{Derivative}}: instantaneous time rate of change of a slope; an analogous word is differential`{\bf{diff(f)}}`calculates the symbolic first derivative of a symbolic functionwith respect to the default independent variable;`{\bf{diff(f,symvar)}}` calculates the symbolic first derivative of a symbolicfunction with respect to the default independent variable `{\bf{symvar}}`\{\{fa-exclamation-circle\}\} (symvar has tobe in single quotes if the variable does not already exist as a symbolic \newline % Row Count 15 (+ 10) variable); `{\bf{diff(f,n)}}` calculates the symbolic nth derivative of the symbolic \newline % Row Count 17 (+ 2) function with respect to the default independent variable;diff(f,symvar,n) or `{\bf{diff(f,n,symvar)}}`calculates thesymbolic nth derivative of the symbolic function f with respect to the symvar-{}-{}-{}-; {\bf{Integral}}: the integral represents the area under a curve and above`{\bf{int(f)}}`calculates the symbolic single integral of a symbolic function with respect to the default independent variable;`{\bf{int(f,symvar)}}`;`{\bf{int(f,a,b)}}` evaluates theresults of the integral over the symbolic or numeric range;`{\bf{ int(f,symvar,a,b)}}`;{\bf{Differential Equation (DE):}} An equation containing an unknown function and itsderivatives; `{\bf{dsolve}}`:calculate solutions to differential equations; `{\bf{D}}`specify derivitive if you need to specify a nth order derivative, specify n afterthe symbol D ex: `{\bf{ D4y}}`;`{\bf{ dsolve(equation)}}`;`{\bf{dsolve(equation,symvar) }}`; `{\bf{dsolve(equation,condition1,condition2, …,conditionN, symvar) }}`. \{\{fa-exclamation-circle\}\}diff can also be used to calculate the differences then finding slope between points. \newline % Row Count 38 (+ 21) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{final exam (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{{\bf{Converting Symbolic Expressions to Anonymous Functions}} \newline % Row Count 2 (+ 2) a. Only available starting in versions of MATLAB starting with version 2007B (this \newline % Row Count 4 (+ 2) is one of the features that was incorporated with the adoption of MuPad) \newline % Row Count 6 (+ 2) b. To create anonymous symbolic functions, use the`{\bf{ matlabFunction}}`\{\{fa-flag\}`\}syms x` \newline % Row Count 8 (+ 2) `y = x\textasciicircum{}2 - x + 1` \newline % Row Count 9 (+ 1) `dy = diff(y)` \newline % Row Count 10 (+ 1) `f = matlabFunction(dy)` \newline % Row Count 11 (+ 1) `f(1)` \newline % Row Count 12 (+ 1) \{\{fa-square\}\}:{\bf{› Interpolation}}: consists of "method{[}s{]} of constructing \newline % Row Count 14 (+ 2) new data points within the range of a discrete set of known data points. `{\bf{{\emph{interp1}}}}`;`{\bf{{\emph{yi = interp1(x,Y,xi)}}}}`Interpolates to find yi, the \newline % Row Count 17 (+ 3) interpolated function values at the points in the vector or array xi.x contains your known data points (whose functions values are Y),which must be a vector, though xi can be a scalar, vector, ormultidimensional array. yi will always be the same size as xi;`{\bf{{\emph{yi = interp1(Y,xi)}}}}`x = 1:N, where N is length(Y) (for a vector)or size(Y,1) (for a matrix);`{\bf{{\emph{yi = interp1(x,Y,xi,method)}}}}`;`{\bf{{\emph{yi = interp1(x,Y,xi,method,'extrap')}}}}`. \newline % Row Count 26 (+ 9) {\bf{Extrapolation}} consists of "the process of estimating,beyond the original observation range, the value of a variable on the basis of its relationship with another variable.\{\{fa-exclamation-circle\}\}Some interpolation are excellent,yielding useful results BUT extrapolation can be a fool's errand. {\bf{Linear Interpolation}}:points (1, 3) and (-2, 5) Use linear interpolationto find estimate the y-value at the point x = −0.5? \newline % Row Count 35 (+ 9) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{final exam (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{› ( slope intercept form)𝑦 = 𝑚𝑥 + 𝑏-{}-{}-{}-{}-{}-{}--𝑚=5-3/-2-1=2/-3=𝑦=-2/3𝑥+𝑏-{}-{}-{}-{}-{}-{}--to find b: Substitute in one \newline % Row Count 3 (+ 3) of points 𝑦 = 𝑚𝑥 + 𝑏= 5=−2/3(−2) +𝑏→𝑏=3 2/3 -{}-{}-{}-{}-{}-{}-{}-{}-{}-the line is 𝑦 =-2/3 𝑥 + 3 2/3-{}-{}-{}-{}-{}- evaluate it at 𝑥 = −0.5 to find 𝑦(−0.5): 𝑦 −0.5 = −2/3 (−0.5) +3 \newline % Row Count 8 (+ 5) 𝑦(−0.5)=4 \newline % Row Count 9 (+ 1) Approch(pointslopeform) 2:𝑦 − 𝑦1 = 𝑚 (𝑥 − 𝑥1) \newline % Row Count 11 (+ 2) find the slope m=-2/3 \newline % Row Count 12 (+ 1) \seqsplit{𝑦−3=−2/3(𝑥−1)→𝑦−3=−2/3} 𝑥 +2/3-{}-{}-{}-{}-{}-{}-𝑦=−2/3𝑥+2/3+3 →𝑦=−2/3𝑥+3 2/3 \newline % Row Count 15 (+ 3) the line is 𝑦 =-2/3 𝑥 + 3 2/3 evaluate it at 𝑥 = −0.5 to find 𝑦(−0.5): 𝑦 −0.5 = −2/3 (−0.5) +3 \newline % Row Count 18 (+ 3) 𝑦(−0.5)=4 \newline % Row Count 19 (+ 1) \{\{fa-exclamation-circle\}\}:{\bf{Linear Interpolation}}easy to do, BUT NOT best go-to solution if need accuracy.{\bf{Spline Interpolation}}:A spline is to use a different polynomial between each pair of discrete points.{\bf{Cubic splines}} correct for this flaw by ensuring that at the data points, the adjacent splines have the same 0th, 1st and 2nd derivatives; {\bf{Curve fitting}} is "the process of constructing a curve, or mathematical function, that has the best fit to a series of data points, possibly subject to constraints `{\bf{{\emph{ polyval}}}}`, `{\bf{{\emph{ polyfit}}}}`; \{\{fa-exclamation-circle\}\} / operator use it to solve least squared problems(less error).\{\{fa-exclamation-circle\}\}Goal is the minimize the {\bf{residuals}}: the difference between the actual and predicted values at a given point (i.e. the error).take its derivative and look to see where it is zero (this gives us the {\bf{extrema}} – the extreme points of the function) to find the minimum of function; \{\{fa-exclamation-circle\}\}numerical differentiation tends to amplify noise.{\bf{Taylor series}} is a series expansion of a function 𝑓(𝑥) about a given point 𝑎.special case, known as {\bf{Maclaurin series}}, of the Taylor series exists in which 𝑎 = 0.\{\{fa-exclamation-circle\}\}The "Big O" notation (asymptotic notation) indicates higher order terms (H.O.T.s). {\bf{Central Difference:}} `{\bf{{\emph{gradient}}}}`; {\bf{Root Finding}}: zero a function; `{\bf{{\emph{fzero}}}}`. \newline % Row Count 48 (+ 29) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{final exam (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{\{\{fa-square\}\}: {\bf{finding area under curve}}:› Rectangles,Trapezoids,Parabolas.{\bf{Riemann Sums }}:\{\{fa-exclamation-circle\}\}If you average the left and right Riemannsum, you get the trapezoidal sum.{\bf{Left Riemann Sum}}:fits rectangles underneath curve using left of interval as location for hight of rectangle; Overestimate if f decreasing \& vice.versa.{\bf{Right Riemann Sum}}: like left Riemann Sum but in right instead; Overestimate if f is increasing and vice versa.{\bf{Middle Riemann Sum}}: Approximates the function by its value at themiddle point of the subinterval, yieldingmultiple rectangles with a base of Δx and the average height between the left and right.\{\{fa-exclamation-circle\}\} This better than R \& L Riemann sum.{\bf{Trapezoidal Rule}}:Approximates the function by fitting trapezoids underneath the curve.{\bf{Simpson's Rule}}:› Approximates the function by fitting parabolas under the curve. \{\{fa-exclamation-circle\}\} : must use an even number of intervals; › Pros and cons of using this versus trapezoids – more computationally expensive, but a better fit at times.\{\{fa-exclamation-circle\}\} Left-point and right-point sums were just wrong\{\{fa-exclamation-circle\}\}mid-point, trapezoidal and Simpson's) all got the correct answer. The choice between these depends on what the data looks like and what computational expense you can tolerate.{\bf{solve differentialequations}}:Euler's Method( forward Euler method), Runge-Kutta methods. {\bf{"state-space}}: breakyour system down into a system of simultaneous first order differential equations.\{\{fa-exclamation-circle\}\}The number of first order equations will be equal to the sum of number of independent variable(s) times the order.% Row Count 34 (+ 34) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{p{0.54594 cm} x{1.12221 cm} x{1.36485 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{3.833cm}}{\bf\textcolor{white}{tables}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{Symbolic} \seqsplit{Command} & Description & Symbolic Command Description Numeric Analog \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} ezplot & 2D plot & plot \tn % Row Count 4 (+ 1) % Row 2 \SetRowColor{LightBackground} ezmesh & Wireframe mesh & mesh \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} \seqsplit{ezmeshc} & Contour plot under wireframe mesh & meshc \tn % Row Count 8 (+ 3) % Row 4 \SetRowColor{LightBackground} ezsurf & Surface plot & surf \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} \seqsplit{ezsurfc} & Contour plot under surface plot & surfc \tn % Row Count 12 (+ 3) % Row 6 \SetRowColor{LightBackground} \seqsplit{ezcontour} & Contour plot & contour \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} \seqsplit{ezcontourf} & Filled contour plot & contourf \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} \seqsplit{ezplot3} & 3D plot & plot3 \tn % Row Count 17 (+ 1) % Row 9 \SetRowColor{white} \seqsplit{ezpolar} & Polar plot & polar \tn % Row Count 18 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}