Professional Documents
Culture Documents
Octave Lab
Octave Lab
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:
where 𝑔 is the acceleration due to gravity (9.81 m/s2), 𝑚 is mass (kg), 𝑐 is the drag
Data for the mass and associated terminal velocities of a number of jumpers is given
below.
Drag coefficient can be computed using the equation involving the terminal velocity.
b. Using Eq. 2, compute for the mean drag coefficient in GNU Octave.
𝑐 = ____________________
d. Check the number of items in the 𝑡 array with the 𝑙𝑒𝑛𝑔𝑡ℎ function.
e. Assign the last two digits of your ID number as the mass in kilograms to
● Set the type of point symbols, line type and color to your liking
[>>plot(t,v, ‘▢▢▢’)]
i. Based on the results of 𝑣 and the graph, estimate your terminal velocity to the
nearest tenths.
𝑣 = ____________________
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 capacity of this application to change, arrange, and convert is its most helpful feature; like a
computer calculator, it immediately displays the results. This application simplifies those time-
consuming stages, from straightforward array transformation to plain forward charting, even if it's
preferable to understand what happens with each command presented.
Even if the software doesn't have a particularly high learning curve, studying the symbols and
instructions is still a preferable place to start if you don't already have a thorough understanding of
what you want to accomplish with it.
3. What could be done to improve the accuracy of the graph and the determination of terminal
velocity?
It will be simpler to compare each coordinate to one another if there is a pin system or
symbol that displays all of the coordinates and their specifics of coordination.
4. For you, what is the most crucial part of using GNU Octave as a tool in
Understanding how the formula or the activities are being executed, not by just solving it, but by
learning how you solve it.
CONCLUSION:
It's entertaining to solve issues with Octave. It offers a variety of tools to aid people in navigating
their way to the desired outcomes. This is exactly like programming, where each action has a purpose
and is always considered when issuing subsequent orders if it is a component of the next equation to
solve. With adequate program comprehension and command mastery, this calculator can perform a
larger variety of operations than our typical calculator, including the usage of variables and the ability to
assign values to words.
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.
Use Octave to store 𝐹 and 𝑥 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 (𝑐)versus time (𝑡) for the photo
degradation of aqueous bromine:
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.