Nothing Special   »   [go: up one dir, main page]

Kedy Jan Cuanan Cengr 3140 LR1 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Republic of the Philippines

CENTRAL LUZON STATE UNIVERSITY


College of Engineering

DEPARTMENT OF CIVIL ENGINEERING

CENGR 3140 LAB


(Numerical Solutions to CE Problem)

Full Name: KEDY JAN L CUANAN ID Number: 19-0950

Laboratory Work No. 1


GNU OCTAVE FUNDAMENTALS

OBJECTIVE:
a. Learning how vectors and matrices are assigned values using simple
assignment, the colon operator, and the linspace functions.
b. Gaining a general understanding of built-in functions of GNU Octave.
c. Learning how to use vectors to create a simple line plot based on an equation.

EQUIPMENT:
a. Personal computer

PROCEDURES:
The velocity of a free-falling bungee jumper can be computed with the equation:
v=√ ❑ [Eq. 1]

where g is the acceleration due to gravity (9.81 m/s2), m is mass (kg), c d is the drag
coefficient (kg/m), and t is time (s).
Data for the mass and associated terminal velocities of a number of jumpers is given
below.

m,kg 83.6 60.2 72.1 91.1 92.9 65.3 80.9

vt, m/s 53.4 48.5 50.9 55.7 54 47.7 51.1

Drag coefficient can be computed using the equation involving the terminal velocity.
mg
cd= 2 [Eq. 2]
vt
a. Assign value to the acceleration due to gravity g.
b. Using Eq. 2, compute for the mean drag coefficient in GNU Octave.
c d =¿ ¿

c. Create a column vector t that contains values from 0 to 20 in steps of 2.


d. Check the number of items in the t array with the length function.
e. Assign the last two digits of your ID number as the mass in kilograms to
variable m. If 00, assume the value of 50.
f. Evaluate Eq. 1 assigning it as column vector v .
g. Plot the t and v arrays using the plot function [>>plot(t,v)].
h. Customize the graph a bit to have the following features:
● Set the type of point symbols, line type and color to your liking
[>>plot(t,v, ‘▢▢▢’)]
● Title: Plot of v versus t [>>title(‘Plot of v versus t’)]
● Horizontal axis: Values of t [>>xlabel(‘Values of t’)]
● Vertical axis: Values of v [>>ylabel(‘Values of v’]
● Grid lines visible [>>grid]

i. Based on the results of v and the graph, estimate your terminal velocity to the
nearest tenths.
v t =¿ ¿

RESULTS:
(attach images of the GNU Octave command window, workspace, and/or graph
showing the inputs and the results of the above procedures)
GUIDE QUESTIONS:

1. In your opinion, what is the most useful function of GNU Octave and why?
The most useful function of this program is its capability to modify, arrange, and
convert, just like a modern calculator it provides the answers straight away. Though
it's better to understand what happens with each command prompted, this program
eases those tedious steps, from simple transforming arrays straight to plotting.

2. What problems did you encounter in performing the laboratory exercise?


Without prior knowledge of the program, it'll be hard to understand or start
with what you want to do with the program, though the program doesn't have that
steep learning curve, learning symbols and commands is still a better way to start.

3. What could be done to improve the accuracy of the graph and the
determination of terminal velocity?
Having a pin system or symbol that shows every coordinate and their details
of coordination, will allow an easier way of comparing each or every coordinate to
one another.

4. For you, what is the most crucial part of using GNU Octave as a tool in
performing mathematical calculations?
Understanding how the formula or the actions are being performed, like not
just knowing the answer of 1+1, one must know why the answer of 1+1 is this or that.

CONCLUSION:
Octave is a fun way of calculating problems. It provides many tools that help
people make their way to obtaining the results they are looking for. This is just like
programming, where an action always has a value and is always considered in the
following commands if it is part of the next equation to tackle. Unlike our traditional
calculator, this provides a wider range of functions, being able to use variables, give
values to words, etc. with the proper understanding of the program and mastery of
commands, this will be a good weapon to tackle problems.
PRACTICE PROBLEMS:

1. Use the linspace function to create vectors identical to the following created
with colon notation:
a. t = 4:6:61
b. x = -4:4
2. The following matrix is entered in Octave:
>>A=[1 2 5;0:0.5:1;linspace(6,8,3)]
a. Write out the resulting matrix.
b. Write a single-line command to multiply the second row by the third
column and assign the result to the variable c. Hint: To pertain to a single
row or column in a matrix, input the matrix name followed by (▢,▢). Input the row
number if pertaining to a row then a colon [e.g. A(1,:) to pertain to the first row of
matrix A] and input the column number if pertaining to a column then a colon [e.g.
A(:,1) to pertain to the first column of matrix A].

3. If a force F (N) is applied to compress a spring, its displacement x (m) can


often be modeled by Hooke’s Law:
F=kx
where k = the spring constant (N/m). The potential energy stored in the spring
U (J) can then be computed as
1 2
U= kx
2
Five springs are tested and the following data compiled:

F (N) 14 18 8 9 13

x (m) 0.013 0.020 0.009 0.010 0.012

Use Octave to store F and x as vectors and then compute vectors of the
spring constants and the potential energies. Use the max function to
determine the maximum potential energy.

4. It is general practice in engineering and science that equations be plotted as


lines and discrete data as symbols. Here are some data for concentration ( c )
versus time (t ) for the photodegradation of aqueous bromine:

t (min) 10 20 30 40 50 60

c (ppm) 3.4 2.6 1.6 1.3 1.0 0.5

These data can be described by the following function:


−0.034 t
c=4.84 e
Use Octave to create a plot displaying both the data (using diamond-shaped
symbols) and the function (using a green, dashed line). Plot the function for t
= 0 to 70 min at five minute intervals.

You might also like