Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CH#6 Numerical PDE and Optimization-01!02!2022-Final-Form

Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

Applied Numerical Methods CH#6 Numerical PDE & Optimization

CHAPTER # 6
NUMERICAL
PARTIAL DIFFERENTIAL
EQUATIONS (PDE)
&
OPTIMIZATION

Dr. Jamil Book Series 1 Page 1


Applied Numerical Methods CH#6 Numerical PDE & Optimization

CHAPTER # 6
Numerical PDE and Optimization
Part I: Numerical Partial Differential Equations (PDE)
7.1.1 Introduction:-
We often encounter PDE in science and engineering especially in problems involving wave
phenomena, heat condition is homogenous solids and potential theory. As it is not possible
or very difficult to find analytical solution for most of the PDE in closed form, we go in
sufficiently approximate solutions by simple numerical methods, of the various numerical
methods available for solving PDE, the method of finite difference equation corresponding
to the given PDE is first obtained by replacing partial differential coefficients in it by the
finite difference approximations and then solved by arithmetic procedure.
7.1.2 Classification of PDE:-
A partial differential equation (PDE) involves two or more independent variables. The most
general form of linear PDE of the second order in two independent variable is:

(1)

or

(2)

Where A, B, C, D, E, F are in general functions of and . The equation ( ) and( )of 2nd
order PDE is classified as:
1):Elliptic if
2):Parabolic if
3):Hyperbolic if
7.1.3 Standard Examples:-
1): Elliptic equation:-
a): The Laplace equation is given by:

OR

Here

b): The Poisson equation is given by:

( ) OR ( )

Here

Dr. Jamil Book Series 1 Page 2


Applied Numerical Methods CH#6 Numerical PDE & Optimization

2): Parabolic equation:-


The one dimensional heat equation is given by:

Here

3): Hyperbolic Equation:-


The one dimensional wave equation is given by:

Here

Example # 1:-
Classify the following PDE:-

This can also be written as:

( ) ( )( )

The equation is Parabolic at all points.

Example # 2:-
Classify the following PDE:

Dr. Jamil Book Series 1 Page 3


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( )( )

The equation is elliptic, parabolic or hyperbolic according as or

Example # 3:-
Classify the following PDE:

( )( )( )

The equation is elliptic at all points except origin( ) (here it is parabolic).

Note:-
There are many methods for solving PDE numerically. The following three methods are
very famous in this study:
1): Finite difference method (FDM)
2): Finite element method (FEM)
3): Finite volume method (FVM)
Let us now discuss the Finite Difference Method.

7.1.4 Finite Difference Method (FDM):-


In this method if the function and its derivatives were single value, finite and continuous
functions and their derivates are discrete points. Thus we have:

( ) ( )
( ) [Forward Difference]

( ) ( )
( ) [Backward Difference]

( ) ( ) ( )
( )

( ) ( )
( ) [Forward Difference]

Dr. Jamil Book Series 1 Page 4


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( ) ( )
( ) [Backward Difference]

( ) ( ) ( )
( )

7.1.5Graphical Representation:-
A Rectangular domain is divided into divisions with step-size in direction as
and division with step size in direction as as shown in the following figure.

The networks of these rectangles are formal by line:

The points of intersection of these families of lines are called Mesh point or lattice point
grid points.

Dr. Jamil Book Series 1 Page 5


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( )

( ) ( )
( )

( )

7.1.6 Short Notation for differences:-


From above figures, we have

[Forward Difference]

[Backward Difference]

[Forward Difference]

[Backward Difference]

Dr. Jamil Book Series 1 Page 6


Applied Numerical Methods CH#6 Numerical PDE & Optimization

7.1.7 Solution of Elliptic equation:-


1): Laplace Equation:-
a): Standard five point formula (SFPF):-
The most important type of elliptic equation is Laplace equation that is

OR

Approximating the derivatives by difference expression, we get

If we consider square mesh and ,then

( ) (SFPF)

( ) (SFPF)

That is the value of at any interior point is the arithmetic mean of the values of at the
four lattice points. This is called standard five point formula (SFPF).

Schematic diagram
Central value = average of other four values

Dr. Jamil Book Series 1 Page 7


Applied Numerical Methods CH#6 Numerical PDE & Optimization

b): Diagonal five point formula (DFPF):-

Instead of the (SFPF). We can also use the formula:

( ) (DFPF)

( ) (DFPF)

Which is called the diagonal five point formula (DFPF).This formula is valid from the fact
that the Laplace equation is invariant when the coordinate axes are rotated through an
angle of .
Important note:-
1): In all computation we use the standard formula (SFPF) instead of the diagonal formula
(DFPF), wherever possible as the error in the diagonal is times more than the error in
standard formula.

2): We use an iteration process called liebmann’s process to solve the Laplace equation. We
will explain this method by some examples.

Dr. Jamil Book Series 1 Page 8


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Example # 1:-
Solve the Laplace equation and find by liebmanns’s method the values at the
interior lattice in the following diagram.

Solution:-
Let us take the initial value of then we have the following initial values from the
given diagram.
For critical values:-

( )
( ) (DFPF)

( )
( ) (SFPF)

( )
( ) (SFPF)

( )
( ) (SFPF)

Conversion into gauss-seidel system:-


( ) ( ) ( )
( )

( ) ( ) ( )
( )

( ) ( ) ( )
( )

Dr. Jamil Book Series 1 Page 9


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( ) ( ) ( )
( )

Now we make a table as:


“Table of values”

( ) ( ) ( ) ( )

Hence the required values correct up to decimal places are

Example #2
Find by the liebmann’s method the values at the interior lattice points of a square region of
the harmonic function whose boundary value are as shown in the following figure.

Dr. Jamil Book Series 1 Page 10


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Solution:-
Since is harmonic it must satisfy the Laplace equation:

OR

Let the interior values of at the 9 grid points be We will find the values of
at the interior mesh points. We proceed to refine them.

Dr. Jamil Book Series 1 Page 11


Applied Numerical Methods CH#6 Numerical PDE & Optimization

For the initial values:-


( )
( ) (SFPF)

( )
( ) (DFPF)

( )
( ) (DFPF)

( )
( ) (DFPF)

( )
( ) (DFPF)

( )
( ) (SFPF)

( )
( ) (SFPF)

( )
( ) (SFPF)

( )
( ) (SFPF)

Conversion into gauss-seidel system:-

( ) ( ) ( )
( )

( ) ( ) ( ) ( )
( )

( ) ( ) ( )
( )

( ) ( ) ( ) ( )
( )

( ) ( ) ( ) ( ) ( )
( )

Dr. Jamil Book Series 1 Page 12


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( ) ( ) ( ) ( )
( )

( ) ( ) ( )
( )

( ) ( ) ( ) ( )
( )

( ) ( ) ( )
( )

Now we make a table as:

“Table of values”

( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )

Hence the required values correct up to decimal places are:

Dr. Jamil Book Series 1 Page 13


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Example #3
Solve the Laplace equation for the following Mesh with boundary condition
(see figure in the next page).

A 500

C D

Solution:-

The values of are symmetric about lines and .Hence by symmetry, we have:

For initial values:-


( )
( ) (SFPF)

( )
( ) (DFPF)

( )
( ) (SFPF)

( )
( ) (SFPF)

Conversion into gauss-seidel system:-

( ) ( ) ( )
( )

( ) ( ) ( ) ( ) ( ) ( )
( ) ( )

Dr. Jamil Book Series 1 Page 14


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( ) ( ) ( ) ( ) ( ) ( )
( ) ( )

( ) ( ) ( ) ( ) ( ) ( ) ( )
( ) ( )

Since in above, we use:

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )
,

Now we make a table as:

“Table of values”

( ) ( ) ( ) ( )

Hence the required values are:

Dr. Jamil Book Series 1 Page 15


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Example #4:-
Solve the Laplace equation for the following square Mesh with boundary
condition:

Solution:-
The values of are symmetric about lines . Hence by symmetry, we have:

For initial values:-


Let us assume that:

( ) ( )

Then

( )
( ) (SFPF)

( )
( ) (SFPF)

Next iteration by gauss-sediel method:-

( ) ( ) ( )
( ) ( )

( ) ( ) ( )
( ) ( )

Dr. Jamil Book Series 1 Page 16


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( )

( ) ( ) ( )
( ) ( )

Since the values are similar to the initial values.


Hence:

Dr. Jamil Book Series 1 Page 17


Applied Numerical Methods CH#6 Numerical PDE & Optimization

2): POISSON EQUATION


Poisson equation is of the form:

( ) OR ( )

It is also an elliptic equation. Taking (here of course ) and


substituting finite difference approximation for derivatives, we get

( )

( ( ))

( ( ))

By applying this formula at each mesh point, we will get similar equations in the pivotal
values . These equations can be solved by iteration techniques. The error in this method
is of order ( ).

Example #5:-
Solve the Poisson equation ( ), over the squaremesh with sides
and with on the boundary and mesh length unit.

( ) = ( )

( ) ( )

The Poisson equation is given by:

Dr. Jamil Book Series 1 Page 18


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( )

( )

( ) ( )

The standard formula for Poisson equation is given by:

( ( ))

( ( ))

Here

( ( )) (1)

1): Equation ( ) at Point ( ) :-

( ) ( )

2): Equation ( ) at Point ( ) :-

( ) ( )

3): Equation ( ) at Point ( ) :-

( ) ( )

4): Equation ( ) at Point ( ) :-

( ) ( )

It is clear that:

For initial values:-

Dr. Jamil Book Series 1 Page 19


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( ) ( )
( )

( )
( )

( )
( )

Conversion into gauss-seidel system:-


( ) ( ) ( ) ( )
( )

( ) ( )
( )

( ) ( )
( )

Now we make a table as:

“Table of values”

( ) ( ) ( )

Hence the required values are:

Dr. Jamil Book Series 1 Page 20


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Example #6:-
Solve , for square mesh with on the boundary dividing the square into
sub-square of length unit.

Solution:-
The Poisson equation is given by:

( )

Since and boundary condition are symmetrical about axes and the line , we
have

We need to find only. The standard formula for Poisson equation is given by:

( ( ))

( )

Here

( ) (1)

Dr. Jamil Book Series 1 Page 21


Applied Numerical Methods CH#6 Numerical PDE & Optimization

1): Equation ( ) at Point ( ) :-

( ( ) ( ) )

(2)

2): Equation ( ) at Point ( ) :-

( ( ) ( ) )

(3)

3): Equation ( ) at Origin ( ) :-

( ( ) ( ) )

(4)

From equation ( ) and ( ), we have and , substitute in ( ), we get:

Hence the required values are:

Dr. Jamil Book Series 1 Page 22


Applied Numerical Methods CH#6 Numerical PDE & Optimization

PART – II: OPTIMIZATION


Linear programming (Simplex Method)
7.2.1 Introduction:-
Linear programming is an extremely efficient algorithm developed by Danzing in 1940s, to
optimize (maximize or minimize) a real valued linear function of several real variable
subject to a number of constraints expressed in the form of linear inequalities or linear
equations. In engineering, our aim is always to get the best out of a system. We desire to
obtain maximum amount of product with minimum cost of the process involved. Such
problems of optimization occur in an expensive area s in engineering fields such as steel
industries, chemical industries, and space industries. Linear programming provides
satisfactory solutions to such problems.
7.2.2 Linear Programming Problem (LPP):-
A problem involving linear programming in its solution is called a linear programming
problem, generally written as LPP.
A general LPP with variable and in constraints can be expressed in the following way:
Optimize:

Subject to constraints:

( )

( )

…………………………………………….
…………………………………………….
…………………………………………….

( )

and

1): Objective Function:-


The linear function , which is to be optimized, is called the objective function of the LPP.
2): Decision or structural variables:-
The variables involved in LPP are called decision or structural variables.
3): Constraints of LPP:-
The equations or inequalities ( ) with one of the signs( )are called the constraints of
the LPP. The inequalities ( ) represent the set of non-negative restrictions of the LPP.

Dr. Jamil Book Series 1 Page 23


Applied Numerical Methods CH#6 Numerical PDE & Optimization

4): Constants and Technological Constants:-


The constants represent the contribution to the objective function
by respectively. The constants are the constants representing the
availability of the constraints. The coefficient , , are called
technological constants.
5): Feasible Region:-
If the inequalities/equalities in an LPP are plotted as a graph, then the area for which all
the inequalities/equalities are satisfied is called the feasible region.
6): Solution of LPP:-
A set of values of the decisions variables which satisfy all the constraints of an LLP is called
a solution of that LPP.
7): Feasible Solution:-
A solution of an LPP that also satisfies the non-negativity restrictions of the problem is
called a feasible solution to that problem.
8): Optimal Solution and Optimal Value:-
Any feasible solutions which optimize (maximize or minimize) the objective function of an
LPP is called on optimal (or optimum) solution of the LPP. The value of the objective
function at an optimal solution is called on optimal value.

7.2.3 Simplex Method:-


Introduction:-
Simplex method is an iterative procedure for solving LPP in a finite number of steps. This
method provides an algorithm which consists of moving from one vertex of the region of
feasible solution to another in such a manner that the value of the objective function of the
succeeding vertex is less or more as the case may be than at the previous vertex. This
procedure is repeated and since the number of vertices is finite, the method leads to an
optimal vertex in a finite number of steps or indicates the existence of unbounded solution.
Consider the LPP:
Maximize:

Subject to constraints:

…………………………………………………
…………………………………………………

Dr. Jamil Book Series 1 Page 24


Applied Numerical Methods CH#6 Numerical PDE & Optimization

and

If are slack variables, then the standard table for this problem is:

Then the simplex algorithm is:


7.2.4 Simplex Method Algorithm:-
Step-1: (Identify optimal column ):-
Choose the most negative value in the row, say – in case all entries are non-negative,
then the maximum has been achieved.
Step-2: (Identify PivotRow ):-
Determine ratios .

Choose the minimum ratio, say . Then row is the pivot row and is the pivot
element.
Step-3: (Change the Basic Variables):-
Replace the basic variable in the left-hand columnby .
Step-4: (Reduce Pivot to ):-
In row replace by for

Step-5: (Gaussian-Elimination):-
Using Gaussian elimination, annihilate the column except the pivot. The algorithm is
repeated until at step-1, the maximum is achieved.
Remark:-
1):In case we proceed without taking negative of the coefficient in objective function in
the initial table, then we have to take negative of the optimal solution in row. The
process is stopped when all entries in row become non-positive.

Dr. Jamil Book Series 1 Page 25


Applied Numerical Methods CH#6 Numerical PDE & Optimization

2):One exception occurs at step-2 above, when all the , in the optimal column
are zero or negative and it becomes impossible to identify the row to continue the
method. The feasible region in this case is unbounded and so the solution is unbounded.

Example # 1:-
Find the maximum of:
Subject to constraints:

and
Solution:-
Introducing the slack variable, the standard form of the given LPP is:
Maximize: :
Subject to:

and
Then the basic feasible solution are

, , , and

Therefore the standard (initial) tableau for this LPP is:

-10


5 20

The most negative value in the row is . Therefore, we have marked the column
containing this element. Since minimum ratio lies is the row, the Pivot element is .
Marking the Pivot equal to and replacing by . We get the following table:

Dr. Jamil Book Series 1 Page 26


Applied Numerical Methods CH#6 Numerical PDE & Optimization

⁄ ⁄

Applying , , , we get

⁄ ⁄

⁄ ⁄

⁄ ⁄

Since all the entries in row are non-negative the required solution is:

, and

Example # 2:-
Use the simplex method to solve the problem:
Maximize:
Subject to:

and
Solution:-
Introducing the slack variables, the standard form of the given LPP is:
Maximize:
Subject to:

and
Then the basic feasible solution is:

, ,

Dr. Jamil Book Series 1 Page 27


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Therefore the initial basic feasible solution table is:

-3

3 2/3

The most negative value in the row is which lies in column. Thus the key column
is column. The minimum positive ratio lies in row. Therefore, the Pivot element is
and the Pivotal row is row. We divide the Pivotal row throughout by so that Pivot
becomes . We replace by in the left column and perform row operation as:

Applying , , , we get:

-4


⁄ ⁄


13/3 ⁄ 11/13

Now the most negative value in the row is . Therefore the Key column is column.
The minimum positive ratio lies in row. Therefore, the Pivot element is ⁄ . We divide
the Pivot row throughout by ⁄ so that Pivot become . Then we replace by in the left
column and perform the following row operation as:

Applying , , , we get:


⁄ ⁄


⁄ ⁄


⁄ ⁄

Since all the entries in row are non-negative, we have achieved the solution. Hence the
solution is:

, , and

Dr. Jamil Book Series 1 Page 28


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Example # 3:-
Use the simplex method to solve the following LPP:
Maximize:
Subject to constraints:

and

Solution:
Introducing the slack variables, the standard form of the LPP is:
Maximize:

Subject to constraints:

and
Therefore the basic feasible solution is:

, ,

Thus, the initial basic feasible solution is shown by the following table:

-3

⁄ 1
2

The most negative value of is . The minimum ratio is . Therefore, pivot element is .
Making pivot equal to , replacing by and annihilating the columnusing row
operation.

Applying , , , we get:

Dr. Jamil Book Series 1 Page 29


Applied Numerical Methods CH#6 Numerical PDE & Optimization

⁄ ⁄

⁄ ⁄

⁄ ⁄

Since all the entries in the row are non-negative, the optimal solution has been achieved.
The optimal solution is:

, , and

Example # 4:-
Use simplex Method to solve the following LPP:
Minimize:
Subject to constraints:

and
Solution:-
We first convert the given problem to the maximization problem by taking:
Maximize:
Subject to constraints:

and

Introducing slack variables, the standard form of the LPP is:


Maximize:
Subject to:

and
Then the basic feasible solution is:

Dr. Jamil Book Series 1 Page 30


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Thus, the initial basic feasible solution is shown by the table:

-3

4 3

The most negative value of is in column and the minimum ratio is in row.
Therefore, Pivot element is . Making the Pivotelement by dividing row throughout
by , replacing by and applying elementary row operation.

Applying we get:


-1/2


3/2 4
⁄ ⁄

⁄ ⁄

Now, the Pivot element is ⁄ . Making it equal to


by dividing throughout by ⁄ , replacing by and using the following elementary row
operations:

Applying

⁄ ⁄ ⁄

⁄ ⁄ ⁄

⁄ ⁄ ⁄

⁄ ⁄

Dr. Jamil Book Series 1 Page 31


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Since all the entries in row are non-negative the solution to the problem is achieved.
Therefore, the solution to the problem is

and

Example # 5:-
Use simplex method to solve the following LPP:
Maximize:
Subject to the constraints:

and
Solution:-
Introducing the slack variables, the standard
Maximize:
Subject to constraints:

and

Then the basic feasible solution is:

Thus, the initial basic feasible solution is shown by the table:

-4

3 4

The most negative value of is shown in column and then the minimum ratio is in
row. Therefore, the Pivot element is . Making the Pivot element by dividing row
throughout by , replacing by and applying elementary row operation to annihilate the
element in column.

Applying we get

Dr. Jamil Book Series 1 Page 32


Applied Numerical Methods CH#6 Numerical PDE & Optimization

⁄ ⁄

⁄ ⁄

The most negative value of is in column but the element – and ⁄ in the optimal
column are both negative and it becomes impossible to identify a row to continue the
method. The region in this case is unbounded. Hence the problem has unbounded solution.
Example # 6:-
Solve the following LPP by simplex method:
Maximize:
Subject to:

and
Solution:-
Introducing the slack variables, the standard form of the given LPP is:
Maximize:
Subject to:

and
Then the basic feasible solution is:

Therefore, the initial basic solution table is:

-1

1 1

Dr. Jamil Book Series 1 Page 33


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Since the coefficient of in column and column are equal, we may choose any of
these columns as the Key column. Let us choose column as the Key column. Then
positive ratio lies with row. Therefore, the Pivot is and Pivotal row is row.
Replacing by and using elementary row operation:
Applying and we get:

The most negative value of is now in column but the coefficients in column are
both negative. Thus, it is impossible to identify a row to continue this process. The region in
this case is unbounded. Hence the LPP has unbounded solution.

Dr. Jamil Book Series 1 Page 34


Applied Numerical Methods CH#6 Numerical PDE & Optimization

7.3 Part-III: Steepest Ascent (Descent) Method:-


7.3.1 Idea:-
Starting from an initial point ( ) find the maximum (minimum) of function of two or
more variable numerically along the steepest direction so that shortest searching time is
required.
7.3.2 Steepest direction:-
Where the directional derivative is maximum i.e., gradient direction .
7.3.3 Directional derivative:-

( )

7.3.4 Gradient in 2D:-

( ) ̂ ̂

7.3.5 Steepest ascent (descent) method:-


1): Start from initial approximation ( )
2): Evaluate gradient at ( )
3): Evaluate directional derivative of ( ) in the direction of gradient till ( )
4): Reevaluate gradient at ( )
5): Finally repeat the process until ( ) is close enough to ( ).

Dr. Jamil Book Series 1 Page 35


Applied Numerical Methods CH#6 Numerical PDE & Optimization

EXCERSICE-7
Part-I: Numerical Partial Differential Equations (NPDE)
Question # 1:-
Solve the Laplace equation and find by Liebmann’s method the values at the
interior lattice in the following diagram.

Answer:-

Question # 2:-
Find by the Liebmann’s method the values at the interior lattice points of a square region
of the harmonic function whose boundary value are as shown in the following figure.
4

Answer:-

Dr. Jamil Book Series 1 Page 36


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Question # 3:-
Solve the Laplace equation for the following mesh with boundary condition.
500

Answer:-

Question # 4:-
Solve the Laplace equation for the following square mesh with boundary
condition:

Answer:-

Question # 5:-
Using the given boundary values, solve the Laplace equation
, at the nodal points of the square grid shown in the figure:

Dr. Jamil Book Series 1 Page 37


Applied Numerical Methods CH#6 Numerical PDE & Optimization

2 3
Answer:-

Question # 6:-
Solve the Laplace equation , for the square mesh withthe boundary values
shown in figure.

Answer:-

correct up to two decimal places.

Question # 7:-
Solve the Laplace equation , in the square region with mesh points and boundary
conditions shown in the figure.

Dr. Jamil Book Series 1 Page 38


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Answer:-

Question # 8:-
Solve Laplace equation , at the internal mesh points of the square region with
the boundary values shown in the figure.

Answer:-

Question # 9:-
Solve , for he square region with the given boundary conditions:

Answer:-

Question # 10:-
Solve the Poisson equation ( ), over the squaremesh with sides
and with on the boundary and mesh length unit.
Answer:-

Dr. Jamil Book Series 1 Page 39


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Question # 11:-
Solve for square mesh given , on theboundarydividing the square into -
sub-square oflength unit.
Answer:-

Question # 12:-
Solve the poission equation , over the squaremesh with sides
and with on the boundary and mesh length unit, correct to two decimal places.
Answer:-

Question # 13:-
Solve the Poisson equation ⁄ , over the square mesh with sides
and with on the boundary and mesh length unit, correct to two decimal
places.
Answer:-

Dr. Jamil Book Series 1 Page 40


Applied Numerical Methods CH#6 Numerical PDE & Optimization

PART-II: OPTIMIZATION
Linear Programming (Simplex method)
Question # 15:-
Find the maximum of:
Subject to the constraints:

and
Answer:-

Question # 16:-
Use simplex method to solve the problem:
Maximize:
Subject to the constraints:

and
Answer:-

Question # 17:-
Use simplex method to solve following LPP:
Maximize:
Subject to the constraints:

and
Answer:-

Question # 18:-
Use simplex method to solve following LPP:
Maximize:

Dr. Jamil Book Series 1 Page 41


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Subject to the constraints:

and
Answer:-

Question # 19:-
Use simplex method to solve following LPP:
Maximize:
Subject to the constraints:

and
Answer:-
Unbounded solution

Question # 20:-
Solve the following LPP by simplex method:
Maximize:
Subject to the constraints:

and
Answer:-
Unbounded Solution

Question # 21:-
Maximize:
Subject to the constraints:

and
Answer:-

Dr. Jamil Book Series 1 Page 42


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Question # 22:-
Maximize:
Subject to the constraints:

and
Answer:-

Question # 23:-
Maximize:
Subject to the constraints:

and
Answer:-

Question # 24:-
Maximize:
Subject to the constraints:

and
Answer:-

Question # 25:-
Maximize:
Subject to the constraints:

Answer:-

Dr. Jamil Book Series 1 Page 43


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Question # 26:-
Maximize:
Subject to the constraints:

and
Answer:-

Question # 27:-
Maximize:
Subject to the constraints:

and
Answer:-

Question # 28:-
Maximize:
Subject to the constraints:

and
Answer:-

Question #29:-
Maximize:
Subject to the constraints:

Dr. Jamil Book Series 1 Page 44


Applied Numerical Methods CH#6 Numerical PDE & Optimization

and
Answer:-

Question # 30:-
Minimize:
Subject to the constraints:

and
Answer:-

Dr. Jamil Book Series 1 Page 45


Applied Numerical Methods CH#6 Numerical PDE & Optimization

SUMMARY
Part-I: Numerical Partial Differential Equations (PDE)
Classification of PDE:-
The most general form of linear PDE of the second order in two independent variable is:

(1)

OR
(2)

Where A, B, C, D, E, F are in general functions of and . The equation ( ) and( )of 2nd
order PDE is classified as:

1):Elliptic if
2):Parabolic if
3):Hyperbolic if

2): Elliptic equation:-


a): The Laplace equation is given by:

Or

b): The Poisson equation is given by:

( ) Or ( )

3): Parabolic equation:-


The one dimensional heat equation is given by:

4): Hyperbolic Equation:-


The one dimensional wave equation is given by:

Dr. Jamil Book Series 1 Page 46


Applied Numerical Methods CH#6 Numerical PDE & Optimization

5): Finite Difference Method (FDM):-


In this method if the function and its derivatives were single value, finite and continuous
functions and their derivates are discrete points. Thus we have:

( ) ( )
( ) [Forward Difference]

( ) ( )
( ) [Backward Difference]

( ) ( ) ( )
( )

( ) ( )
( ) [Forward Difference]

( ) ( )
( ) [Backward Difference]

( ) ( ) ( )
( )

6): Laplace Equation:-


1):Standard five point formula (SFPF):-
The most important type of elliptic equation is Laplace equation that is

Or

Approximating the derivatives by difference expression, we get:

If we consider square mesh and ,then

( ) (SFPF)

Dr. Jamil Book Series 1 Page 47


Applied Numerical Methods CH#6 Numerical PDE & Optimization

( ) (SFPF)

That is the value of at any interior point is the arithmetic mean of the values of at the
four lattice points. This is called standard five point formula (SFPF).

2):Diagonal five point formula (DFPF):-


Instead of the (SFPF). We can also use the formula:

( ) (DFPF)

( ) (DFPF)

Which is called the diagonal five point formula (DFPF).This formula is valid from the fact
that the Laplace equation is invariant when the coordinate axes are rotated through an
angle of .
7): Poisson equation:-
Poisson equation is of the form:

( ) Or ( )

It is also an elliptic equation. Taking (here of course ) and substituting


finite difference approximation for derivatives,we get

( )

( ( ))

By applying this formula at each mesh point, we will get similar equations in the pivotal
values . These equations can be solved by iteration techniques. The error in this method
is of order ( ).

Dr. Jamil Book Series 1 Page 48


Applied Numerical Methods CH#6 Numerical PDE & Optimization

Part-II: Optimization
8): Linear Programming Problem(Simplex Method):-
A problem involving linear programming in its solution is called a linear programming
problem, generally written as LPP.
A general LPP with variable and in constraints can be expressed in the following way:
Optimize:

Subject to constraints:

( )

( )
……………………………………………
……………………………………………

( )

and

9): Simplex Method:-


Consider the LPP:
Maximize:
Subject to constraints:

( )

( )
……………………………………………
……………………………………………

( )

and

Dr. Jamil Book Series 1 Page 49


Applied Numerical Methods CH#6 Numerical PDE & Optimization

10): Simplex Method Algorithm:-

Step-1: (Identify optimal column ):-

Step-2: (Identify Pivot Row ):-

Step-3: (Change the Basic Variables):-

Step-4: (Reduce Pivot to ):-

Step-5: (Gaussian-Elimination):-

Part-III: Steepest Ascent (Descent) Method


Starting from an initial point ( ) find the maximum (minimum) of function of two or
more variable numerically along the steepest direction so that shortest searching time is
required.
1): Steepest direction:-
Where the directional derivative is maximum i.e., gradient direction .
2): Directional derivative:-

( )

3): Gradient in 2D:-

( ) ̂ ̂

12) Steepest ascent (descent) method:-


1): Start from initial approximation ( )
2): Evaluate gradient at ( )
3): Evaluate directional derivative of ( ) in the direction of gradient till ( )
4): Reevaluate gradient at ( )
5): Finally repeat the process until ( ) is close enough to ( ).

Dr. Jamil Book Series 1 Page 50

You might also like