* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download (2*(3+4))
Survey
Document related concepts
Tensor operator wikipedia , lookup
Oscillator representation wikipedia , lookup
Birkhoff's representation theorem wikipedia , lookup
Vector space wikipedia , lookup
Euclidean vector wikipedia , lookup
Covariance and contravariance of vectors wikipedia , lookup
Cartesian tensor wikipedia , lookup
Linear algebra wikipedia , lookup
Laplace–Runge–Lenz vector wikipedia , lookup
Cayley–Hamilton theorem wikipedia , lookup
Bra–ket notation wikipedia , lookup
Basis (linear algebra) wikipedia , lookup
Transcript
BIL108E Introduction to Scientific and Engineering Computing Lab 1 Exercise-1: Evaluate the following MATLAB expressions yourself . a. 2 / 2 * 3 b. 2 / 3 ˆ 2 c. (2 / 3) ˆ 2 d. 2 + 3 * 4 - 4 e. 2 ˆ 2 * 3 / 4 + 3 f. 2 ˆ (2 * 3) / (4 + 3) g. 2 * 3 + 4 h. 2 ˆ 3 ˆ 2 i. -4 ˆ 2 Exercise-2: Use MATLAB to evaluate the following expressions. a) b) c) d)Find the square of 2π e) 2π2 f)1/ g) h) Find the cube root of 2.3 and 4.5 Exercise-3: Try to avoid using unnecessary brackets in an expression. Can you spot the errors in the following expression (test your corrected version with MATLAB): (2*(3+4))/(5*(6+1))^2 Exercise-4: Set up a vector n, with elements 1, 2, 3, 4, 5. Use MATLAB array operations on the vector n to set up the following four vectors, each with five elements: X=linspace(1,5,5) X=[1:5] X=[1:1:5] a) 2, 4, 6, 8, 10 b) 1/2, 1, 3/2, 2, 5/2 c) 1, 1/2, 1/3, 1/4, 1/5 d) 1, 1/22, 1/32, 1/42, 1/52 BIL108E Introduction to Scientific and Engineering Computing Lab 1 Exercise-5 Suppose a and b are defined as follows: A = [2 -1 5 0]; B = [3 2 -1 4]; Evaluate by hand the vector C in the following statements. Check your answers with MATLAB. a) C=A-B b) C=A+B-3 c) C=2*A+A.^B d) C=B/A e) C=B\A f) C=A^B g) C = 2^B+A h) C = 2*B/3*A i) C = B*2*A Exercise-6 Let X=[2 5 1 6]; a) Add 16 to each element. b) Add 3 to just the odd-index element. c) Compute the square root of each element. d) Compute the square of each element. Exercise-7 Given a vector T, of length n, write down the Matlab expressions that will correctly compute the following. T=linspace(1:5:5) a) ln 2 t t 2 b) et 1 cos 3t c) cos2 t sin2 t d) cot(t) e) sec2 t cot t 1 Exercise-8 Water freezes at 32◦ and boils at 212◦ on the Fahrenheit scale. If C and F are Celsius and Fahrenheit temperatures, the formula F = 9C/5 + 32, converts from Celsius to Fahrenheit. Use the MATLAB command line to convert a temperature of 37◦C (normal human temperature) to Fahrenheit (98.6◦). Exercise-9 Engineers often have to convert from one unit of measurement to another; this can be tricky sometimes. You need to think through the process carefully. For example, convert 5 acres to hectares, given that an acre is 4840 square yards, a yard is 36 inches, an inch is 2.54 cm, and a hectare is 10000 m2. 1 acres=4840 yards2 1Yards=36 inches 1 inches= 2.54 cm BIL108E Introduction to Scientific and Engineering Computing Lab 1 Exercise-10: Define two variables; and . Using these variables, show that the following trigonometric identity is correct by calculating the value of the left and right sides of the equation. ( ) ( ) Exercise-11: Create the following three matrices; a) Calculate “A + B” and “B + A” to show that addition of matrices is commutative. b) Calculate “A + (B + C)” and “(A + B) + C” to show that addition of matrices is associative. c) Calculate “5(A + C)” and “5A + 5C” to show that, when matrices are multiplied by a scalar, the multiplication is distributive. d) Calculate “A*(B + C)” and “A*B + A*C” to show that multiplication is distributive. Exercise-12: For the function ( ) , calculate the value of y for the following values of x: -2.5, -2, -1.5, -1, -0,5, 0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0. Solve the problem by creating a vector. Exercise-13: Take the derivative of the function by using symbolic math; ( ) ( ) Exercise-14: Find the ( ) for following function by using symbolic math; ( ) ( Exercise-15: Find the roots of polynomial. ( ) )