engfinalnotes

engfinalnotes - Sec 1 Engineering Problem Solving...

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

View Full Document Right Arrow Icon
Sec 1 Engineering Problem Solving Horizontal position: x(t) = vtcos(theta) Vertical position: y(t) = vtsin(theta) – (gt^2)/2 Time: t = 2vsin(theta)/g Sec 2 Technical Computing Environment Area of trapezoid: A = (b1+b2)h/2 Temperature: Tc = 5/9(Tf-32) Special Variables Ans: default variable name Pi: ratio of circle circumference to its diameter Esp: smallest amount by which two numbers can differ Inf: infinity Nan: not a number Date: current date in a character string format Flops: count of floating-point operations Commands Who: lists the names of defined variables Whos: lists the names and sizes of defined variables Clear: clears all variables, resets default values of special variables Clear var: clears variable var Clc: clears the command window, homes the cursor (moves the prompt to the top line), but does no affect variables Clf: clears the current figure and thus clears the graph window More on: enables paging of the output in the command window More off: disables paging of the output in the command window Punctuation Semicolon: suppresses the display of the result Comma: place multiple commands on one line Percent sign: comment Ellipses: indicates the command continues on the next line Functions Abs(x): Absolute value Sign(x): sign, returns -1 if x<0, 0 if x=0, 1 if x>0 Exp(x): Exponential Log(x): natural logarithm Log10(x): logarithm(base 10) Sqrt(x): square root Rem(x,y): remainder of x/y Binary (base 2) form 53 = 00110101 Format Format short: 4 decimal digits Format long: 14 decimal digits Format short/long e: scientific notation Format short/long g; good Format bank: 2 decimal digits Format +: positive, negative, zero Format loose: line space Format compact: no line space Display Disp(variable) Disp(‘string’) Fprintf(‘\nThe temperature is %w.df degrees F\n’, temp) Sec 3 Files and File Management Diary file: saves all text from the matlab session as text in file Save data: stores all workspace values in the file data.mat Disp(ans): display results without identifying variable names Input(‘prompt’): prompt user with text in quotes, accept input until “enter” is typed Keyboard: give control to keyboard temporarily Sec 4 Trigonometry and Complex Numbers Trigonometry Sin(alpha), cos(alpha), tan(alpha) Asin(z), acos(z), atan(z) Complex Numbers J = sqrt(-1), j^2 = -1 Z = x + jy Z = rcos(theta) + jrsin(theta) or z = rangle(theta) R = sqrt(x^2+y^2), abs(z) Theta = angle(z) Theta = (180/pi)*angle(z) Z = r(cos(theta) + jsin(theta)) E^jtheta = cos(theta) + jsin(theta) Cos(theta) = 1/2(e^jtheta + e^-jtheta) Sin(theta) = 1/2j(e^jtheta – e^-jtheta) Z = re^jtheta Z1 + z2 = (x1 + x2) + j(y1 +y2) Z1 – z2 = (x1 – x2) + j(y1 – y2) (Z1)(Z2) = (x1x2 – y1y2) + j(x1y2 + x2y1) = r1r2e^j(theta1-theta2) Z* = x – jy = re^-jtheta Z1/z2 = (x1x2 +y1y2)/(x2^2+y2^2) + j(x2y1 – x1y2)/ (x2^2 + y2^2) = R1/r2(e^j(theta1-theta2) Abs(z): complex magnitude Angle(z): phase angle or argument of z Conj(z): complex conjugate z* Imag(z): complex imaginary part
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

engfinalnotes - Sec 1 Engineering Problem Solving...

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

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