This document discusses various ways to work with polynomials in MATLAB. It covers representing polynomials as vectors, evaluating polynomials, finding roots, computing coefficients from roots, adding, subtracting, multiplying, dividing, taking derivatives and integrals of polynomials, fitting curves to data using polynomial regression, and interpolating values between data points using polynomials.
It's the deck for one Hulu internal machine learning workshop, which introduces the background, theory and application of expectation propagation method.
Discrete Mathematics is a branch of mathematics involving discrete elements that uses algebra and arithmetic. It is increasingly being applied in the practical fields of mathematics and computer science. It is a very good tool for improving reasoning and problem-solving capabilities.
Esta presentación es un resumen del trabajo original. En caso de resultar interesante el contenido de este power, pueden contactarse para conocer de que se trata......
The impact of innovation on travel and tourism industries (World Travel Marke...Brian Solis
From the impact of Pokemon Go on Silicon Valley to artificial intelligence, futurist Brian Solis talks to Mathew Parsons of World Travel Market about the future of travel, tourism and hospitality.
It's the deck for one Hulu internal machine learning workshop, which introduces the background, theory and application of expectation propagation method.
Discrete Mathematics is a branch of mathematics involving discrete elements that uses algebra and arithmetic. It is increasingly being applied in the practical fields of mathematics and computer science. It is a very good tool for improving reasoning and problem-solving capabilities.
Esta presentación es un resumen del trabajo original. En caso de resultar interesante el contenido de este power, pueden contactarse para conocer de que se trata......
The impact of innovation on travel and tourism industries (World Travel Marke...Brian Solis
From the impact of Pokemon Go on Silicon Valley to artificial intelligence, futurist Brian Solis talks to Mathew Parsons of World Travel Market about the future of travel, tourism and hospitality.
The Six Highest Performing B2B Blog Post FormatsBarry Feldman
If your B2B blogging goals include earning social media shares and backlinks to boost your search rankings, this infographic lists the size best approaches.
Each technological age has been marked by a shift in how the industrial platform enables companies to rethink their business processes and create wealth. In the talk I argue that we are limiting our view of what this next industrial/digital age can offer because of how we read, measure and through that perceive the world (how we cherry pick data). Companies are locked in metrics and quantitative measures, data that can fit into a spreadsheet. And by that they see the digital transformation merely as an efficiency tool to the fossil fuel age. But we need to stretch further…
Polynomials are very important mathematical tool for Engineers. In this lecture we will discuss about how to deal with Polynomials in MATLAB and one of its application, Curve Fitting.
The name MATLAB stands for MATrix LABoratory.MATLAB is a high-performance language for technical computing.
It integrates computation, visualization, and programming environment. Furthermore, MATLAB is a modern programming language environment: it has sophisticated data structures, contains built-in editing and debugging tools, and supports object-oriented programming.
These factor make MATLAB an excellent tool for teaching and research.
Fortran is a general-purpose programming language, mainly intended for mathematical computations in
science applications
this chapter is the third chapter
* Evaluate a polynomial using the Remainder Theorem.
* Use the Factor Theorem to solve a polynomial equation.
* Use the Rational Zero Theorem to find rational zeros.
* Find zeros of a polynomial function.
* Use the Linear Factorization Theorem to find polynomials with given zeros.
* Use Descartes’ Rule of Signs.
Mathematics (from Greek μάθημα máthēma, “knowledge, study, learning”) is the study of topics such as quantity (numbers), structure, space, and change. There is a range of views among mathematicians and philosophers as to the exact scope and definition of mathematics
This powerpoint presentation gives information regarding functions. Designed or grade 11 studens studying general mathematics 11. You can use this presentation to present your lessons in grade 11 general mathematics or even use this on your lesson in grade 10 mathematics about polynomial functions
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...ssuser7dcef0
Power plants release a large amount of water vapor into the
atmosphere through the stack. The flue gas can be a potential
source for obtaining much needed cooling water for a power
plant. If a power plant could recover and reuse a portion of this
moisture, it could reduce its total cooling water intake
requirement. One of the most practical way to recover water
from flue gas is to use a condensing heat exchanger. The power
plant could also recover latent heat due to condensation as well
as sensible heat due to lowering the flue gas exit temperature.
Additionally, harmful acids released from the stack can be
reduced in a condensing heat exchanger by acid condensation. reduced in a condensing heat exchanger by acid condensation.
Condensation of vapors in flue gas is a complicated
phenomenon since heat and mass transfer of water vapor and
various acids simultaneously occur in the presence of noncondensable
gases such as nitrogen and oxygen. Design of a
condenser depends on the knowledge and understanding of the
heat and mass transfer processes. A computer program for
numerical simulations of water (H2O) and sulfuric acid (H2SO4)
condensation in a flue gas condensing heat exchanger was
developed using MATLAB. Governing equations based on
mass and energy balances for the system were derived to
predict variables such as flue gas exit temperature, cooling
water outlet temperature, mole fraction and condensation rates
of water and sulfuric acid vapors. The equations were solved
using an iterative solution technique with calculations of heat
and mass transfer coefficients and physical properties.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
HEAP SORT ILLUSTRATED WITH HEAPIFY, BUILD HEAP FOR DYNAMIC ARRAYS.
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the minimum element and place the minimum element at the beginning. Repeat the same process for the remaining elements.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
Fundamentals of Electric Drives and its applications.pptx
Advanced matlab codigos matematicos
1. 1
Polynomials in Matlab
Polynomials
• f(x) = anxn
+ an-1xn-1
+ ... + a1x + a0
• n is the degree of the polynomial
• Examples:
f(x) = 2x2
- 4x + 10 degree 2
f(x) = 6 degree 0
Polynomials in
Matlab
• Represented by a row vector in which the
elements are the coefficients.
• Must include all coefficients, even if 0
• Examples
8x + 5 p = [8 5]
6x2
- 150 h = [6 0 -150]
2. 2
Value of a
Polynomial
• Recall that we can compute the value of a
polynomial for any value of x directly.
• Ex: f(x) = 5x3
+ 6x2
- 7x + 3
x = 2;
y = (5 * x ^ 3) + (6 * x ^ 2) - (7 * x) + 3
y =
53
Value of a
Polynomial
• Matlab can also compute the value of a
polynomial at point x using a function,
which is sometimes more convenient
• polyval (p, x)
– p is a vector with the coefficients of the
polynomial
– x is a number, variable or expression
Value of a
polynomial
• Ex: f(x) = 5x3
+ 6x2
- 7x + 3
p = [5 6 -7 3];
x = 2;
y = polyval(p, x)
y =
53
3. 3
Roots of a
Polynomial
• Recall that the roots of a polynomial are
the values of the argument for which the
polynomial is equal to zero
• Ex: f(x) = x2
- 2x -3
0 = x2
- 2x -3
0 = (x + 1)(x - 3)
0 = x + 1 OR 0 = x - 3
x = -1 x = 3
Roots of a
Polynomial
• Matlab can compute the roots of a function
• r = roots(p)
– p is a row vector with the coefficients of the
polynomial
– r is a column vector with the roots of the
polynomial
Roots of a
Polynomial
• Ex: f(x) = x2
- 2x -3
p = [1 -2 -3];
r = roots(p)
r =
3.0000
-1.0000
4. 4
Polynomial
Coefficients
• Given the roots of a polynomial, the
polynomial itself can be calculated
• Ex: roots = -3, +2
x = -3 OR x = 2
0 = x + 3 0 = x - 2
0 = (x + 3)(x - 2)
f(x) = x2
+ x - 6
Polynomial
Coefficients
• Given the roots of a polynomial, Matlab
can compute the coefficients
• p = poly(r)
– r is a row or column vector with the roots of
the polynomial
– p is a row vector with the coefficients
Polynomial
Coefficients
• Ex: roots = -3, +2
r = [-3 +2];
p = poly(r)
p =
1 1 -6
% f(x) = x2
+ x -6
5. 5
Adding and Subtracting
Polynomials
• Polynomials can be added or subtracted
• Ex: f1(x) + f2(x)
f1(x) = 3x6
+ 15x5
- 10x3
- 3x2
+15x - 40
f2(x) = 3x3
- 2x - 6
3x6
+ 15x5
- 7x3
-3x2
+13x - 46
Adding and Subtracting
Polynomials
• Can do this in Matlab by just adding or
subtracting the coefficient vectors
– Both vectors must be of the same size, so the
shorter vector must be padded with zeros
Adding and Subtracting
Polynomials
Ex:
f1(x) = 3x6 + 15x5 - 10x3 - 3x2 +15x - 40
f2(x) = 3x3 - 2x - 6
p1 = [3 15 0 -10 -3 15 -40];
p2 = [0 0 0 3 0 -2 -6];
p = p1+p2
p =
3 15 0 -7 -3 13 -46
%f(x) = 3x6 + 15x5 -7x3 -3x2 +13x -46
6. 6
Multiplying Polynomials
• Polynomials can be multiplied:
• Ex: (2x2
+ x -3) * (x + 1) =
2x3
+ x2
- 3x
+ 2x2
+ x -3
2x3
+3x2
-2x -3
Multiplying Polynomials
• Matlab can also multiply polynomials
• c = conv(a, b)
– a and b are the vectors of the coefficients of
the functions being multiplied
– c is the vector of the coefficients of the
product
Multiplying Polynomials
• Ex: (2x2
+ x -3) * (x + 1)
a = [2 1 -3];
b = [1 1];
c = conv(a, b)
c =
2 3 -2 -3
% 2x3
+ 3x2
-2x -3
7. 7
Dividing Polynomials
• Recall that polynomials can also be
divided
x -10
x + 1 x2
- 9x - 10
-x2
- x
-10x -10
-10x -10
0
Dividing Polynomials
• Matlab can also divide polynomials
• [q,r] = deconv(u, v)
– u is the coefficient vector of the numerator
– v is the coefficient vector of the denominator
– q is the coefficient vector of the quotient
– r is the coefficient vector of the remainder
Dividing Polynomials
• Ex: (x2
- 9x -10) ÷ (x + 1)
u = [1 -9 -10];
v = [1 1];
[q, r] = deconv(u, v)
q =
1 -10 % quotient is (x - 10)
r =
0 0 0 % remainder is 0
8. 8
Example 1
• Write a program to calculate when an object
thrown straight up will hit the ground. The
equation is
s(t) = -½gt2 +v0t + h0
s is the position at time t (a position of zero
means that the object has hit the ground)
g is the acceleration of gravity: 9.8m/s2
v0 is the initial velocity in m/s
h0is the initial height in meters (ground level is 0,
a positive height means that the object was
thrown from a raised platform)
Example 1
Prompt for and read in initial velocity
Prompt for and read in initial height
Find the roots of the equation
Solution is the positive root
Display solution
Example 1
v = input('Please enter initial velocity: ');
h = input('Please enter initial height: ');
x = [-4.9 v h];
y = roots(x);
if y(1) >= 0
fprintf('The object will hit the ground in %.2f secondsn',
y(1))
else
fprintf('The object will hit the ground in %.2f secondsn',
y(2))
end
9. 9
Example 1
Please enter initial velocity: 19.6
Please enter initial height: 58.8
The object will hit the ground in 6.00
seconds
Derivatives of
Polynomials
• We can take the derivative of polynomials
f(x) = 3x2
-2x + 4
dy = 6x - 2
dx
Derivatives of
Polynomials
• Matlab can also calculate the derivatives
of polynomials
• k = polyder(p)
p is the coefficient vector of the polynomial
k is the coefficient vector of the derivative
10. 10
Derivatives of
Polynomials
• Ex: f(x) = 3x2
- 2x + 4
p = [3 -2 4];
k = polyder(p)
k =
6 -2
% dy/dx = 6x - 2
Integrals of Polynomials
• ?6x2
dx = 6 ?x2
dx
= 6 * ? x3
= 2 x3
Integrals of
Polynomials
• Matlab can also calculate the integral of a
polynomial
g = polyint(h, k)
h is the coefficient vector of the polynomial
g is the coefficient vector of the integral
k is the constant of integration - assumed
to be 0 if not present
11. 11
Integration of
Polynomials
• ?6x2
dx
h = [6 0 0];
g = polyint(h)
g =
2 0 0 0
% g(x) = 2x3
Polynomial Curve Fitting
• Curve fitting is fitting a function to a set of
data points
• That function can then be used for various
mathematical analyses
• Curve fitting can be tricky, as there are
many possible functions and coefficients
Curve Fitting
• Polynomial curve fitting uses the method
of least squares
– Determine the difference between each data
point and the point on the curve being fitted,
called the residual
– Minimize the sum of the squares of all of the
residuals to determine the best fit
12. 12
Curve Fitting
• A best-fit curve may not pass through any
actual data points
• A high-order polynomial may pass through
all the points, but the line may deviate
from the trend of the data
13. 13
Matlab Curve Fitting
• Matlab provides an excellent polynomial
curve fitting interface
• First, plot the data that you want to fit
t = [0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0];
w = [6.00 4.83 3.70 3.15 2.41 1.83 1.49 1.21 0.96 0.73
0.64];
plot(t, w)
• Choose Tools/Basic Fitting from the menu
on the top of the plot
14. 14
Matlab Curve Fitting
• Choose a fit
– it will be displayed on the plot
– the numerical results will show the equation
and the coefficients
– the norm of residuals is a measure of the
quality of the fit. A smaller residual is a better
fit.
• Repeat until you find the curve with the
best fit
Linear Fit
Linear Fit
15. 15
8th Degree Polynomial
8th Degree Polynomial
Example 2
• Find the parabola that best fits the data
points (-1, 10) (0, 6) (1, 2) (2, 1) (3, 0)
(4, 2) (5, 4) and (6, 7)
• The equation for a parabola is
f(x) = ax2
+ bx + a
17. 17
Other curves
• All previous examples use polynomial
curves. However, the best fit curve may
also be power, exponential, logarithmic or
reciprocal
• See your textbook for information on fitting
data to these types of curves
Interpolation
• Interpolation is estimating values between
data points
• Simplest way is to assume a line between
each pair of points
• Can also assume a quadratic or cubic
polynomial curve connects each pair of
points
Interpolation
• yi = interp1(x, y, xi, 'method')
interp1 - last character is one
x is vector with x points
y is a vector with y points
xi is the x coordinate of the point to be
interpolated
yi is the y coordinate of the point being
interpolated
18. 18
Interpolation
• method is optional:
'nearest' - returns y value of the data point that
is nearest to the interpolated x point
'linear' - assume linear curve between each two
points (default)
'spline' - assumes a cubic curve between each
two points
Interpolation
• Example:
x = [0 1 2 3 4 5];
y = [1.0 -0.6 -1.4 3.2 -0.7 -6.4];
yi = interp1(x, y, 1.5, 'linear')
yi =
-1
yj = interp1(x, y, 1.5, 'spline')
yj =
-1.7817