Matlab Group Project
Matlab Group Project
Table of Contents
Introduction: ................................................................................................................................................. 3
What is MATLAB?...................................................................................................................................... 3
About the program: .................................................................................................................................. 3
Objective of the project: ............................................................................................................................... 4
Project work Distribution: ......................................................................................................................... 4
Report work Distribution: ......................................................................................................................... 4
Literature Review: ......................................................................................................................................... 5
Background Information on the method: ................................................................................................. 5
Methodology:................................................................................................................................................ 6
Steps to solve: ........................................................................................................................................... 6
Coding: .......................................................................................................................................................... 7
Conclusion: .................................................................................................................................................. 10
References .................................................................................................................................................. 11
2
30th May 2018 Intro to Programming Mr.Imran
Introduction:
What is MATLAB?
MATLAB® is a software program used to analyze and design the systems and products
transforming our world. MATLAB is in automobile active safety systems, interplanetary
spacecraft, health monitoring devices, smart power grids, and LTE cellular networks. It is used for
machine learning, signal processing, image processing, computer vision, communications,
computational finance, control design, robotics, and much more. The MATLAB platform is
optimized for solving engineering and scientific problems. The matrix-based MATLAB language
is the world’s most natural way to express computational mathematics. Built-in graphics make it
easy to visualize and gain insights from data. A vast library of prebuilt toolboxes lets the user get
started right away with algorithms essential to their domain. The desktop environment invites
experimentation, exploration, and discovery. These MATLAB tools and capabilities are all
rigorously tested and designed to work together. MATLAB helps take ideas beyond the desktop.
The analyses can be run on larger data sets and scale up to clusters and clouds. MATLAB code
can be integrated with other languages which enable users to deploy algorithms and applications
within web, enterprise, and production systems (MATLAB, n.d.).
As the name suggests, The Force Resultant Calculation Program is a program that can find the
maximum number of resultant forces of both 2D and 3D objects and is also capable of plotting a
graph in relation to the values acquired. The resultant forces of these objects are found using the
forces adjacent angle or using the method of position vectors, in the most efficient way.Due to the
formulas and functions being pre-included into the program, all the user has to do is input the
values in their acquainted positions and an accurate output would be acquired.This program is
extremely effective and efficient especially for those who require an accurate answer in the fastest
way possible, where the hand solution working is not an issue or just for re-checking answers.
example: Students, to re-check their answers or If teachers don’t have a pre-solution to a test, this
program could be used to check the final answer without any waste of time.
3
30th May 2018 Intro to Programming Mr.Imran
Tasneem: Proving the attempts are all equivalent through the use of plotting.
Christian: Coding
Hussam: Methodology
Tasneem: Conclusion
4
30th May 2018 Intro to Programming Mr.Imran
Literature Review:
Background Information on the method:
The relationships between a particle’s position, s, velocity, v, and acceleration, a, over time
are all related. When the relationship between a particle’s velocity and time is described by a
mathematical equation, that equation can be integrated to obtain the particle’s position and
differentiated to determine the particle’s acceleration. Equations are great for describing idealized
situations, but they don't always cut it. Sometimes you need a picture to show what's going on —
a mathematical picture called a graph. Graphs are often the best way to convey descriptions of real
word events in a compact form.
An example of fitting a polynomial to velocity data can clearly show us the importance
and the relation of plotting and having graphs in an equation. A data recorder connected to the
speedometer is helpful when plotting a driver’s road trip while he accelerates and decelerates
throughout the time span of the whole journey. Having a linear graph or even a curve graph will
ease the readability of the numbers. As having someone read numbers out of the two columns or
two rows won’t necessarily mean that the person understands what those numbers are saying and
what do they mean, while having that same person look at a well-plotted graph and realize when
the car is accelerating, decelerating or at rest in a much quicker and simple way. MATLAB helps
us plot those graphs using codes. The graphs can vary from being a smooth linear curve all the
way to be a correlation graph ion certain things and certain situations. Graphs can show the
increasing velocity, the time rested, the decreasing acceleration and even the distance of the
journey of a specific object or device. Curve-fitting is the name of having codes on MATLAB to
draw graphs or to illustrate certain things. This whole process goes under the name curve-fitting
and relating s-t, v-t and a-t graphs. Writing equations in the format of codes using special wording
and special characters on MATLAB will then output a well-plotted graph that can be used in
researches.
5
30th May 2018 Intro to Programming Mr.Imran
Methodology:
Steps to solve:
A driver on a straight track accelerates his car from 0 to 75 mph in 14 seconds, and then allows
the car to begin to slow. A data recorder connected to the speedometer recorded the data shown
below. Since the car is moving along a straight path, the car’s speed and velocity are equal
(Anon., n.d.).
6
30th May 2018 Intro to Programming Mr.Imran
Coding:
%FIRST ATTEMPT
%Time and Velocity vectors, plotting the v-t graph
t=0:20;
v=[0 1 4 8 14 21 28 35 43 51 58 64 69 73 75 75 73 68 60 49 35]
plot(t,v,'o');
xlabel('{\bf t(sec)}');
ylabel('{\bf v(mph)}');
Figure 2: T vs S graph
7
30th May 2018 Intro to Programming Mr.Imran
%SECOND ATTEMPT
%Inline function with third order polynomial
F=inline('b(1).*t.^3 + b(2).*t.^2+ b(3).*t','b','t');
%Best-line of fit
b=nlinfit(t,v,F,[0 0 0]);
%Predicted velocity calculations to assess if the regression equation fits
%the data provided.
v_p=b(1).*t.^3 + b(2).*t.^2+ b(3).*t;
subplot(1,2,2);
plot(t,v,'o',t,v_p);
xlabel('{\bf t(sec)}');
ylabel('{\bf v(mph)}');
legend('v','v_p',2);
8
30th May 2018 Intro to Programming Mr.Imran
subplot(1,2,2);
plot(t,s,'o');
xlabel('{\bf t)}');
ylabel('{\bf s}');
9
30th May 2018 Intro to Programming Mr.Imran
Conclusion:
Various variables where set to run using the proprietary algorithm and the results were displayed
using graphical representation. As time went on the solution became clearer as more data was
being gathered through rigorous testing. Improvements and slight adjustments were added to
perfect the code and allow for more accurate and truthful data. One of the main problems faced
was the “nlinfit” function was no included in our current version of MATLAB because the
“Statistics and Machine Learning Toolbox” was missing. One of the many modifications we
implemented was figuring out a method to increase the number of variables that were being input
to be able to draw a proper thesis and conclude a definitive answer. Overall MATLAB is very
essential in helping various occupations compile and configure information to be able to reach a
simple and effective solution.
10
30th May 2018 Intro to Programming Mr.Imran
References
Anon., n.d. Using MATLAB for Statics and Dynamics. [Online]
Available at: http://www.secs.oakland.edu/~latcha/EGR280/StatDynMatlab.pdf
11