+ All Categories
Home > Documents > ANN Based pH Control Report

ANN Based pH Control Report

Date post: 19-Jul-2015
Category:
Upload: sumit-gupta
View: 33 times
Download: 0 times
Share this document with a friend
36
 1 A REPORT ON ANN Based pH Control Under the partial fulfilment of course SUBMITTED BY SUMIT GUPTA 2 9A8PS29 P  MALIK BULBUL SINGH 2 9A8PS293P  RAGHAV SUBRAMANIAN 2 9A8PS294P SUBMITTED TO Dr. SUREKHA BHANOT Professor Department of Electronics and Instrumentation Engineering BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE PILANI 04 APRIL 2012 
Transcript
Page 1: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 136

1

A REPORT ON

ANN Based pH Control

Under the partial fulfilment of course

SUBMITTED BY

SUMIT GUPTA 2009A8PS290P

MALIK BULBUL SINGH 2009A8PS293P

RAGHAV SUBRAMANIAN 2009A8PS294P

SUBMITTED TO

Dr SUREKHA BHANOT

Professor

Department of Electronics and Instrumentation Engineering

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE PILANI

04 APRIL 2012

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 236

2

ACKNOWLEDGEMENT

We sincerely thank Prof Surekha Bhanot Instructor in-charge INSTR C312 for

giving us this opportunity of gaining an experience in mathematical modeling

using MATLAB based Artificial Neural Networks We would also like to express

our deep sense of gratitude to Dr Surekha Bhanot for her valuable suggestions

and advice without which this report would not have been possible We are alsograteful to Mr Parikshit K Singh and Mr Rajesh Purohit tutorial instructors for

providing us with a clear understanding of the subject The vote of thanks will be

incomplete without the mention of seniors and our friends who have helped us in

making this project successful

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 336

3

TABLE OF CONTENTS

TOPIC Page No

Abstract 4

Introduction 5

Process Description and Modelling 8

Conclusion

References

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 436

4

ABSTRACT

This report aims at the modeling of pH neutralization process

which is a very important process in the chemical industry and

implementing servo control for the pH neutralization process in a CSTH

The dynamic behavior of neutralization process in (CSTR) was studied

and the process control was implemented using different control

strategies Neural Network (NARMA-L2 NN Predictive) control for

neutralization of weak acid with a strong acid (NaOH)

The report has been broadly divided into three parts where the

first part deals with the process modeling of the pH neutralization of a

weak acid with a strong base in CSTH and the derivation of the

mathematical model for the process The second part deals with ANN

(Artificial neural network) its evolution over the period of time its

basic understanding its various applications The third and the last

part deals with different control strategies that are available and have

been implemented till now for various process models specifically pH

neutralization process And the control methods that we have

implemented using Simulink and neural network toolbox which provide

NARMA-L2 NN Predictive controllers which can be trained as per the

model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 536

5

INTRODUCTION

The precise control of pH is vital in many processes Some of the

applications that require a precise control of pH are in the areas of wastewater treatment pharmaceuticals biotechnology and chemical

processing Wastewater treatment is especially difficult since it is

necessary for the effluent stream to remain neutral to prevent

corrosion to protect aquatic life or to provide neutral water for reuse

as process water or as boiler feed

In bioreactors the control of pH is important to support cell

growth In the production of pharmaceuticals a tight control of pH iscritical to maintain the quality of the products The control of pH has

long been recognized as a difficult problem The difficulties arise due to

frequent changes in the influent composition and the severe process

non-linearities The process non-linearity can be expressed as a S-

shaped static pH response (see Fig 1)

Several approaches have been suggested in the past to handle

non-linear aspects of pH control Some of these methods are genericmodel control internal model control reaction invariant control and

gain scheduled PI control The use of an adaptive control scheme may

at first seem to be the appropriate choice for the control of a pH

neutralization process as shown in many studies However satisfactory

long-term control behavior was not obtained for the continuous

running of an adaptive control scheme At times the use of adaptive

control scheme has resulted in a change of sign of the process model

such that the valve is driven to saturation

Due to this the adaptation is usually turned off when unusual pH

responses are observed Despite the many other advances in non-linear

control theory gain scheduled PI control remains the preferred choice

for the industries

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 636

6

In the standard gain scheduled control schemes the gains

selection for the PI controller is dependent on the current pH in the

continuous stirred tank reactor (CSTR) As the pH in the CSTR varies the

gain varies accordingly

In this report use of this control scheme has shown a vast

improvement on the performance of the control system Furthermorethis method does not demand significant computing resources and is

heuristically easy to understand and simple to implement These

characteristics should make this control scheme more appealing to be

put into industrial practice

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 736

7

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 836

8

PROCESS DESCRIPTION AND MODELLING

The practical system under study in this paper is a pH

neutralization system (see Fig 2) The pH is defined as a measure of

acidity or alkalinity of a solution containing water It is mathematically

defined for a dilute solution as the negative decimal logarithm of the

hydrogen ion concentration [H+] in the solution that is

pH = minuslog10[H+] helliphelliphellip (1)

Practical pH processes tends to be very complicated in terms of

variations of the species contained in the influent and the reagent and

the selection of the mixing equipment However there exist several

well known dynamical models accounting for the dominant

characteristics of a pH process in a CSTR The pH neutralization process

presented in this paper was adapted from the dynamical model

presented by McAvoy This model had been derived from first

principles and has been verified by experimental results

The model consists of two parts a dynamical model describing

the flow dynamics of concentrations of the influent compositions intothe CSTR followed by a static non-linearity characterizing the

physiochemical equilibrium conditions between these concentrations

Assuming that the pH neutralization process has two inlet streams the

first inlet stream contains an acid of concentration C 1 with a flow rate

of F 1 and the second inlet stream contains base with concentration C 2

and flow rate of F 2 The dynamic model for the CSTR is then given as

V = F 1C 1 minus (F 1 + F 2 ) ξ helliphelliphelliphelliphellip (2)

V

= F 2C 2 minus (F 1 + F 2 ) ζ helliphelliphelliphelliphelliphellip (3)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 936

9

where the constant v is the volume of the content in the reactor

and ξ and ζ the concentrations of the acid and the base respectively

These equations describe how the concentrations vary dynamically

with time subject to the input streams F 1 and F 2 To obtain the pH in the

effluent stream a relation between instantaneous concentrations ξ and

ζ is needed

This relationship can be described as a non-linear algebraicequation known as the titration curve Depending on the chemical

species used the titration curve varies In this paper we consider the

case of a weak acid neutralized by a strong base Nominal process

operating conditions are provided in Table 1 Consider an acetic acid

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 2: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 236

2

ACKNOWLEDGEMENT

We sincerely thank Prof Surekha Bhanot Instructor in-charge INSTR C312 for

giving us this opportunity of gaining an experience in mathematical modeling

using MATLAB based Artificial Neural Networks We would also like to express

our deep sense of gratitude to Dr Surekha Bhanot for her valuable suggestions

and advice without which this report would not have been possible We are alsograteful to Mr Parikshit K Singh and Mr Rajesh Purohit tutorial instructors for

providing us with a clear understanding of the subject The vote of thanks will be

incomplete without the mention of seniors and our friends who have helped us in

making this project successful

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 336

3

TABLE OF CONTENTS

TOPIC Page No

Abstract 4

Introduction 5

Process Description and Modelling 8

Conclusion

References

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 436

4

ABSTRACT

This report aims at the modeling of pH neutralization process

which is a very important process in the chemical industry and

implementing servo control for the pH neutralization process in a CSTH

The dynamic behavior of neutralization process in (CSTR) was studied

and the process control was implemented using different control

strategies Neural Network (NARMA-L2 NN Predictive) control for

neutralization of weak acid with a strong acid (NaOH)

The report has been broadly divided into three parts where the

first part deals with the process modeling of the pH neutralization of a

weak acid with a strong base in CSTH and the derivation of the

mathematical model for the process The second part deals with ANN

(Artificial neural network) its evolution over the period of time its

basic understanding its various applications The third and the last

part deals with different control strategies that are available and have

been implemented till now for various process models specifically pH

neutralization process And the control methods that we have

implemented using Simulink and neural network toolbox which provide

NARMA-L2 NN Predictive controllers which can be trained as per the

model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 536

5

INTRODUCTION

The precise control of pH is vital in many processes Some of the

applications that require a precise control of pH are in the areas of wastewater treatment pharmaceuticals biotechnology and chemical

processing Wastewater treatment is especially difficult since it is

necessary for the effluent stream to remain neutral to prevent

corrosion to protect aquatic life or to provide neutral water for reuse

as process water or as boiler feed

In bioreactors the control of pH is important to support cell

growth In the production of pharmaceuticals a tight control of pH iscritical to maintain the quality of the products The control of pH has

long been recognized as a difficult problem The difficulties arise due to

frequent changes in the influent composition and the severe process

non-linearities The process non-linearity can be expressed as a S-

shaped static pH response (see Fig 1)

Several approaches have been suggested in the past to handle

non-linear aspects of pH control Some of these methods are genericmodel control internal model control reaction invariant control and

gain scheduled PI control The use of an adaptive control scheme may

at first seem to be the appropriate choice for the control of a pH

neutralization process as shown in many studies However satisfactory

long-term control behavior was not obtained for the continuous

running of an adaptive control scheme At times the use of adaptive

control scheme has resulted in a change of sign of the process model

such that the valve is driven to saturation

Due to this the adaptation is usually turned off when unusual pH

responses are observed Despite the many other advances in non-linear

control theory gain scheduled PI control remains the preferred choice

for the industries

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 636

6

In the standard gain scheduled control schemes the gains

selection for the PI controller is dependent on the current pH in the

continuous stirred tank reactor (CSTR) As the pH in the CSTR varies the

gain varies accordingly

In this report use of this control scheme has shown a vast

improvement on the performance of the control system Furthermorethis method does not demand significant computing resources and is

heuristically easy to understand and simple to implement These

characteristics should make this control scheme more appealing to be

put into industrial practice

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 736

7

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 836

8

PROCESS DESCRIPTION AND MODELLING

The practical system under study in this paper is a pH

neutralization system (see Fig 2) The pH is defined as a measure of

acidity or alkalinity of a solution containing water It is mathematically

defined for a dilute solution as the negative decimal logarithm of the

hydrogen ion concentration [H+] in the solution that is

pH = minuslog10[H+] helliphelliphellip (1)

Practical pH processes tends to be very complicated in terms of

variations of the species contained in the influent and the reagent and

the selection of the mixing equipment However there exist several

well known dynamical models accounting for the dominant

characteristics of a pH process in a CSTR The pH neutralization process

presented in this paper was adapted from the dynamical model

presented by McAvoy This model had been derived from first

principles and has been verified by experimental results

The model consists of two parts a dynamical model describing

the flow dynamics of concentrations of the influent compositions intothe CSTR followed by a static non-linearity characterizing the

physiochemical equilibrium conditions between these concentrations

Assuming that the pH neutralization process has two inlet streams the

first inlet stream contains an acid of concentration C 1 with a flow rate

of F 1 and the second inlet stream contains base with concentration C 2

and flow rate of F 2 The dynamic model for the CSTR is then given as

V = F 1C 1 minus (F 1 + F 2 ) ξ helliphelliphelliphelliphellip (2)

V

= F 2C 2 minus (F 1 + F 2 ) ζ helliphelliphelliphelliphelliphellip (3)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 936

9

where the constant v is the volume of the content in the reactor

and ξ and ζ the concentrations of the acid and the base respectively

These equations describe how the concentrations vary dynamically

with time subject to the input streams F 1 and F 2 To obtain the pH in the

effluent stream a relation between instantaneous concentrations ξ and

ζ is needed

This relationship can be described as a non-linear algebraicequation known as the titration curve Depending on the chemical

species used the titration curve varies In this paper we consider the

case of a weak acid neutralized by a strong base Nominal process

operating conditions are provided in Table 1 Consider an acetic acid

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 3: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 336

3

TABLE OF CONTENTS

TOPIC Page No

Abstract 4

Introduction 5

Process Description and Modelling 8

Conclusion

References

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 436

4

ABSTRACT

This report aims at the modeling of pH neutralization process

which is a very important process in the chemical industry and

implementing servo control for the pH neutralization process in a CSTH

The dynamic behavior of neutralization process in (CSTR) was studied

and the process control was implemented using different control

strategies Neural Network (NARMA-L2 NN Predictive) control for

neutralization of weak acid with a strong acid (NaOH)

The report has been broadly divided into three parts where the

first part deals with the process modeling of the pH neutralization of a

weak acid with a strong base in CSTH and the derivation of the

mathematical model for the process The second part deals with ANN

(Artificial neural network) its evolution over the period of time its

basic understanding its various applications The third and the last

part deals with different control strategies that are available and have

been implemented till now for various process models specifically pH

neutralization process And the control methods that we have

implemented using Simulink and neural network toolbox which provide

NARMA-L2 NN Predictive controllers which can be trained as per the

model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 536

5

INTRODUCTION

The precise control of pH is vital in many processes Some of the

applications that require a precise control of pH are in the areas of wastewater treatment pharmaceuticals biotechnology and chemical

processing Wastewater treatment is especially difficult since it is

necessary for the effluent stream to remain neutral to prevent

corrosion to protect aquatic life or to provide neutral water for reuse

as process water or as boiler feed

In bioreactors the control of pH is important to support cell

growth In the production of pharmaceuticals a tight control of pH iscritical to maintain the quality of the products The control of pH has

long been recognized as a difficult problem The difficulties arise due to

frequent changes in the influent composition and the severe process

non-linearities The process non-linearity can be expressed as a S-

shaped static pH response (see Fig 1)

Several approaches have been suggested in the past to handle

non-linear aspects of pH control Some of these methods are genericmodel control internal model control reaction invariant control and

gain scheduled PI control The use of an adaptive control scheme may

at first seem to be the appropriate choice for the control of a pH

neutralization process as shown in many studies However satisfactory

long-term control behavior was not obtained for the continuous

running of an adaptive control scheme At times the use of adaptive

control scheme has resulted in a change of sign of the process model

such that the valve is driven to saturation

Due to this the adaptation is usually turned off when unusual pH

responses are observed Despite the many other advances in non-linear

control theory gain scheduled PI control remains the preferred choice

for the industries

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 636

6

In the standard gain scheduled control schemes the gains

selection for the PI controller is dependent on the current pH in the

continuous stirred tank reactor (CSTR) As the pH in the CSTR varies the

gain varies accordingly

In this report use of this control scheme has shown a vast

improvement on the performance of the control system Furthermorethis method does not demand significant computing resources and is

heuristically easy to understand and simple to implement These

characteristics should make this control scheme more appealing to be

put into industrial practice

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 736

7

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 836

8

PROCESS DESCRIPTION AND MODELLING

The practical system under study in this paper is a pH

neutralization system (see Fig 2) The pH is defined as a measure of

acidity or alkalinity of a solution containing water It is mathematically

defined for a dilute solution as the negative decimal logarithm of the

hydrogen ion concentration [H+] in the solution that is

pH = minuslog10[H+] helliphelliphellip (1)

Practical pH processes tends to be very complicated in terms of

variations of the species contained in the influent and the reagent and

the selection of the mixing equipment However there exist several

well known dynamical models accounting for the dominant

characteristics of a pH process in a CSTR The pH neutralization process

presented in this paper was adapted from the dynamical model

presented by McAvoy This model had been derived from first

principles and has been verified by experimental results

The model consists of two parts a dynamical model describing

the flow dynamics of concentrations of the influent compositions intothe CSTR followed by a static non-linearity characterizing the

physiochemical equilibrium conditions between these concentrations

Assuming that the pH neutralization process has two inlet streams the

first inlet stream contains an acid of concentration C 1 with a flow rate

of F 1 and the second inlet stream contains base with concentration C 2

and flow rate of F 2 The dynamic model for the CSTR is then given as

V = F 1C 1 minus (F 1 + F 2 ) ξ helliphelliphelliphelliphellip (2)

V

= F 2C 2 minus (F 1 + F 2 ) ζ helliphelliphelliphelliphelliphellip (3)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 936

9

where the constant v is the volume of the content in the reactor

and ξ and ζ the concentrations of the acid and the base respectively

These equations describe how the concentrations vary dynamically

with time subject to the input streams F 1 and F 2 To obtain the pH in the

effluent stream a relation between instantaneous concentrations ξ and

ζ is needed

This relationship can be described as a non-linear algebraicequation known as the titration curve Depending on the chemical

species used the titration curve varies In this paper we consider the

case of a weak acid neutralized by a strong base Nominal process

operating conditions are provided in Table 1 Consider an acetic acid

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 4: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 436

4

ABSTRACT

This report aims at the modeling of pH neutralization process

which is a very important process in the chemical industry and

implementing servo control for the pH neutralization process in a CSTH

The dynamic behavior of neutralization process in (CSTR) was studied

and the process control was implemented using different control

strategies Neural Network (NARMA-L2 NN Predictive) control for

neutralization of weak acid with a strong acid (NaOH)

The report has been broadly divided into three parts where the

first part deals with the process modeling of the pH neutralization of a

weak acid with a strong base in CSTH and the derivation of the

mathematical model for the process The second part deals with ANN

(Artificial neural network) its evolution over the period of time its

basic understanding its various applications The third and the last

part deals with different control strategies that are available and have

been implemented till now for various process models specifically pH

neutralization process And the control methods that we have

implemented using Simulink and neural network toolbox which provide

NARMA-L2 NN Predictive controllers which can be trained as per the

model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 536

5

INTRODUCTION

The precise control of pH is vital in many processes Some of the

applications that require a precise control of pH are in the areas of wastewater treatment pharmaceuticals biotechnology and chemical

processing Wastewater treatment is especially difficult since it is

necessary for the effluent stream to remain neutral to prevent

corrosion to protect aquatic life or to provide neutral water for reuse

as process water or as boiler feed

In bioreactors the control of pH is important to support cell

growth In the production of pharmaceuticals a tight control of pH iscritical to maintain the quality of the products The control of pH has

long been recognized as a difficult problem The difficulties arise due to

frequent changes in the influent composition and the severe process

non-linearities The process non-linearity can be expressed as a S-

shaped static pH response (see Fig 1)

Several approaches have been suggested in the past to handle

non-linear aspects of pH control Some of these methods are genericmodel control internal model control reaction invariant control and

gain scheduled PI control The use of an adaptive control scheme may

at first seem to be the appropriate choice for the control of a pH

neutralization process as shown in many studies However satisfactory

long-term control behavior was not obtained for the continuous

running of an adaptive control scheme At times the use of adaptive

control scheme has resulted in a change of sign of the process model

such that the valve is driven to saturation

Due to this the adaptation is usually turned off when unusual pH

responses are observed Despite the many other advances in non-linear

control theory gain scheduled PI control remains the preferred choice

for the industries

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 636

6

In the standard gain scheduled control schemes the gains

selection for the PI controller is dependent on the current pH in the

continuous stirred tank reactor (CSTR) As the pH in the CSTR varies the

gain varies accordingly

In this report use of this control scheme has shown a vast

improvement on the performance of the control system Furthermorethis method does not demand significant computing resources and is

heuristically easy to understand and simple to implement These

characteristics should make this control scheme more appealing to be

put into industrial practice

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 736

7

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 836

8

PROCESS DESCRIPTION AND MODELLING

The practical system under study in this paper is a pH

neutralization system (see Fig 2) The pH is defined as a measure of

acidity or alkalinity of a solution containing water It is mathematically

defined for a dilute solution as the negative decimal logarithm of the

hydrogen ion concentration [H+] in the solution that is

pH = minuslog10[H+] helliphelliphellip (1)

Practical pH processes tends to be very complicated in terms of

variations of the species contained in the influent and the reagent and

the selection of the mixing equipment However there exist several

well known dynamical models accounting for the dominant

characteristics of a pH process in a CSTR The pH neutralization process

presented in this paper was adapted from the dynamical model

presented by McAvoy This model had been derived from first

principles and has been verified by experimental results

The model consists of two parts a dynamical model describing

the flow dynamics of concentrations of the influent compositions intothe CSTR followed by a static non-linearity characterizing the

physiochemical equilibrium conditions between these concentrations

Assuming that the pH neutralization process has two inlet streams the

first inlet stream contains an acid of concentration C 1 with a flow rate

of F 1 and the second inlet stream contains base with concentration C 2

and flow rate of F 2 The dynamic model for the CSTR is then given as

V = F 1C 1 minus (F 1 + F 2 ) ξ helliphelliphelliphelliphellip (2)

V

= F 2C 2 minus (F 1 + F 2 ) ζ helliphelliphelliphelliphelliphellip (3)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 936

9

where the constant v is the volume of the content in the reactor

and ξ and ζ the concentrations of the acid and the base respectively

These equations describe how the concentrations vary dynamically

with time subject to the input streams F 1 and F 2 To obtain the pH in the

effluent stream a relation between instantaneous concentrations ξ and

ζ is needed

This relationship can be described as a non-linear algebraicequation known as the titration curve Depending on the chemical

species used the titration curve varies In this paper we consider the

case of a weak acid neutralized by a strong base Nominal process

operating conditions are provided in Table 1 Consider an acetic acid

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 5: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 536

5

INTRODUCTION

The precise control of pH is vital in many processes Some of the

applications that require a precise control of pH are in the areas of wastewater treatment pharmaceuticals biotechnology and chemical

processing Wastewater treatment is especially difficult since it is

necessary for the effluent stream to remain neutral to prevent

corrosion to protect aquatic life or to provide neutral water for reuse

as process water or as boiler feed

In bioreactors the control of pH is important to support cell

growth In the production of pharmaceuticals a tight control of pH iscritical to maintain the quality of the products The control of pH has

long been recognized as a difficult problem The difficulties arise due to

frequent changes in the influent composition and the severe process

non-linearities The process non-linearity can be expressed as a S-

shaped static pH response (see Fig 1)

Several approaches have been suggested in the past to handle

non-linear aspects of pH control Some of these methods are genericmodel control internal model control reaction invariant control and

gain scheduled PI control The use of an adaptive control scheme may

at first seem to be the appropriate choice for the control of a pH

neutralization process as shown in many studies However satisfactory

long-term control behavior was not obtained for the continuous

running of an adaptive control scheme At times the use of adaptive

control scheme has resulted in a change of sign of the process model

such that the valve is driven to saturation

Due to this the adaptation is usually turned off when unusual pH

responses are observed Despite the many other advances in non-linear

control theory gain scheduled PI control remains the preferred choice

for the industries

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 636

6

In the standard gain scheduled control schemes the gains

selection for the PI controller is dependent on the current pH in the

continuous stirred tank reactor (CSTR) As the pH in the CSTR varies the

gain varies accordingly

In this report use of this control scheme has shown a vast

improvement on the performance of the control system Furthermorethis method does not demand significant computing resources and is

heuristically easy to understand and simple to implement These

characteristics should make this control scheme more appealing to be

put into industrial practice

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 736

7

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 836

8

PROCESS DESCRIPTION AND MODELLING

The practical system under study in this paper is a pH

neutralization system (see Fig 2) The pH is defined as a measure of

acidity or alkalinity of a solution containing water It is mathematically

defined for a dilute solution as the negative decimal logarithm of the

hydrogen ion concentration [H+] in the solution that is

pH = minuslog10[H+] helliphelliphellip (1)

Practical pH processes tends to be very complicated in terms of

variations of the species contained in the influent and the reagent and

the selection of the mixing equipment However there exist several

well known dynamical models accounting for the dominant

characteristics of a pH process in a CSTR The pH neutralization process

presented in this paper was adapted from the dynamical model

presented by McAvoy This model had been derived from first

principles and has been verified by experimental results

The model consists of two parts a dynamical model describing

the flow dynamics of concentrations of the influent compositions intothe CSTR followed by a static non-linearity characterizing the

physiochemical equilibrium conditions between these concentrations

Assuming that the pH neutralization process has two inlet streams the

first inlet stream contains an acid of concentration C 1 with a flow rate

of F 1 and the second inlet stream contains base with concentration C 2

and flow rate of F 2 The dynamic model for the CSTR is then given as

V = F 1C 1 minus (F 1 + F 2 ) ξ helliphelliphelliphelliphellip (2)

V

= F 2C 2 minus (F 1 + F 2 ) ζ helliphelliphelliphelliphelliphellip (3)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 936

9

where the constant v is the volume of the content in the reactor

and ξ and ζ the concentrations of the acid and the base respectively

These equations describe how the concentrations vary dynamically

with time subject to the input streams F 1 and F 2 To obtain the pH in the

effluent stream a relation between instantaneous concentrations ξ and

ζ is needed

This relationship can be described as a non-linear algebraicequation known as the titration curve Depending on the chemical

species used the titration curve varies In this paper we consider the

case of a weak acid neutralized by a strong base Nominal process

operating conditions are provided in Table 1 Consider an acetic acid

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 6: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 636

6

In the standard gain scheduled control schemes the gains

selection for the PI controller is dependent on the current pH in the

continuous stirred tank reactor (CSTR) As the pH in the CSTR varies the

gain varies accordingly

In this report use of this control scheme has shown a vast

improvement on the performance of the control system Furthermorethis method does not demand significant computing resources and is

heuristically easy to understand and simple to implement These

characteristics should make this control scheme more appealing to be

put into industrial practice

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 736

7

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 836

8

PROCESS DESCRIPTION AND MODELLING

The practical system under study in this paper is a pH

neutralization system (see Fig 2) The pH is defined as a measure of

acidity or alkalinity of a solution containing water It is mathematically

defined for a dilute solution as the negative decimal logarithm of the

hydrogen ion concentration [H+] in the solution that is

pH = minuslog10[H+] helliphelliphellip (1)

Practical pH processes tends to be very complicated in terms of

variations of the species contained in the influent and the reagent and

the selection of the mixing equipment However there exist several

well known dynamical models accounting for the dominant

characteristics of a pH process in a CSTR The pH neutralization process

presented in this paper was adapted from the dynamical model

presented by McAvoy This model had been derived from first

principles and has been verified by experimental results

The model consists of two parts a dynamical model describing

the flow dynamics of concentrations of the influent compositions intothe CSTR followed by a static non-linearity characterizing the

physiochemical equilibrium conditions between these concentrations

Assuming that the pH neutralization process has two inlet streams the

first inlet stream contains an acid of concentration C 1 with a flow rate

of F 1 and the second inlet stream contains base with concentration C 2

and flow rate of F 2 The dynamic model for the CSTR is then given as

V = F 1C 1 minus (F 1 + F 2 ) ξ helliphelliphelliphelliphellip (2)

V

= F 2C 2 minus (F 1 + F 2 ) ζ helliphelliphelliphelliphelliphellip (3)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 936

9

where the constant v is the volume of the content in the reactor

and ξ and ζ the concentrations of the acid and the base respectively

These equations describe how the concentrations vary dynamically

with time subject to the input streams F 1 and F 2 To obtain the pH in the

effluent stream a relation between instantaneous concentrations ξ and

ζ is needed

This relationship can be described as a non-linear algebraicequation known as the titration curve Depending on the chemical

species used the titration curve varies In this paper we consider the

case of a weak acid neutralized by a strong base Nominal process

operating conditions are provided in Table 1 Consider an acetic acid

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 7: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 736

7

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 836

8

PROCESS DESCRIPTION AND MODELLING

The practical system under study in this paper is a pH

neutralization system (see Fig 2) The pH is defined as a measure of

acidity or alkalinity of a solution containing water It is mathematically

defined for a dilute solution as the negative decimal logarithm of the

hydrogen ion concentration [H+] in the solution that is

pH = minuslog10[H+] helliphelliphellip (1)

Practical pH processes tends to be very complicated in terms of

variations of the species contained in the influent and the reagent and

the selection of the mixing equipment However there exist several

well known dynamical models accounting for the dominant

characteristics of a pH process in a CSTR The pH neutralization process

presented in this paper was adapted from the dynamical model

presented by McAvoy This model had been derived from first

principles and has been verified by experimental results

The model consists of two parts a dynamical model describing

the flow dynamics of concentrations of the influent compositions intothe CSTR followed by a static non-linearity characterizing the

physiochemical equilibrium conditions between these concentrations

Assuming that the pH neutralization process has two inlet streams the

first inlet stream contains an acid of concentration C 1 with a flow rate

of F 1 and the second inlet stream contains base with concentration C 2

and flow rate of F 2 The dynamic model for the CSTR is then given as

V = F 1C 1 minus (F 1 + F 2 ) ξ helliphelliphelliphelliphellip (2)

V

= F 2C 2 minus (F 1 + F 2 ) ζ helliphelliphelliphelliphelliphellip (3)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 936

9

where the constant v is the volume of the content in the reactor

and ξ and ζ the concentrations of the acid and the base respectively

These equations describe how the concentrations vary dynamically

with time subject to the input streams F 1 and F 2 To obtain the pH in the

effluent stream a relation between instantaneous concentrations ξ and

ζ is needed

This relationship can be described as a non-linear algebraicequation known as the titration curve Depending on the chemical

species used the titration curve varies In this paper we consider the

case of a weak acid neutralized by a strong base Nominal process

operating conditions are provided in Table 1 Consider an acetic acid

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 8: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 836

8

PROCESS DESCRIPTION AND MODELLING

The practical system under study in this paper is a pH

neutralization system (see Fig 2) The pH is defined as a measure of

acidity or alkalinity of a solution containing water It is mathematically

defined for a dilute solution as the negative decimal logarithm of the

hydrogen ion concentration [H+] in the solution that is

pH = minuslog10[H+] helliphelliphellip (1)

Practical pH processes tends to be very complicated in terms of

variations of the species contained in the influent and the reagent and

the selection of the mixing equipment However there exist several

well known dynamical models accounting for the dominant

characteristics of a pH process in a CSTR The pH neutralization process

presented in this paper was adapted from the dynamical model

presented by McAvoy This model had been derived from first

principles and has been verified by experimental results

The model consists of two parts a dynamical model describing

the flow dynamics of concentrations of the influent compositions intothe CSTR followed by a static non-linearity characterizing the

physiochemical equilibrium conditions between these concentrations

Assuming that the pH neutralization process has two inlet streams the

first inlet stream contains an acid of concentration C 1 with a flow rate

of F 1 and the second inlet stream contains base with concentration C 2

and flow rate of F 2 The dynamic model for the CSTR is then given as

V = F 1C 1 minus (F 1 + F 2 ) ξ helliphelliphelliphelliphellip (2)

V

= F 2C 2 minus (F 1 + F 2 ) ζ helliphelliphelliphelliphelliphellip (3)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 936

9

where the constant v is the volume of the content in the reactor

and ξ and ζ the concentrations of the acid and the base respectively

These equations describe how the concentrations vary dynamically

with time subject to the input streams F 1 and F 2 To obtain the pH in the

effluent stream a relation between instantaneous concentrations ξ and

ζ is needed

This relationship can be described as a non-linear algebraicequation known as the titration curve Depending on the chemical

species used the titration curve varies In this paper we consider the

case of a weak acid neutralized by a strong base Nominal process

operating conditions are provided in Table 1 Consider an acetic acid

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 9: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 936

9

where the constant v is the volume of the content in the reactor

and ξ and ζ the concentrations of the acid and the base respectively

These equations describe how the concentrations vary dynamically

with time subject to the input streams F 1 and F 2 To obtain the pH in the

effluent stream a relation between instantaneous concentrations ξ and

ζ is needed

This relationship can be described as a non-linear algebraicequation known as the titration curve Depending on the chemical

species used the titration curve varies In this paper we consider the

case of a weak acid neutralized by a strong base Nominal process

operating conditions are provided in Table 1 Consider an acetic acid

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 10: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1036

10

(weak acid) denoted by HAC being neutralized by sodium hydroxide

(strong base) denoted by NaOH

The reactions are

H2OhArr H+

+ OHminus

HAC hArr H+

+ ACminus

NaOH rarr Na+

+ OHminus

The electro neutrality condition states that the sum of the charges of allions in the solution must be zero

this is given by

[Na+] + [H

+] = [OH

minus] + [AC

minus] helliphelliphelliphelliphellip (4)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 11: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1136

11

where the symbol [middot] denotes the concentration of its argument

In water where the dissociation is incomplete we define the

dissociation constant of water as

K w = [H+][OH

minus] helliphelliphelliphelliphellip (5)

where K w = 10minus14

is the dissociation constant for water at 25C Similarly

we can define the dissociation of acetic acid as

K a = [ACminus][H

+] helliphelliphelliphelliphelliphellip (6)

[HAC]

where K a = 18 times 10minus5

is the dissociation constant of acetic acid at 25C

Defining the concentrations of ξ and ζ as

ξ = [HAC] + [ACminus] helliphelliphelliphelliphellip (7)

and

ζ = [Na+] helliphelliphelliphelliphelliphelliphellip (8)

we have a set of seven independent equations (Eqs (2) ndash (8)) with

seven unknowns which describes the dynamic behavior of this

neutralization process A more condensed form of the above equations

can be achieved by eliminating [OHminus] using Eq (5) [AC

minus] using Eq (4)

and [HAC] using Eq (6) The resulting are Eqs (2) (3) and (9)

[H+]

3+ (K a + ζ) [H

+]

2+ (K a(ζ minus ξ) minus K w ) [H

+] minus K wK a = 0 helliphelliphelliphelliphelliphellip (9)

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 12: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1236

12

A Simulink model was constructed using this derivation of the

dynamical model to represent the pH neutralization process between

acetic acid and sodium hydroxide (see Fig 3)

Fig 3 Mathematical Model Implementation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 13: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1336

13

Fig4 Model for pH Utilization

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 14: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1436

14

Fig5 Neutralization Curve simulated in Process Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 15: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1536

15

Fig6 Final Control Model

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 16: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1636

16

Fig 7 Model Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 17: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1736

17

Fig8 NN Predictive Controller

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 18: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1836

18

Fig9 Training Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 19: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 1936

19

Fig10 Neural Network and Training Parameters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 20: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2036

20

Fig11 Validation Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 21: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2136

21

Fig12 Simulation using Randomly Varying Set point

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 22: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2236

22

ARTIFICIAL NEURAL NETWORK

Artificial neural networks are inspired by the early models of

sensory processing by the brain An artificial neural network can becreated by simulating a network of model neurons in a computer By

applying algorithms that mimic the processes of real neurons we can

make the network lsquolearnrsquo to solve many types of problems A model

neuron is referred to as a threshold unit and its function is illustrated in

Figure 1a It receives input from a number of other units or external

sources weighs each input and adds them up If the total input is above

a threshold the output of the unit is one otherwise it is zero

Therefore the output changes from 0 to 1

when the total weighted sum of inputs is equal to the threshold

Learning

If the classification problem is separable we still need a way

to set the weights and the threshold such that the threshold unit

correctly solves the classification problem This can be done in an

iterative manner by presenting examples with known classifications

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 23: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2336

23

one after another This process is called learning or training because it

resembles the process we go through when learning something

Simulation of learning by a computer involves making small changes in

the weights and the threshold each time a new example is presented insuch a way that the classification is improved The training can be

implemented by various different algorithms

Back-propagation

Training starts by setting all the weights in the network to small

random numbers Now for each input example the network gives an

output which starts randomly We measure the squared difference

between this output and the desired outputmdashthe correct class or value

The sum of all these numbers over all training examples is called the

total error of the network If this number was zero the network would

be perfect and the smaller the error the better the network

By choosing the weights that minimize the total error one can

obtain the neural network that best solves the problem at hand This isthe same as linear regression where the two parameters characterizing

the line are chosen such that the sum of squared differences between

the line and the data points is minimal In back-propagation the

weights and thresholds are changed each time an example is

presented such that the error gradually becomes smaller This is

repeated often hundreds of times until the error no longer changes

In back-propagation a numerical optimization technique called

gradient descent makes the math particularly simple the form of the

equations gave rise to the name of this method There are some

learning parameters (called learning rate and momentum) that need

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 24: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2436

24

tuning when using back-propagation and there are other problems to

consider For instance gradient descent is not guaranteed to find the

global minimum of the error so the result of the training depends on

the initial values of the weights

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 25: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2536

25

CONTROL SYSTEMS

Control systems are tightly intertwined in our daily lives so much

so that we take them for granted They may be as low tech andunglamorous as our flush toilet Or they may be as high tech as

electronic fuel injection in our cars that we now drive In fact there is

more than a handful of computer control systems in a typical car that

we now drive In everything from the engine to transmission shock

absorber brakes pollutant emission temperature and so forth there

is an embedded microprocessor controller keeping an eye out for us

The more gadgetry the more tiny controllers pulling the trick

behind our backs1 At the lower end of consumer electronic devices

we can bet on finding at least one embedded microcontroller In the

processing industry controllers play a crucial role in keeping our plants

running ndash virtually everything from simply filling up a storage tank to

complex separation processes and chemical reactors

To consider pH as a controlled variable we use a pH electrode to

measure its value and with a transmitter send the signal to a

controller which can be a little black box or a computer The controller

takes in the pH value and compares it with the desired pH what is

called the set point or the reference If the values are not the same

there is an error and the controller makes proper adjustments by

manipulating the acid or the base pump ndash the actuator

The adjustment is based on calculations made with a control

algorithm also called the control law The error is calculated at the

summing point where we take the desired pH minus the measured pH

Because of how we calculate the error this is a negative-feedback

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 26: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2636

26

mechanism When we change a specific operating condition meaning

the set point we would like for example the pH of the bioreactor to

follow our command

This is what we call servo control The pH value of the bioreactor

is subjected to external disturbances (also called load changes) and the

task of suppressing or rejecting the effects of disturbances is called

regulatory control Implementation of a controller may lead to

instability and the issue of system stability is a major concern The

control system also has to be robust such that it is not overly sensitive

to changes in process parameters

Neural Network in Control Systems

Neural networks have been applied successfully in the

identification and control of dynamic systems The universal

approximation capabilities of the multilayer perceptron make it a

popular choice for modeling nonlinear systems and for implementing

general-purpose nonlinear controllers This chapter introduces threepopular neural network architectures for prediction and control that

have been implemented in the Neural Network Toolbox software

Model Predictive Control

NARMA-L2 (or Feedback Linearization) Control

Model Reference Control

This chapter presents brief descriptions of each of these

architectures and demonstrates how you can use them There are

typically two steps involved when using neural networks for control

1 System identification

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 27: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2736

27

2 Control design

In the system identification stage you develop a neural network

model of the plant that you want to control In the control design stage

you use the neural network plant model to design (or train) the

controller In each of the three control architectures described in this

chapter the system identification stage is identical The control design

stage however is different for each architecture

bull For model predictive control the plant model is used to predict futur

behavior of the plant and an optimization algorithm is used to select th

control input that optimizes future performance

bull For NARMA-L2 control the controller is simply a rearrangement of th

plant model

bull For model reference control the controller is a neural network that

trained to control a plant so that it follows a reference model The neura

network plant model is used to assist in the controller training

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 28: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2836

28

Controllers in NNET Toolbox

Model Predictive Control mdash

This controller uses a neural network model to predict future plant

responses to potential control signals An optimization algorithm then

computes the control signals that optimize future plant performance

The neural network plant model is trained offline in batch form using

any of the training algorithms (This is true for all three control

architectures) The controller however requires a significant amount

of online computation because an optimization algorithm is performed

at each sample time to compute the optimal control input

NARMA-L2 Control mdash

This controller requires the least computation of these three

architectures The controller is simply a rearrangement of the neural

network plant model which is trained offline in batch form The only

online computation is a forward pass through the neural network

controller The drawback of this method is that the plant must either be

in companion form or be capable of approximation by a companion

form model

Model Reference Control mdash

The online computation of this controller like NARMA-L2 is

minimal However unlike NARMA-L2 the model reference architecturerequires that a separate neural network controller be trained offline in

addition to the neural network plant model The controller training is

computationally expensive because it requires the use of dynamic back

propagation

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 29: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 2936

29

Fig13 Neural Network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 30: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3036

30

Fig14 Testing Data

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 31: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3136

31

Fig 15 Training Behaviour

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 32: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3236

32

Fig16 Neural Model and its Paramaters

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 33: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3336

33

Fig17 Simulation 1

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 34: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3436

34

Fig18 Simulation 2

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 35: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3536

35

CONCLUSION

The present report represents a simulation programs in MATLAB

language used to study and develop a mathematical model of the

dynamic behavior of neutralization process in a continuous stirred tank

heater (CSTH) and the process control implemented using different

control strategies The following conclusions can be drawn

1 For now the NARMA-L2 controller of NNET toolbox is very fast

relative to the NN predictive model which takes a longer time even in

the simulation

2 NN predictive model is more accurate for the data training that we

have used

3 Volume plays a big role in the control strategy as the increase in

volume decreases the sensitivity of the model hence the NN predictive

model gets more accurate

4 Training for 1000 data sets is enough to train the neural network

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem

Page 36: ANN Based pH Control Report

5172018 ANN Based pH Control Report - slidepdfcom

httpslidepdfcomreaderfullann-based-ph-control-report 3636

36

REFERENCES

Process Control by Prof Surekha Bhanot

What are Artificial Neural Networks by Anders Krogh

wwwmathworkscom

Modified Functional Link Artificial Neural Network by Ashok Kumar

Goel Suresh Chandra Saxena and Surekha Bhanot

Neuro modeling and control strategies for a pH process by

ESivaraman and SArulselvi

Adaptive control of a pH Process by DrKarima M Putrus and

Zahraa F Zihwar

Modified Mathematical Model For Neutralization System In Stirred

Tank Reactor by Ahmmed Saadi Ibrehem


Recommended