Software Tools 1778

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

INTERNATIONAL ISLAMIC UNIVERSITY, SLAMABAD

FACULTY OF BASIC AND APPLIED SCIENCE


DEPARTMENT OF MATHEMATICS AND STATISTICS
MIDTERM EXAMINATION SPRING 2020
CLASS: MSC F-18 SUBJECT: SOFTWARE TOOL
COURSE CODE: CS – 002 MAXIMUM TIME ALLOWED: 2.00 HOURS

STUDENT NAME: MUHAMMAD SHEHBAz


REG. NO: 1778-FBAS/MSCMA/F18

SHORT QUESTION

QUESTION # 1:

a What is the function of these command?  5  2  10 

i  format bank.  ii  format short eng.

 iii  format rat.  iv  format long g


.SOLUTION:

b  The vector G = [68, 83, 61, 70, 75, 82, 57, 5, 76, 85, 62, 71, 96, 78, 76, 68, 72, 75, 83,

93] represents the distribution of final grades in a dynamics course. Compute the mean,
median, mode, and standard deviation of G. Write down MATLAB code only.

SOLUTION:

c Write down the syntax of the following question.

Create a vector x from -2 to +2 with an increment of 1.

i  Find the absolute value of each member of the vector.

 ii  Find the square root of each member of the vector.

SOLUTION:

d  Discuss on the below graph.


SOLUTION:

d  Plot using subplot also label the plot.

y1  e 1.2 x sin 10 x  5  for 0  x  5

y2  x 3  100 for  6  x  6
SOLUTION:

LONG QUESTION

 n2a 
The ideal gas law equation is PV=nRT and van der Waals’ equation is  P+ 2  V  nb  = nRT
 V 

Use both the ideal gas law and van der Waals’ equation to calculate the temperature of water

vapor (steam), given the following data. Pressure (P) is 220 bars, Moles (n) is 2 mol, Volume (V)

is 1 L, (a) is 5.536 L2bar/ mol2, (b) is 0.03049 L/mol and Ideal gas constant R is 0.08314472
L bar/K mol. 6

SOLUTION:

QUESTION # 2:

1 a The displacement of the oscillating spring shown in Figure can be described by

x  A cos t 

Where x  displacement at time t, A  maximum displacement.

v  angular frequency, which depends on the spring constant and the

mass attached to the spring. t  time. Find the displacement x for

times from 0 to 10 seconds when the maximum displacement A is

4 cm, and the angular frequency is 0.6 radian/ second. Present

your results in a table of displacement and time values.  4

SOLUTION:
b  The acceleration of the spring described in the preceding exercise is  4
a   A 2 cos t 

Find the acceleration for times from 0 to 10 seconds, using the constant values from part  a  .

Create a table that includes the time and the acceleration.

SOLUTION:
 2 Create a 6  6 magic matrix.  8
a. What is the sum of each of the rows?
b. What is the sum of each of the columns?
c. What is the sum of each of the diagonals?

SOLUTION:

 3 Create a vector x of values from 0 to 20 , with a spacing .  8
100

Define vector v and z as

y  x sin  x 

z  x cos  x 

a Create an x-y plot of x and y.

b  Create a polar plot of x and y.

c Create a three-dimensional line plot of x, y and z. Don’t forget a title and labels.

SOLUTION:

You might also like