Sunteți pe pagina 1din 47

Chapter 1 MATHEMATICAL MODELING

MAT 530

CHAPTER ONE

Mathematical
Modeling Process
At the end of this module, students should be able:

To define mathematical modeling

To explain what is a mathematical model

To describe various classification of mathematical models

To outline procedures involved in constructing a mathematical model

To solve a simple modeling problem

To apply the method of least squares

1.1 Introduction
Consider the problems of finding the shortest route from one location to a
destination in a busy city or deciding locations for bus stops in an urban
area so that greater number of passengers can be achieved. These are
some examples of complex real-world problems. In order to obtain the
required solution this person need to investigate necessary questions
about the observed world and give a simplified description of the
problem. He/she can setup equations using mathematical concepts and
language to test some ideas and then solved the model to make
prediction or decision.

The developed process mentioned above is

known as mathematical modeling.

Definition 1.1
Mathematical

modeling

is

the

process

of

constructing

mathematical objects as a quantitative method to represent the


properties or behaviors of the real-world system, process or
phenomena.

Mathematical object refers to sets of numbers,

variables or parameters and their symbols and functional


relationships in the form of equation or system of equations and
geometrical or algebraic structure.

Chapter 1 MATHEMATICAL MODELING

MAT 530

Mathematical modeling cultivates the interaction between mathematics


and the real world by translating the real world problem into mathematical
formulation or model, solving the model and interpreting the solutions
obtained using the model so as to make the model useful to the real
world.

The real world problem covers situations which may come from

diverse disciplines such as engineering, science, architecture, business,


sports science and computer science while the system can be a physical
system, a biological system, a financial system, a social system or an
ecological system.

Mathematical modeling allows a modeler to

undertake experiments on mathematical representations of the real world


instead of undertaking experiments in the real world.

Mathematical

models can take many forms such as dynamical systems, statistical


models, differential equations, or game theoretic models. Mathematical
modeling can be viewed as a process, as illustrated in the schematic
diagram of Figure 1.1.

START

Real-World
Problem

Data Collection and Analysis


Making Assumptions
Construct Model

Translate
(Formulate)

Mathematical
Model

FINISH
Validation
and
Verification

Solve /
Analyze

Test /
Analyze

Real-World
Conclusion
or Prediction

Translate
(Interpret)
Simulation
What-If Analysis

Given {some factors},


find {outputs},
such that {objective is
achieved}.

Mathematical
Solutions

Figure 1.1: Process of Mathematical Modeling

Figure 1.1 shows mathematical modeling as an iterative process or a


cycle (or loop) which starts and finishes with the real world problem. It
may start with the the upper left-handcorner, the real world problem. This
represents quantitative measurement or data of system of interest and
knowledge of how the system works such that properties, behaviors and

Chapter 1 MATHEMATICAL MODELING

MAT 530

relationship between factors (variables and parameters) could be


observed and problem pertaining to the system that needs to be modeled
identified. A mathematical models is characterized by assumptions about
variables (the things which change), parameters (the things which do not
change) and functional forms (the relationship between the two). Thus,
based on data and knowledge of the system gathered, a mathematical
model can be constructed.
Construction of a model requires: 1) a clear objective of the modeling
which aspect of the system is involved, what do you wish the model to
produce and how accurate you want the model be; and 2) a precise idea
of the main factors involved and therefore, it may include taking a
simplified view of the system and considering the simplest practical
approach by neglecting certain factors and making assumptions.

Real-

world problem could be simplified or transformed to a problem relatively


close to the original problem but all essential features of the problem
must be retained.

Mathematical modeling may encompass the following goals:


a) integrating various existing good models of various parts of the
system to represent the whole system of interest;
b) generalizing existing models of different systems through adoption,
adaptation or modification of these models to be applied to the
system of interest; and
c) simplifying or making approximation to general model since the
current models are difficult to compute or analyzed.

After a mathematical model is established, computational experiments or


computations are required to solve the model which is to generate results
or solutions. Based on the model developed, optimum or approximate
solutions maybe obtained. As the model is aimed to represent the real
system, results or solutions found based on the model should be able to
be interpreted as descriptive properties or behaviors concerning the
system, thus, enabling prediction or conclusion to be made about the real
system.

The solutions, however, must first be tested (validated and

verified) against real data to determine the effectiveness of the model (to

Chapter 1 MATHEMATICAL MODELING

MAT 530

test assumptions and for sensitivity analysis). If the solutions agree with
the real system (i.e., makes sense), then the model does indeed capture
correctly important aspects of the real-world situation and thus can be
accepted and used.

In the case where the solutions found do not

substantiate the real-world phenomena, the modeling cycle is followed


through again with a revised formulation of model, new calculated results,
improved predictions, and so on. It is useful to note that the modeling
process may not necessarily results in solving the problem entirely but it
will furnish useful information regarding the situation under investigation.
The whole process of mathematical modeling can be divided into three
main activities: i) construct the model, ii) compute and analyze results,
and iii) test (validate and verify) results, as depicted in Figure 1.2 below.

Construct
the Model

Compute and
Analyze
Results

Test the
Results
Apply the
Model
Figure 1.2: Mathematical Modeling Process

Definition 1.2
A mathematical model is a system (S) containing a set of
questions (Q) relating to the system and a set of mathematical
statements (M) which can be used to answer the questions
(Velten, 2009).

A system refers to a set of interacting, interrelated, or interdependent


elements (or components) which are functionally related. When modeling,
very specific sets of questions must be addressed in order to transform

Chapter 1 MATHEMATICAL MODELING

MAT 530

data concerning the system into some mathematical statements.

These

questions, which transpire the purpose of the model, are very focused and
challenging questions and can only be answered with a conclusion based
on the analysis and interpretation of evidence.

In other words, the

questions invoke logical statement that progresses from what is known or


believed to be true to that which is unknown and requires validation.
Mathematical statements refer to relationships of numbers, variables and
parameters formulated using notations, symbols and operators.

These

statements are used to solve the problem and provide meaningful


information useful for making conclusion, decision or prediction regarding
the system.

1.2 Definition of a model


A model is a representation of reality containing the essential structure of
some object or event in the real world. It can be a physical, symbolic
(mathematical), graphical, verbal or simplified version of a real world
system or phenomenon. Since most systems and phenomenon are very
complicated (due to their large number of components) and complex
(very highly interconnected) to be understood entirely, a model may
contain only those features that are of primary importance to the
modelers purpose.

Thus, a model is usually a tradeoff between

generality, realism and precision. Models, therefore, may be necessarily


incomplete and may be changed or manipulated with relative ease. Due
to these, there is no model can be considered as the best model, only
better model.

Models can be categorized into three classes on the basis of their degree
of abstraction, as the following:
a)

Physical (Iconic) model: An iconic, 'look-alike' model, which is the


least abstract.

Examples include a model of an airplane or an

architects model of a building.


b)

Analogous model: A more abstract type of model in which the


model behaves like a real system but only having some resemblance

Chapter 1 MATHEMATICAL MODELING

MAT 530

to what it represents. Chart (including flowchart), graph, map and


network diagram are considered as analogous models.

c)

Symbolic or mathematical model: It is the most-abstract model


with no resemblance but only an approximation to what it represents.
The relationships between variables of the system are expressed
using a set of rules or operators according to their meaning (syntax)
rather that what they represent (semantic). Examples of these
models include mathematical equations or formula, financial
statement and set of accounts.
Definition 1.3
A model is called dynamic if at least one of its system parameters or
state variables depends on time.
Definition 1.4
A model is called static if the system parameters or state variables
do not change with respect to time.

A model can be a static or dynamic model. Figure 1.2, 1.3 and 1.4
illustrates some examples of the physical, analogous and symbolic model
in both static and dynamic forms.

a) A Static Physical Model


- A miniature replicate of a submarine

b) A Dynamic Physical Model


- Aerodynamics of a car in a wind tunnel

Figure 1.2: Physical Model

Chapter 1 MATHEMATICAL MODELING

a) An Static Analogous Model


- A model of an airport city

MAT 530

c) A Dynamic Analogous Model


- A Traffic Anomalous Events Model

Figure 1.3: Analogous Model

a) A Static Symbolic Model


- A geometry model for right
triangles

b) A Dynamic Symbolic Model


- Population Growth Models

Figure 1.4: Symbolic Model

1.3 Why Model?


To gain understanding.
A model represents characteristics and behaviors of a real-world system
concerned, thus, providing an improved understanding. It facilitates
understanding by focusing and analyzing necessary components of the
system. Through modeling we can comprehend how different parts of
the system are related and which factors are most important in the
system.

To predict or simulate. Very often we wish to know what a real-world


system will do in the future, but it is expensive, impractical, or impossible

Chapter 1 MATHEMATICAL MODELING

MAT 530

to experiment directly with the system. Examples include nuclear reactor


design, space ight, extinction of species, weather prediction, drug efficacy
in humans, and so on. Using models, simulation of the real-world system
or phenomenon can be carried out, thus providing means to explain,
control, and predict events on the basis of controlled observations.
To aid in decision making. Testing using the model developed allows
the possibility of simulating the what if scenario or performing the
sensitivity analysis. Hence, the model provides concrete justifications for
any decison made.
Mathematics has been describe in old adage as the Queen of Science
and language of science". It been used to describe real phenomena
through the mathematical modeling process. Thus, it is not a surprise
that mathematical modeling has emerged to be a much needed tool in
this modern science and technology era. Cheaper and more advanced
computers enable mathematical models to play vital role in discovering
new knowledge and solving problems aside from becoming increasingly
cost-effective alternative to direct experimentation.

Despite the clear advantages of modeling, there is no definite steps for


constructing a one for all model. There is no model that can be applied
to all situations. Modeling is an art. It involves the creativity in utilizing a
sound mathematical knowledge together with the knowledge of the
system to create something useful to provide meaningful information and
interpretation of the system. Different expertise and perspectives yields
different models for the same system.

Such scenario justifies that there

is no best or perfect model. A model is generally a trade-offs between


the following:
a)

accuracy

b)

flexibility

c)

cost.

More accurate model requires higher cost and reduces flexibility. Higher
flexibility model, on the other hand, may jeopardize the accuracy of the
model and may comes at increased cost. In addition, expensive model is

Chapter 1 MATHEMATICAL MODELING

MAT 530

not preferrable since it does not necessarily guarantees accuracy or


flexibility.

Thus, modeling is always aimed at producing a sufficiently

accurate and flexible model preferrably at low cost.

Warm up exercise

Categorize the following models as one of the following:


a) A static physical model
d) An dynamic analogous model
b) A dynamic physical model e) A static symbolic model
c) An static analogous model f) A dynamic symbolic model

Universal Harmonics Model

Malignancies Dynamic Pathway Model

Answer: _______________________

Answer: _______________________

A Hurricane Forecast Model

A Volume Optimization Model

Answer: _______________________

Answer: _______________________

Chapter 1 MATHEMATICAL MODELING

MAT 530

1.4 Classification of Mathematical Models


When studying or developing models, it is helpful to identify the type of
models that we are dealing with. Mathematical models can be classified
into four different types: a) deterministic model, b) stochastic models, c)
empirical models and d) mechanistic models

Definition 1.5
A deterministic model is a model which is represented by a
function that allows predictions of the dependent variable to be
made based on the independent variable(s).

Deterministic models have no components that are inherently uncertain,


i.e., no parameters in the model are characterized by probability
distributions.

Deterministic models ignore random variation, and so

always predict the same outcome from a given starting point. In other
words, for fixed starting values, a deterministic model will always produce
the same result.

Deterministic model is usually applied for situations

where the outputs are direct consequence of the initial conditions of the
problem.
Definition 1.6
A stochastic model is a model where randomness is present
and variables are not described by unique values, but rather by
probability distributions.

A stochastic model is mainly used for situations where a random effect


plays a vital role in the model formulation and solving. This model, which
is statistical in nature, will produce many different results depending on
the actual values that the random variables take in each realization.
A stochastic model predicts the distribution of possible outcomes.

Chapter 1 MATHEMATICAL MODELING

MAT 530

Definition 1.7
A model is known as empirical model if it was constructed from
and based entirely on experimental data only, using no priori
information about the system.

For an empirical model, no account is taken of the mechanism by which


changes to the system occur and minimal information is used a priori in
the development of the model. The model just simply notes that some
phenomena occur and tries to account quantitatively for changes
associated with different conditions. Thus, an empirical model usually
provides a quantitative summary of these observed relationships among
a set of measured variables.

Models developed using statistical

techniques are examples of empirical models.

In an empirical model, relationship between variables is determined by


inspecting the data on the variables and selecting the best fit
mathematical formula to represent the relationship.

Therefore, it is a

compromise between accuracy of fit and simplicity of mathematics.


Definition 1.8
A model is known as mechanistic model if some of the
mathematical statements are based on priori information about
the system.

A mechanistic model uses a large amount of theoretical information by


attempting to explain phenomena that occur at a more detailed level of
structure.

It generally describes what happens at one level in the

hierarchy by considering processes at lower levels. It takes account of


the mechanisms through which these changes occur and generates
prediction concerning the variables based on this knowledge. The model
is built on causal relationships represented by equations.

Table 1.1 shows an example of classification of some models according


to the four classes of models.

Chapter 1 MATHEMATICAL MODELING

MAT 530

Table 1.1: Classification of Models

Deterministic

Mechanistic

Short term forecasts (nowcasts) of


seasonal climate based on historical
climate records (climatological
database) of rainfall or temperature
using regression analysis

A hypothetical study on predator-prey


relationships of the larval salamanders
and predacious aquatic invertebrates
a deterministic model with mechanistic
explanantion to patterns observed

Stochastic

Empirical

A mass flux balance model to estimate


heavy-metals in agriculture soil.
Normal or log normal probability
distribution is used to represent the
metal concentration.

A risk projection model in epidemiology


(in the form of a stochastic mechanistic
model) developed to estimate radiationinduced cancer risks to the end of life for
Japanese atomic bomb survivors.

A model can also be classified according to the level of understanding on


which the model is based. The simplest explanation is to consider the
hierarchy of organizational structures within the system being modeled.
For example, in the case of animals, models can be distinguished
according to different levels of this hierarchical structure. For example, a
model concerning an animal can be classified as a molecular model,
cellular model or an individual model of the animal. This classification
can be illustrated as in Figure 1.6.
High

Herd
Individual
Organs
Cells

Low

Molecules

Figure 1.6: A Classification of Model for Animals based on Hierarchy

Aside from classifying models based on the categories mentioned,


models can be distinguished based on whether they are static or dynamic
models. As described in Definition 1.3 and Definition 1.4, a static model

Chapter 1 MATHEMATICAL MODELING

MAT 530

does not account for the element of time whereas a dynamic model is
time dependent.

The static model describes the steady-state or

equilibrium situations of the system at a specific time instant, where the


output does not change if the input is the same. In a dynamic model, the
output changes with respect to time. A resistor system is a static model
where the voltage is directly proportional to the current, independent of
time. On the other hand, a capacitor is modeled as dynamic model since
the voltage is dependent on the time and previous time history.

Dynamic models can be divided further into continuous and discrete


models, as described in the following definitions.

Definition 1.9
A model is called discrete if the quantities have varied at discrete
times or places (or that we only consider discrete variations even
if they may change continuously).

Definition 1.10
A model is called continuous if there is continuous variation in
quantities.

Discrete models use a discrete or combinatoric description such as


integer numbers, graphs and difference equations. On the other hand,
continuous models often involve real quantities, i.e., real numbers,
physical quantities and differential equations rather than the difference
equations.

Differential equations denotes changes in time over an

infinitesmall interval whereas difference equations represent changes


over a finite interval (time jumps).

One further type of model, the system model, is worthy of mention. This
is built from a series of sub-models, each of which describes the essence
of some interacting components. The above method of classification then
refers more properly to the sub-models: different types of sub-models
may be used in any one system model.

Chapter 1 MATHEMATICAL MODELING

MAT 530

Much of the modelling literature refers to simulation models. Why are


they not included in the classification? The reason for this apparent
omission is that simulation refers to the way the model calculations are
done - i.e. by computer simulation. The actual model of the system is not
changed by the way in which the necessary mathematics is performed,
although our interpretation of the model may depend on the numerical
accuracy of any approximations.

1.5 Constructing Mathematical Models


Mathematical modeling is the art of transforming real world problem from a
specific application area into a structured mathematical formulation which is
solvable, thus the theoretical and numerical analysis can lead to useful
understanding, prediction, solution and interpretation related to the original
problem. Mathematical modeling has been successfully applied in wide areas of
applications, indispensable in some of these applications. The model developed
provides precise guide to solution of the problem, enables comprehensive
understanding of the system involved and allows the application of advanced
computing software and techniques.

Mastering the skill in mathematical

modeling should be one of the expertise that must be acquired by students,


aside from the theoretical mathematical learning in class, to enable them to
handle real world challenging problem of our time.

Figure 1.t illustrates the flow of interaction of the four main components of the
mathematical modeling process. Problem statement defines the problem and
wishes to are to be achieved by the by the model. The mathematical theory
includes theory related to the application, mathematical theory to be employed
and theories discussed in literature.

Mathematical solution methods underline

the mathematical approaches which could be utilized in generating the solutions


based on the mathematical model. Finally, computational experiments refer to
the execution of computer programs or simulation runs using certain data and
according to the mathematical model and solution techniques constructed.

Chapter 1 MATHEMATICAL MODELING

MAT 530

Problem
Statement

Computational
Experiments

Mathematical
Model

Mathematical
Theory

Mathematical
Solution
Methods

Figure 1.7: Interaction of the Components of the Mathematical Modeling


Process

The modeling process itself is usually an iterative process characterized by a


sequence of steps which sometimes required to be repeated. The steps include
the following:
a)

define the problem and objectives of the model;

b)

conduct a thorough literature review of the problem and existing models;

c)

gather complete data through data collection, empirical observations or


experiments;

d)

analyze data to identify the important factors (main variables, parameters


and constants) and

determine properties and relationships between

these factors as well as their influence towards the behavior of the


system;
e)

construct diagram, flowchart, network or computer visualization model to


get better understanding of the complex interaction of factors within the
system;

f)

list all assumptions and ways to verify and validate the model;

g)

transform the problem using abstraction or formulization into a


mathematical model. Start with a simple model as among models with
similar predictive power, the simplest one is the most desirable;

Chapter 1 MATHEMATICAL MODELING

h)

MAT 530

develop solution techniques that can be used to determine the solutions


of the model;

i)

perform computational experiments,which can consist of simulations,


analytical and qualitative analysis using mathematical techniques;

j)

analyze the results;

k)

validate and verify results based on interpretation and comparison with


the real system using data set that have not been used to build the
model;

l)

make conclusions, predictions and decisions based on j) and k);

m)

carry out the changes in the real system based on the findings and
mechanisms proposed by the model; and

n)

refine the model, if necessary, by repeating step a) to h) for enhanced


performance of the real system.

Steps : Constructing Mathematical Model


1.

Identify the real problem

2.

Formulate a mathematical model


i.

Identify and classify the variables

ii.

Determine interrelationships between the variables

4.

Obtain the mathematical solution to the model

5.

Interpret the mathematical solution

6.

Verify the model


i.

Does it address the problem?

ii.

Does it make common sense?

iii. Test or compare solution with real world data


7.

Write a report/Conclusion

8.

Implement the model

9.

Maintain the model

Chapter 1 MATHEMATICAL MODELING

MAT 530

Modeling Approaches
Construction of a mathematical model includes the following steps:

1.

Identify the real problem

a. This concern with questions such as the following:

How to classify the problem?

Is there an underlying physical/scientific behavior to be taken


account?

What kind of sources of facts and data are relevant?

Is data available? Is itr primary or secondary data?

What assumptions and simplifications about the problem can be


made?

b.

What kinds of models are applicable?

What is the purpose and objective of the model to be developed?

Will the solution based on the model be unique or not?

Who will use the model?

Formulate a precise problem statement


In most problems we can develop the problem statement by examining:

2.

What is known or given?

What is to be found, estimated or decided

What are the conditions to be satisfied?

What are the objectives to be achieved?

Formulate mathematical model


Various activities need to be carried as listed below:

a.

Identify and list the relevant factors and/or relationships.


Factors are quantifiable and can be classified as variables, parameters
or constants, and each of these can be continuous, discrete or random.

Continuous variables: takes all real values over an interval, e.g.


time, speed, length, density, etc.

Discrete variables: takes on certain isolated values only, e.g. the


number of people, cars, houses, months, etc.

Chapter 1 MATHEMATICAL MODELING

MAT 530

Random variables: unpredictable, but governed by some


underlying statistical model, e.g. buss arrival time.

Input

Variables:

quantities

which

determine

subsequent

evaluations within the model. Input variables are to be known, or


give, or assumed, or can be considered to have an arbitrary value.

Output Variables: quantities whish are consequences of given


values of input variables and parameters and cannot be given
arbitrary values. These represent outcomes from a model.

Parameters:

Quantities which are constant for a particular

application of model, but can have different values for another


application of the same model, e.g. fixed costs, the dimension of a
room, price of a ticket, etc.

Constants: quantities whose values we cannot change, e.g. ,


gravity, speed of light, etc.

All the factors must have suitable algebraic symbols and represent
measurements with certain unit of measurement.

b.

List the assumptions


Basic considerations for assumptions include:
i.

whether or not to include certain factors,

ii.

the relative magnitudes of certain effects of various factors (help


to identify the main factors), and

iii. the forms of relationship between factors this is the heart of the
model.
Appropriate assumptions keep the model simple.

c.

Collect data
Utilize data as much as possible.
i.

At initial stage analyze data to identify factors and their


relationships.

ii.

In the model development stage fix values of parameters and


constants that may occur in the model based on data.

iii. In the final stage valicate model by comparing its solution or


prediction with real data

Chapter 1 MATHEMATICAL MODELING

MAT 530

Challenges in data collection:

d.

Getting permission to collect data.

Getting right instruments / equipments.

Getting respondents to complete survey questionnaire.

Getting the right and complete data.

Formulate model
i.

Define variables representations and symbols.

ii.

Assign units.

iii. Determine the relations and equations connecting the problem


variables.
iv. Formulate objective of the model.
v.

Identify the form of outputs to be obtained.

vi. Specify constraints.


vii. Check models structure:
Given {values of input variables, parameters and constants},
find {values of output variables} such that {conditions are
satisfied or objective achieved}.

e.

Obtain the mathematical solution of the model


Solving process may involve the following:

3.

Plot graphs

Use Calculus approaches

Apply numerical methods

Apply optimization techniques

Run simulations

Execute computer programs

Analyze and Interpret solution


Analyze and examine results or solutions obtained.
a.

Check whether values of variables have the correct sign and size?

b.

Ask the following questions:

Are solutions produced reasonable?

Has data measurement and accuracy been achieved?

Have the best solution found?

Chapter 1 MATHEMATICAL MODELING

4.

5.

MAT 530

Compare with reality


a.

Test results against real data.

b.

Check the following:

Do proposed predictions based on solution make sense?

Do predictions agree with real data?

Evaluate the model. Is the model efficient?

Do results suggest more accuracy need to be achieved?

Write a report
The following questions can be considered in preparing the report.

Who is the report for?

What do the readers want to know?

How detail should the report be?

Are important features clearly described?

Are the results stand out?

Identify the real problem

Problem Definition

Formulate Model
Modeling

Solve the Model


Validation

Interpret Solutions
Conclusion
Translation

Compare with Reality

Write a report

Figure 1.8: Mathematical Modeling Process

Chapter 1 MATHEMATICAL MODELING

MAT 530

Example 1: Most Economical Size Box


A company decides to produce its own box for packaging
products manufactured by the company. It has been decided the
box should hold 0.1m3 (0.1 cubic meters). The box should have a
square base and double thickness top and bottom. Cardboard
costs RM1.50 per square meter. You are given the task of
designing the box and it is up to you to decide the most
economical size. What is the minimum cost to produce such box.

STEPS
1.

Identify the Problem

Given {the box is to have square base and double thickness top and
bottom; cardboard costs RM1.50 per square meter}, find {the dimension of
the box} such that {the cost is minimized}.

Draw diagram to understand the problem better.

TOP

TOP

w
TOP

h h

SIDE
BOTTOM

SIDE

SIDE

SIDE

SIDE

w
w

BOTTOM

Figure 1.9: Illustration for the Problem

BOTTOM

SIDE

Chapter 1 MATHEMATICAL MODELING

2.

MAT 530

Formulate mathematical model

Assumption: Ignore the thickness of cardboard for this model.


Volume
The volume of the box is given to be 0.1m3. Thus,
(1.1)

Area of the 4 Sides


Area of double tops and bases
Total cardboard needed

Total Cost (C)

Area of Cardboard

Area of Cardboard (in m2) x price (in RM) per square meter
(1.2)

Let us use method of substitution to solve a system of two equations,


equations (1.1) and (1.2), with two unknowns,
.
From (1.1), rearrange the equation to get:

(1.3)
Substitute equation (1.3) into equation (1.2):

(1.4)

3.

Solve the model

To find the dimension of the box which gives a minimum total cost,
differentiate equation (1.4) with respect to

.
(1.5)

Set the derivative equals to 0 to get the value of

0.37 m or

cm

37 cm.

Chapter 1 MATHEMATICAL MODELING

Substituting the value of

MAT 530

in (1.3) gives us:


0.74 m or

m
Find the second derivative of

cm

74 cm

with respect to

(1.6)

into equation (1.6), we obtain,

Substituting

, we conclude that

Since

is minimum when

meter. Substituting the values of


get the minimum cost,
.

in equation (1.4), we

Analyze and Interpret the solution

Plotting the graph of equation (1.4) gives us the graph as shown in


Figure 1.10, where the point (0.37, 2.44) is the lowest point on the graph.
By examining the graph, the width ( ) could be anywhere between 0.35 m
to 0.38 m without affecting the minimum cost very much, that is
.

7
Cost per Box (in RM)

4.

and

meter and

6
5
4
3
0.3, 2.54

0.4, 2.46

1
(0.37, 2.44)

0
0

0.2

0.4

0.6

0.8

Width or length of the box, w (in m)

Figure 1.10: Graph of Cost (C) vs Width (w)

1.2

Chapter 1 MATHEMATICAL MODELING

MAT 530

Conclusion
Based on the mathematical model, the following can be recommended:

Length or width ( )

Height ( )

Cost ( )

But any width between 0.35 m and 0.38 m would be fine, since the cost

m,

m,

will not differ much.


Thus, a more practical solution may be:

Length or width ( )

Height ( )

Cost ( )

m,

m,

Refinement of the model


Improvements of this model may include the following:

Include cost of glue or staples

Include wages for assembly workers

Include wastage when cutting box shape from cardboard.

Should the design be changed to optimize use of cardboard?

Chapter 1 MATHEMATICAL MODELING

MAT 530

1.6 Method of Least Squares


The Method of Least Squares is a procedure to determine the best fit line to
data; the proof uses simple calculus and linear algebra. The basic problem is to
find the best fit straight line

given that, for

, the pairs

are observed. The method easily generalizes to finding the best fit of the
form:

where

is not necessarily a linear function, but

must be a linear

combination of these functions.

Given data,
saying

, we may define the error associated to


by
(1.7)

The goal is to find values of

and

that minimize the error. In multivariable

calculus we learn that this requires us to find the values of (a; b) such that

.
.
Differentiating

and setting the derivatives equals to 0 gives:

and dividing by 2 yields:


.
.
We may rewrite these equations as:
.

Chapter 1 MATHEMATICAL MODELING

MAT 530

It can be shown that solving the equations simultaneously yields:

.
.

From (1.12) and (1.13), we found that values of

and

(defined in (1.7) satisfy the following matrix equation:

Define

This, we have
Since the matrix A is invertible, this implies:

which minimize the error

Chapter 1 MATHEMATICAL MODELING

MAT 530

Example 2: Curve Fitting using the Method of Least Squares


Comsider the dat given below:
x

26

30

44

50

62

68

74

92

85

78

80

54

51

40

Find the best fit line using least squares method that describes the linear
relationship between y and x.

Solution

1
2
3
4
5
6
7

x
26
30
44
50
62
68
74

y
92
85
78
80
54
51
40

676
900
1936
2500
3844
4624
5476

= -1.03
120.88

Alternatively,

The equation of the best fit line is:

8464
7225
6084
6400
2916
2601
1600

2392
2550
3432
4000
3348
3468
2960

Chapter 1 MATHEMATICAL MODELING

MAT 530

y
100
90
80
70
60
50

y = -1.0344x + 120.88
R = 0.9249

40
30
20
10
0
0

20

40

60

80

Figure 1.10: Best Fit Line using Trendline in Excel

Example 3: Method of Least Squares and Linearization


A rectangular house is to be built with exterior walls that are 8 feet high. One
wall of the house will face north. The total enclosed area of the house will be
1500 square feet. Annual heating costs for the house are determined as
follows: each square foot of exterior wall with a northern exposure adds RM4 to
the annual heating cost; each square foot of exterior wall with an eastern or
western exposure adds RM2 to the annual heating cost; each square foot of
exterior wall with a southern exposure adds RM1 to the annual heating cost.
For what value of L is the annual heating cost minimized, and what is the
annual heating cost for this choice of L? The values given for the heating costs
per square foot can only be known approximately. How does the solution
depend on the given values for the heating costs?

Solution

Identify the expected function : y aebx

Identify the unknown : a, b

Chapter 1 MATHEMATICAL MODELING

MAT 530

Linearize the function :


y aebx
ln y ln aebx

ln y ln a ln ebx
ln a bx ln e

ln e 1)

ln a bx

Transform the data and/or unknown :

a0 ln a

Y ln y

Identify normal equation

n
x
i

i 1

Yi

0
i 1
i 1

a = n
n

1
x i2
x i Yi

i 1

i 1

xi a

a1 b

Determine the respective values:


i
1
2
3
4
5
6

xi2
0.16
0.64
1.44
2.56
4.00
5.29

xi
0.4
0.8
1.2
1.6
2.0
2.3

yi
800
975
1500
1950
2900
3600

Yi
6.6846
6.8824
7.3132
7.5756
7.9725
8.1887
n

x
i1

8.3

14.09

Yi 44.6170

i1

i1

Substitute the respective values in the normal equation.


8.3
6

8.3 14.09

a 0
44.6170
=

63.8555
a1

Solve for the coefficients: a 0 and a1

a0 6.3037 and
a1 0.8187

Substitute to the transform unknown :


a0 ln a 6.3037
ae

a1 b 0.8187

6.3037

546 .5906

The expected function is y 546.5906 e0.8187 x

xi Yi
2.6738
5.5059
8.7759
12.1209
15.9449
18.8340

x Y 63.8555
i i

i1

Chapter 1 MATHEMATICAL MODELING

Example 4: Least Squares Technique


Use least-squares procedure to fit y = Axk to the following data.
xi

1.00

1.15

1.40

1.43

1.60

2.00

yi

4.33

4.58

4.98

5.06

5.28

5.80

Solution

y Axk

Taking natural logarithm both sides:


ln y = l n A + k
Y

ln x

a0 a1X

The necessary transformation for the data and unknowns are:


Y ln y

X ln x

=ROUND(LN(C4);4)

Rewrite
ln y = ln A + k ln x
as
Y = a0 + a1 X

a0 ln A

k a1

MAT 530

Chapter 1 MATHEMATICAL MODELING

MAT 530

Hence, the required normal equations:


6

xi a
Yi
6

i 1 0 = i 1


6
6

2 a1
xi xi
x i Yi
i 1
i 1

i 1

1.9971 a 0
9.6358
6

a = 3.3333

1.9971 0.9620 1

Solving for a0 and a1:


a0 = 1.4649
Since a1 = 0.4239 then k = a1 = 0.4239
But

ln A = a0

then

A = e a0
= e1.4649
= 4.327
Hence, the expected function is y = Axk = 4.327x0.4239

Warm up exercise
Find the values of a and b of the form y = aex + be-x to the following data:
X
Y

0
5.02

0.5
5.21

1.0
6.49

1.5
9.54

2.0
16.02

2.5
24.53

Chapter 1 MATHEMATICAL MODELING

MAT 530

1.7 Continuous Least-Squares Polynomials


The

previous

section

considered

the

problem

of

least-squares

approximation to fit a collection of discrete data. The other approximation


problem concerns the approximation of functions or fitting continuous
data.
Consider a function y = f(x), which is continuous in [a, b]. Let
Pm ( x) a0 a1x a2 x 2 ... ai xi ... amxm

be a polynomial which

represent the function y = f(x), then the total least squares error is defined
as follows
b

f(x)- Pm (x) dx
2

f(x)- a0 a1x a2x


b

... ai xi ... am xm

dx
2

We seek to minimize the sum of error squares. From the calculus of


functions of several variables, a necessary condition for the values a0, a
and am to minimize E such that
E
E
E
E
=
= ...
= ...
=0
a0 a1
ai
am

0im

Hence,

a0 f(x)- a0 a1x ... aix


b

(1)

(2)

... am xm 2dx 0

... am xm 2dx 0

a1 f(x)- a0 a1x ... aix


b

.
.
.

a f(x) - a
b

(i )

( m)

a1 x ... ai x i ... a m x m 2 dx 0

.
.
.

a f(x) - a
b

a1 x ... ai x i ... a m x m 2 dx 0

, ,

Chapter 1 MATHEMATICAL MODELING

MAT 530

Simplifying (1) yields

2 f(x)- a0 a1x ... aix

... am xm ( 1)dx 0

a0 a1x ... aix


a
b

... am xm f ( x ) dx 0
b

a0dx a1xdx ... ai xidx ... am xm dx f ( x ) dx

a
b

a
b

a
b

a
b

a0 dx a1 xdx ... ai x dx ... am xm dx f ( x ) dx


a

Simplifying (2) to (m) using similar procedures yield the normal equations
b

a0 xdx a1 x dx ... ai x
a

i 1

dx ... am x

m 1

dx xf( x )dx

a0 xidx a1 x 2 idx ... ai x 2idx ... am xm idx xif ( x )dx

:
.
b

a0 x dx a1 x
a

2m

dx ... ai x

im

dx ... am x

b
2m

dx xm f ( x )dx
a

In matrix form the normal equations can be represented as:

b
b
dx
xdx

a
ba
b

x 2dx
xdx
a
a
...
...
b
b
i
xi 1dx
x dx
a
a
...
...
b
b
xmdx
xm 1dx

a
a

...

xidx

...

a
b

...

xi 1dx

a
b

...

...

...

...

2i

dx

...

...

im

dx

...
b

...
b

...

xm 1dx

...

xmdx

mi

...

...
b

dx ...

2m

dx

f ( x )dx

ba

a0 xf( x )dx

1 a

.
.

.
.

a b

i
i

. x f ( x )dx
. a

a
.

x f ( x )dx

Chapter 1 MATHEMATICAL MODELING

MAT 530

Steps : Fitting Continuous Least Squares Polynomial


Determine the degree m of the polynomial : m
Write the general expression of the polynomial to be fitted
Pm(x) = a0 + a1x + a 2 x 2 + ... + am x m
Write the normal equations in matrix form.
b

Compute :

xidx for 0 i 2m and

x f ( x)dx for 0 i m
i

Solve for the coefficients a0, a1am.


Thus, the least-squares function is:
f(x) = a0 + a1x + a 2 x 2 + ... + am x m
Solve for a0 and a1.
Thus, the least-squares line is f(x) = a0 + a1x.

Example 5:

Derive the normal equation in matrix form to approximate y = f(x) with a


straight line on the interval [a, b].

Solution

Let P1( x) a0 a1x

E
E
=
=0
a0 a1
b

f(x)- P1(x) dx
2

f(x)- a0 a1x dx

a0 f(x)- a0 a1x dx 0
2

a
b

2 f(x)- a0 a1x (1)dx 0

a
b

a0 a1x f ( x)dx 0
a
b

a0dx a1xdx f ( x )dx

a
b

a
b

a0 dx a1 xdx f ( x )dx
a

Chapter 1 MATHEMATICAL MODELING

MAT 530

a1 f(x)- a0 a1x dx 0
2

a
b

2 f(x)- a0 a1x (x)dx 0

a
b

a0 a1x f ( x)xdx 0
a

a0 xdx a1x

a
b

b
2

dx xf( x )dx
a
b

a0 xdx a1 x 2dx xf( x )dx


a

b
b

xdx
f ( x )dx
dx

a
a
a0 a


b
b
b

2 a1
xdx x dx
xf( x )dx
a
a

Example 6: Find the least squares polynomial approximation of degree


one to y = x 2 + 4x + 4 on the interval [0,2].

Solution
2
2

dx
xdx

a
f ( x )dx
0
0
0 0

2
2
2

a
2
1
xdx x dx
xf( x )dx
0
0

56
2 2 a
8 0 3

2
68
a

3 1
3

a0 3.336

a1 5.997
Hence, P1( x) 3.336 5.997 x

Chapter 1 MATHEMATICAL MODELING

MAT 530

Example 7:
Find the least squares polynomial approximation of degree two to f(x) =
ex on the interval [ 0, 1]

Solution

Determine the degree m of the polynomial


m=2
Write the general expression of the polynomial to be fitted

P2(x) = a0 a1x a2 x 2
Write the normal equations in matrix form.
1
dx
0
1
xdx
0
1 2
x dx
0

1 x

2
x dx
e dx
0
0
a0 0

1
1
1

2
3
x
x dx x dx a1 xe dx
0
0
a 0

2 1
1
1
3
4
2 x
x dx x dx
x e dx
0
0

xdx

Compute :

x dx
i

for 0 i 4 and

x f ( x)dx for 0 i m
i

0.5
0.3333 a0 1.7183
1
0.5
0.3333
0.25 a1 1

0.3333
0.25
0.2 a2 0.7183
Solve for the coefficients a0, a1am.
a0 1.0140
a 0.8445
1

a 2 0.8449

Thus, the least-squares function is:


P2(x) = 1.0140 0.8445x 0.8449x 2

2.7 Legendre Polynomial


The

previous

section

considered

the

problem

of

least-squares

approximation to fit a collection of discrete data. The other approximation


problem concerns the approximation of functions or fitting continuous data.
In this section we shall learn to fit data in continuous form using sequences
of Legendre polynomials.

Chapter 1 MATHEMATICAL MODELING

MAT 530

Definition
The functions listed below are called Legendre polynomials and are
defined for
-1 x 1:
P0(x)

= 1

P1(x)

= x

P2 ( x )

1 2
3x - 1
2

P3 ( x )

1 3
5x - 3x
2

P4 ( x )

1
35x 4 - 30x 2 + 3
8

P5 ( x )

1
63x 5 - 70x 3 + 15x
8

.
.
.
2m + 1
m
Pm 1( x )
Pm -
Pm -1
m +1
m + 1

This set of Legendre polynomials is said to be orthogonal on [-1,1] with


respect to the weight function w(x) 1 .The criteria required is that these
functions are designed to satisfy the following orthogonality condition:

0 if n m

Pm ( x ) Pn ( x ) dx 2
2n 1 if n m
1
1

(details of orthogonality and weight function shall not be discussed here)


In general, the Legendre polynomials can also be derived by the formula:
Pn ( x )

1
n

dn

2 n! dx

(x

- 1)n

Suppose y(x) is a function continuous on [-1,1]. Here, the approach to


finding the least-squares approximating polynomial f(x) to fit the function
y(x) (or, the continuous data) is done in a similar manner. Let f(x) be of
polynomial of degree m defined using sequences of Legendre polynomials
such that
f(x) = a0P0(x) + a1P1(x) + a2P2(x) + . . . + amPm (x) .

Chapter 1 MATHEMATICAL MODELING

MAT 530

We seek to minimize the sum of error squares; i.e.


1

f(x)- y(x) dx
2

-1
1

a0P0 (x) + a1P1(x) + amPm (x) - y(x) dx


2

-1

(1)
where, Pi (x) is a Legendre polynomial and a i is a constant coefficient.

From the calculus of functions of several variables, a necessary condition


for the values a0, a

, , am

to minimize L is that

L
= 0, for each k = , , , m.
ak

Hence, using (1),


L

a k

a 0P0 ( x) a1P1( x) amPm ( x) - y( x)

dx

-1

With the orthogonality property of Legendre polynomials, this term can be


simplified to:
1

akPk ( x)Pk ( x) - y( x)Pk ( x) dx 0

-1
1

ak . Pk ( x ) x

-1

y( x) Pk ( x)dx
-1

2
ak
2k 1

y( x) Pk ( x)dx
-1

Thus,
2k 1
ak
2

y(x)Pk (x) dx
-1

Notice that ak calculates the coefficients a0, a1, , am with the condition that
x is defined for y(x) on the interval [-1,1].

Chapter 1 MATHEMATICAL MODELING

MAT 530

Theorem
Suppose y(x) is continuous and defined on [-1,1], then y(x) can be
approximated by a least-squares polynomial f(x) of degree m, using
series of Legendre polynomials such that:
f(x) = a0P0(x) + a1P1(x) + a2P2(x) + . . . + amPm(x)
where, the coefficients a0, a1, , am is be determined by

2k 1
ak
2

y( x) Pk ( x) dx

for k = , , , ,.,m

Steps : Fitting continuous data (or function) using


Legendre polynomials if independent variable
is defined on [-1,1]
Identify the observed function: y(x)
Determine the Legendre polynomials of degree m:
f(x)= a0P0(x) + a1P1(x) + a2P2(x) + . . . + amPm(x)
Determine the coefficients a0, a

ak

2k 1
2

, , am

y( x) Pk ( x) dx

for k = , , , ,m

Example 8:
Find the least squares polynomial approximation of degree one to y = x 2 +
4x + 4 on the interval [-1,1].

Solution
Identify the observed function :
y(x) = x 2 + 4x + 4
Determine the Legendre polynomials of degree 1:
f(x) = a0P0(x) + a1P1(x)
= a0 + a1x
where P0(x) = 1 and P1(x) = x
Determined the coefficients a0 and a1:

2k 1
ak
2

y( x) Pk ( x) dx

for k = 0,1

Chapter 1 MATHEMATICAL MODELING

MAT 530

k 0:

2(0) 1
a0
( x 2 4 x 4) P0 ( x ) dx
2

1
( x 2 4 x 4)(1)dx
2

13
3
1

k 1 : a1

2(1) 1
( x 2 4 x 4) P1( x ) dx
2

( x 2 4 x 4)x dx
2

Thus, the polynomial of degree one to fit y(x) is:


f(x) = a0P0(x) + a1P1(x)
=

13
+ 4x
3

Other method which can be applied is


1
1

dx

y( x )dx
xdx

a0

1
1

11

1
1
a

2 1
x dx
xdx
xy( x )dx
1

In the case where x (or the independent variable) is defined on [m,n], a


suitable linear transformation is required so that the interval range of the
independent variable is normalized to be on [-1,1].
Steps : Fitting continuous data (or function) using
Legendre polynomials if independent variable
is not defined on [-1,1]

Transform x to t linearly: x [m, n ] t [1,1 ]


Let x at b
Solve for a and b
Rewrite y(x) in term of y(t)
Determine the Legendre polynomials of degree m
f(t) = a0P0(t) + a1P1(t) + a2P2(t) + . . . + amPm(t)

Determine the coefficients a0, a


1
2k 1
ak
y( t ) P k ( t ) dt
2 1

, , am

for k = 0,1,2,3,..,m

The polynomial of degree m to fit y(t) is:


f(t) = a0P0(t) + a1P1(t) + a2P2(x) + . . . + amPm(t)
Rewrite f(t) in term of f(x).

Chapter 1 MATHEMATICAL MODELING

MAT 530

Example 9:
Find the least squares polynomial approximation of degree one to y = x 2
+ 4x + 4 on the interval [0,2]

Solution

Since x [0 ,2 ] and x [1, 1 ] then transformation is required.


Transform x to t linearly:
x [0,2 ] t [1,1 ]

Let . x = at + b
Solve for a and b
When x = 0:

t=-1 :

When x = 2:

t=

0 = a(-

+b

=a

+b

Solving (1) and (2):


a=1

and

b=1

Thus
x=t+1

or

t=x1

Rewrite y(x) in term of y(t):


y(x) = x 2 + 4x + 4, but x = t+1
y(t) = (t+1) 2 + 4(t+1) + 4
= t 2 + 6t +9
Determine Legendre polynomials of degree 1:
f(t) = a0P0(t) + a1P1(t)
= a0 + a1t
where P0(t)=1 and P1(t)=t
Determine the coefficients a0 and a1:
1

2k 1
ak
y( t ) P k ( t ) dt
2 1

k 0 : a0

for k = 0,1

2(0) 1 1 2
( t 6t 9) P 0( t ) dt
2
1

11 2
28
( t 6t 9)(1) dt
2 1
3

Chapter 1 MATHEMATICAL MODELING

k 1 : a1

MAT 530

2(1) 1 1
y( t ) P 1( t ) dt
2 1
3 1 2
( t 6t 9)(t ) dt 6
2 1

The polynomial of degree 1 to fit y(t) is:


f(t) = a0P0(t) + a1P1(t)

28
+ 6t
3

Rewrite f(t) in term of f(x):

28
+ 6(x-1) since t = x 1
3

f(x) =
=

10
+ 6x
3

Example 10:
Find the least squares polynomial approximation of degree two to f(x) =
ex on the interval
a)

[-1, 1]

b) [ 0, 1]

Solution

No transformation required since x [1, 1 ] .


Given
y(x) = ex
and
f(x) = a0P0(x) + a1P1(x) + a2P2(x)

polynomial of degree two

a0P0 ( x ) a1P1( x ) a2P2 ( x )


1

ao a1x a2 (3x 2 1)
2

since P0 ( x ) 1 ,

1P1( x )

and P2 ( x ) (3x 2 1)
2

Determined the coefficients a0 ,, a1 and a2:

ak

2k 1
2

y( x) Pk ( x) dx

for k = 0,1,2

Chapter 1 MATHEMATICAL MODELING

MAT 530

2(0) 1
k 0 : a0
e x P0 ( x ) dx
2

1
e x dx
2

1.1752
1

k 1 : a1

2(1) 1
e x P1( x ) dx
2

3
e x x dx
2

1.1036
1

k 2:

2(2) 1
e x P2 ( x ) dx
2

a1

5
1

e x (3 x 2 1) dx
2
2

0.3578

Hence,
f ( x ) a 0P0 ( x ) a1P1( x ) a 2P2 ( x )
1

a o a1x a 2 (3 x 2 1)
2

1.1752 1.1036 x 0.3578 (3 x 2 1)


2

0.9963 1.1036 x 0.5367 x 2 .

b)
Need a suitable linear transformation since x [1, 1 ] and x [0 ,1 ]
Make a suitable linear transformation of x to t:
x [0,1 ] t [1,1 ]

i.e. x = at + b, solve for a and b


when x = 0, t = - 1 :
when x = , t =

Solving (1) and (2):

1
and
2

1
2

0 = a(-1) + b = - a + b
=a

+b=a+b

Chapter 1 MATHEMATICAL MODELING

MAT 530

Thus,

1
1 t 1
t
or
2
2
2

2x t 1 t 2x 1

Write y(x) in the term of y(t):


y( x ) e x
y( t ) e

t 1
2

Write the least-squares polynomial in the new variable t in the form of


Legendre polynomials:
f(t) = polynomial of degree two (quadratic)
f ( t ) a 0P0 ( t ) a1P1( t ) a 2P2 ( t )
1

a o a1t a 2 (3t 2 1)
2

Determine the coefficients a0 , a1 and a2:


1

ak

2k 1
y( t ) Pk ( t ) dt for k = 0,1,2
2 1

t 1

2(0) 1 1 2
k 0 : a0
e P0 ( t ) dt
2
1
t 1

11
e 2 dt
2 1
1.7183
t 1

2(1) 1 1 2
k 1 : a1
e P1( t ) dt
2
1
t 1

3 1
e 2 t dt
2 1
0.8452
t 1

k 2 : a2

2(2) 1 1 2
e P2 ( t ) dt
2
1
t 1

51
1

e 2 . (3t 2 1) dt
2 1
2

5
0.0559
2
0.1398

Thus,
f (t ) a0P0 (t ) a1P1(t ) a 2P2 (t )

Chapter 1 MATHEMATICAL MODELING

MAT 530

f ( t ) 1.7183 0.8452 t (0.1398 ) (3t 2 1)


2

1.6484 0.8452 t 0.8388 t 2

Hence
f ( x ) 1.6484 0.8452(2x 1) 0.8388(2x 1)2
1.3097 14.7872 x 13.0968 x 2

Warm up exercise
Find the least squares polynomial approximation of degree two to:
a) f(x) = sin 2x on the interval [-1,1] and [0, 1]
b) f(x) = ln x on the interval [1,3]

Chapter 1 MATHEMATICAL MODELING

MAT 530

Exercise 4
1.

Fit a straight line to the given data.


a)

2.

y
1
2
3
3
4

b)

x
-6
-2
0
2
6

y
-5.3
-3.5
-1.7
0.2
4.0

c)

x
-3
1
3
5
9

y
-6
-4
-2
0
4

x
-3
-1
1
3

y
15
5
1
5

c)

x
-2
-1
0
1
2

Y
2.80
2.10
3.25
6.00
11.50

Fit a parabola to the given data.


a)

3.

X
-2
-1
0
1
2

X
2.0
2.3
2.6
2.9
3.2

y
5.1
7.5
10.6
14.4
19.0

b)

The table below shows the time (in seconds) required for water to drain
through a hole in the bottom of a bottle as a function of depth (in meters) to
which the bottle has been filled.
Depth
Time

0.05
65.99

0.10
120.28

0.15
166.69

0.20
207.85

0.30
279.95

0.35
313.04

0.40
344.24

a) Find the regression line to fit the data


b) Estimate the time required for water to drain at depth of 2.5 meters.
4.

Find the best-fit line for the given values.


x
y

5.

6
22

10
28

14
14

16
22

20
16

22
8

28
8

28
14

36
0

38
4

Fit a least-squares quadratic function (parabola) to the given data.


x
p(x)

6.

5
30

0.0
0.0

1.0
2.0

2.0
5.0

3.0
8.0

4.0
12.0

5.0
25.0

6.0
40.0

7.0
57.0

The following tabulated values are taken from an experiment. Complete


the table and calculate the sum of error squares.
x
Observed y
Calculated y
Error

0.0
0.0

1.0
2.0

2.0
5.0

3.0
8.0

4.0
12.0

5.0
25.0

6.0
40.0

7.0
57.0

Chapter 1 MATHEMATICAL MODELING

7.

MAT 530

Find the values of A and B to fit a curve of the following form to the given
data
a) y

8.

1
Ax B

b) y

A
B
x

-1

0.1

6.62

3.94

2.17

1.35

0.89

The data given are for the solubility S of n-butane in anhydrous


hydrofluoric acid at high temperature T needed in the design of petroleum
refineries. Determine the constants and to fit the data to the model
S eT . Estimate the solubility when temperature is 95F.

9.

Temperature F

77

100

185

239

285

Solubility (weight %)

2.4

3.4

7.0

11.1

19.6

One of the following data sets, (x,y1) and (x,y2) , follows an exponential
law y Aebx and the other follows a power law y Axb . Which is which?
Fit the data to the respective model and calculate the sum square errors.
X
2.0
2.5
3.0
3.5
4.0
4.5
5.0

10.

11.

y1

14.79

27.75

47.09

74.07

109.99

156.10

213.69

y2

12.13

19.58

31.59

50.97

82.21

132.59

213.82

Find the least- squares polynomial approximation of degree one to the


function f(x) on the indicated interval.
a)
f(x) = e2x ; [-1, 1]
b)
f(x) = sinx ; [-1, 1]

1
;
x

c)

f(x)

[-3, -1]

d)

f(x) = cos 2x ; [0, 0.5] ,

e)

f(x) = x3 1; [0,2]

f)

f(x) = ln x; [1, 2]

Find the least- squares polynomial approximation of degree two to the


function f(x) on the indicated interval.
a)
f(x) = e-x ; [0, 1]
b)
f(x) = cos x; [-1, 1]
c)

f(x) = x3 x + 1; [0, 3]

d)

f(x) = sin2x; [0, ]

S-ar putea să vă placă și