Python Notes for mca i year students osmania university.docx
Optimization
1. Dr Kamlesh J. Wadher
Asso Professor
SKB College of Pharmacy, Kamptee
Nagpur
2. It is defined as follows:
Choosing the best element from some set of
available alternatives.
2
3. The term Optimize is defined as “to make perfect”.
It is used in pharmacy relative to formulation and
processing
Involved in formulating drug products in various
forms
It is the process of finding the best way of using
the existing resources while taking in to the
account of all the factors that influences decisions
in any experiment
3
4. Final product not only meets the requirements
from the bio-availability but also from the
practical mass production criteria
Pharmaceutical scientist- to understand
theoretical formulation.
Target processing parameters – ranges for each
excipients & processing factors
4
5. In development projects , one generally
experiments by a series of logical steps, carefully
controlling the variables & changing one at a time,
until a satisfactory system is obtained
It is not a screening technique.
5
8. 8
OPTIMIZATION PARAMETERS
1.Problem Types
2.Variables
• PROBLEM TYPES -There are two general types of
optimization problems:
1. Unconstrained
2. Constrained
In unconstrained optimization problems there are
no restrictions. For a given pharmaceutical system
one might wish to make the hardest tablet possible
The constrained problem involved in it is to make
the hardest tablet possible, but it must disintegrate
in less than 15 minutes.
9. 9
• VARIABLES - The development procedure of the
pharmaceutical formulation involve several variables.
Mathematically these variables are divided into two
groups.
1.Independent variables
2.Dependent variables
The independent variables are under the control of the
formulator. These might include Ingredients,
compression force or the die cavity filling or the mixing
time.
The dependent variables are the responses or the
characteristics that are developed due to the independent
variables. The more the variables that are present in the
system the more the complications that are involved in
the optimization.
10. Relationship between independent variables and
response defines response surface
Representing >2 becomes graphically impossible
Higher the variables , higher are the
complications hence it is to optimize each &
everyone.
10
11. Response surface representing the relationship
between the independent variables X1 and X2 and the
dependent variable Y.
11
12. It involves application of calculus to basic problem
for maximum/minimum function.
Limited applications
i. Problems that are not too complex
ii. They do not involve more than two variables
For more than two variables graphical representation
is impossible
It is possible mathematically
12
14. Using calculus the graph obtained can be solved.
Y = f (x)
When the relation for the response y is given as the
function of two independent variables,x1 &X2
Y = f(X1 , X2)
The above function is represented by contour plots on
which the axes represents the independent variables x1&
x2
14
15. Techniques used divided in to two types.
Experimentation continues as optimization
proceeds
It is represented by evolutionary
operations(EVOP), simplex methods.
Experimentation is completed before
optimization takes place.
It is represented by classic mathematical
& search methods.
15
16. For second type it is necessary that the relation
between any dependent variable and one or
more independent variable is known.
There are two possible approaches for this
Theoretical approach- If theoretical equation
is known , no experimentation is necessary.
Empirical or experimental approach – With
single independent variable formulator
experiments at several levels.
16
17. The relationship with single independent
variable can be obtained by simple regression
analysis or by least squares method.
The relationship with more than one important
variable can be obtained by statistical design of
experiment and multi linear regression analysis.
Most widely used experimental plan is factorial
design
17
18. FACTOR: It is an assigned variable such as concentration ,
Temperature etc..,
Quantitative: Numerical factor assigned to it
Ex; Concentration- 1%, 2%,3% etc..
Qualitative: Which are not numerical
Ex; Polymer grade, humidity condition etc
LEVELS: Levels of a factor are the values or designations
assigned to the factor
18
FACTOR LEVELS
Temperature 300
, 500
Concentration 1%, 2%
19. RESPONSE: It is an outcome of the experiment.
It is the effect to evaluate.
Ex: Disintegration time etc..,
EFFECT: It is the change in response caused by
varying the levels
It gives the relationship between various factors &
levels
INTERACTION: It gives the overall effect of two or
more variables
Ex: Combined effect of lubricant and glidant on
hardness of the tablet
19
20. Optimization by means of an experimental design
may be helpful in shortening the experimenting
time.
The design of experiments is a structured ,
organised method used to determine the
relationship between the factors affecting a
process and the output of that process.
Statistical DOE refers to the process of planning
the experiment in such a way that appropriate
data can be collected and analysed statistically.
20
21. Definition of Experimental Design
It is the methodology of how to conduct and plan
experiments in order to extract the maximum amount
of information in the fewest number of runs.
22. Completely randomised designs
Randomised block designs
Factorial designs
Full
Fractional
Response surface designs
Central composite designs
Box-Behnken designs
Adding centre points
Three level full factorial designs
22
23. Types of Experimental Design
Choice of experiments depends on level of knowledge
before experiments, resource available and objectives
of the experiments
Discovering important process factors
• Placket-Burman
• Fractional Factorial
Estimating the effect and interaction of several
factors
•Full Fractional
•Fractional Factorial
• Tiguchi
For optimization
•Central composite
•Simplex lattice
•D-optimal
24. Completely randomised Designs
These experiment compares the values of a response
variable based on different levels of that primary factor.
For example ,if there are 3 levels of the primary factor
with each level to be run 2 times then there are 6 factorial
possible run sequences.
Randomised block designs
For this there is one factor or variable that is of primary
interest.
To control non-significant factors,an important technique
called blocking can be used to reduce or eliminate the
contribition of these factors to experimental error.
24
25. Factorial design
Full
• Used for small set of factors
Fractional
• It is used to examine multiple factors efficiently with
fewer runs than corresponding full factorial design
Types of fractional factorial designs
Homogenous fractional
Mixed level fractional
Box-Hunter
Plackett-Burman
Taguchi
Latin square
25
26. It is written as 3k
factorial design.
It means that k factors are considered each at 3
levels.
These are usually referred to as low,
intermediate & high values.
These values are usually expressed as 0, 1 & 2
The third level for a continuous factor facilitates
investigation of a quadratic relationship between
the response and each of the factors
26
27. It is written as 3k
factorial design.
It means that k factors are considered each at 3
levels.
These are usually referred to as low, intermediate
& high values.
These values are usually expressed as 0, 1 & 2
The third level for a continuous factor facilitates
investigation of a quadratic relationship between
the response and each of the factors
27
28. These are the designs of choice for
simultaneous determination of the effects of
several factors & their interactions.
Used in experiments where the effects of
different factors or conditions on experimental
results are to be elucidated.
Two types
Full factorial- Used for small set of factors
Fractional factorial- Used for optimizing
more number of factors
28
30. Factor
combination
Stearate Drug Starch Response
Thickness
Cm*103
(1) _ _ _ 475
a + _ _ 487
b _ + _ 421
ab + + _ 426
c _ _ + 525
ac + _ + 546
bc _ + + 472
abc + + + 522
30
31. A simple experiment model with four factors. Require 2
x 2 x 2 x 2, or 16, trials. That’s too many, so we decide
to confound one factor.
24-1
fractional factorial design.
That gives us values of:
No of level l = 2
Treatment factor k = 4
Cofound interaction p = 1
Trial Factor A Factor B
Factor
C
Notatio
n
1 – – – (1)
2 + – – A
3 – + – B
4 + + – Ab
5 – – + C
6 + – + ac
7 – + + bc
8 + + + abc
32. fractional 4-factor design uses the same table with the same
number of trials, but with an extra factor, D. To keep the number
of trials the same, we’ll use a level of D in each trial that
corresponds with the levels used in factor A and factor B,
combined. This is where the plus and minus signs come in! We’ll
use this simple formula:
D = A x B
So if A is on its low level (-) and B is on its high level (+), then
(remembering back to grade-school math – a negative multiplied by
a positive) D will be (-).
Trial Factor A Factor B Factor C Factor D Notation
1 – – – + d
2 + – – – a
3 – + – – b
4 + + – + abd
5 – – + + cd
6 + – + – ac
7 – + + – bc
8 + + + + abcd
35. Homogenous fractional
Useful when large number of factors must be screened
Mixed level fractional
Useful when variety of factors need to be evaluated
for main effects and higher level interactions can be
assumed to be negligible.
Box-hunter
Fractional designs with factors of more than two
levels can be specified as homogenous fractional or
mixed level fractional
35
36. It is a popular class of screening design.
These designs are very efficient screening designs
when only the main effects are of interest.
These are useful for detecting large main effects
economically ,assuming all interactions are negligible
when compared with important main effects
Used to investigate n-1 variables in n experiments
proposing experimental designs for more than seven
factors and especially for n*4 experiments.
36
TYPES OF EXPERIMENTAL DESIGN
37. Taguchi
It is similar to PBDs.
It allows estimation of main effects while minimizing
variance.
Taguchi Method treats optimization problems in
two categories,
[A] STATIC PROBLEMS :Generally, a process to be
optimized has several control factors which directly decide the
target or desired value of the output.
[B] DYNAMIC PROBLEMS :If the product to be optimized
has a signal input that directly decides the output,
37
TYPES OF EXPERIMENTAL DESIGN
38. Latin square
They are special case of fractional factorial design
where there is one treatment factor of interest and
two or more blocking factors
39. 10/19/16 39
We can use the Latin square to allocate treatments. If the rows of the square
represent patients and the columns are weeks, then for example the second
patient,in the week of the trial, will be given drug D. Now each patient receives
all five drugs, and in each week all five drugs are tested.
A B C D E
B A D E C
C E A B D
D C E A B
E D B C A
40. Design Selection Guideline
Number
of Factors
Comparative
Objective
Screening
Objective
Response Surface
Objective
1
1-factor completely
randomized design
_ _
2 - 4
Randomized block
design
Full or fractional
factorial
Central composite
or Box-Behnken
5 or more
Randomized block
design
Fractional factorial
or Plackett-
Burman
Screen first to
reduce number of
factors
41. This model has quadratic form
Designs for fitting these types of models are known
as response surface designs.
If defects and yield are the ouputs and the goal is to
minimise defects and maximise yield
41
γ =β0 + β1X1 + β2X2 +….β11X1
2
+ β22X2
2
42. Regression analysis is done for
In order to predict the value of the dependent
variable for individuals for whom some information
concerning the explanatory variables is available,
or in order to estimate the effect of some
explanatory variable on the dependent variable.
In statistical modeling, regression analysis is a
statistical process for estimating the relationships
among variables.
It includes many techniques for modeling and
analyzing several variables, when the focus is on the
relationship between a dependent variable and one
or more independent variables (or 'predictors')
43. Two most common designs generally used in
this response surface modelling are
Central composite designs
Box-Behnken designs
Box-Wilson central composite Design
This type contains an embedded factorial or
fractional factorial design with centre points
that is augemented with the group of ‘star
points’.
These always contains twice as many star
points as there are factors in the design
43
TYPES OF EXPERIMENTAL DESIGN
44. Central composite designs are a factorial or fractional
factorial design with center points, augmented with a
group of axial points (also called star points) that let
you estimate curvature.
The star points represent new extreme value (low & high) for
each factor in the design
To picture central composite design, it must imagined that
there are several factors that can vary between low and high
values.
Central composite designs are of three types
Circumscribed(CCC) designs-Cube points at the corners of the
unit cube ,star points along the axes at or outside the cube and
centre point at origin
Inscribed (CCI) designs-Star points take the value of +1 & -1
and cube points lie in the interior of the cube
Faced(CCI) –star points on the faces of the cube.
44
46. Generation of a Central Composite Design for Two
Factor
A central composite design always contains twice as many
star points as there are factors in the design. The star
points represent new extreme values (low and high) for
each factor in the design ±α.
47. Determining α in central Composite Design
To maintain rotatability, the value of α depends on the number
of experimental runs in the factorial portion of the central
composite design
If the factorial is a full factorial,
then
If the factorial is a fractional
factorial, then
48. Number of
Factors
Factorial
Portion
Scaled Value for
Relative to ±1
2 22
22/4
= 1.414
3 23
23/4
= 1.682
4 24
24/4
= 2.000
5 25-1
24/4
= 2.000
5 25
25/4
= 2.378
6 26-1
25/4
= 2.378
6 26
26/4
= 2.828
51. Table below show how to choose value of α and of center point for CCD
Where K: number of factor
nf: experiments in factorial design
ne: experiments in star design
52. Box-Behnken designs use just three levels of each factor.
In this design the treatment combinations are at the midpoints
of edges of the process space and at the center. These designs
are rotatable (or near rotatable) and require 3 levels of each
factor
These designs for three factors with circled point appearing at
the origin and possibly repeated for several runs.
It’s alternative to CCD.
The design should be sufficient to fit a quadratic model , that
justify equations based on square term & products of factors.
Y=b0+b1x1+b2x2+b3x3+b4x1x2+b5x1x3+b6X2X3+b7X1
2 +
b8X22+
b9X3
2
52
54. The Box-Behnken design is an independent quadratic design
in that it does not contain an surrounded factorial or
fractional factorial design. In this design the treatment
combinations are at the midpoints of edges of the process
space and at the center. These designs are rotatable (or
near rotatable) and require 3 levels of each factor.
Box-Behnken designs
55. i. Box-Behnken designs are response surface designs, specially
made to require only 3 levels, coded as -1, 0, and +1.
ii. Box-Behnken designs are available for 3 to 10 factors. It is
formed by combining two-level factorial designs with
incomplete block designs.
iii. This procedure creates designs with desirable statistical
properties but, most importantly, with only a fraction of the
experimental trials required for a three-level factorial. Because
there are only three levels, the quadratic model was found to be
appropriate.
iv. In this design three factors were evaluated, each at three levels,
and experiment design were carried out at all seventeen
possible combinations.
59. Number of
Factors Central Composite
Box-
Behnken
2 13 (5 center points) -
3 20 (6 centerpoint runs) 15
4 30 (6 center point runs) 27
5 33 (fractional factorial) or 52
(full factorial)
46
6 54 (fractional factorial) or 91
(full factorial)
54
Number of Runs Required by Central Composite and
Box-Behnken Designs
62. It is a method of experimental optimization.
Technique is well suited to production situations.
• The basic philosophy is that the production procedure
(formulation and process) is allowed to evolve to the
optimum by careful planning and constant repetition.
• The process is run in a way such that it both produces a
product that meets all specifications and (at the same
time) generates information on product improvement.
Small changes in the formulation or process are made
(i.e.,repeats the experiment so many times) & statistically
analyzed whether it is improved.
It continues until no further changes takes place i.e., it
has reached optimum-the peak
62
63. Applied mostly to TABLETS.
Production procedure is optimized by careful
planning and constant repetition
It is impractical and expensive to use.
It is not a substitute for good laboratory scale
investigation
63
64. It is an experimental method applied for
pharmaceutical systems
Technique has wider appeal in analytical method
other than formulation and processing
Simplex is a geometric figure that has one more point
than the number of factors.
It is represented by triangle.
It is determined by comparing the magnitude of the
responses after each successive calculation
64
65. In simplex lattice, the response may be plotted as 2D
(contour plotted) or 3D plots (response surface
methodology)
68. The two independent variables show pump speeds for
the two reagents required in the analysis reaction.
Initial simplex is represented by lowest triangle.
The vertices represents spectrophotometric response.
The strategy is to move towards a better response by
moving away from worst response.
Applied to optimize CAPSULES, DIRECT
COMPRESSION TABLET (acetaminophen), liquid
systems (physical stability)
68
69. Example 2: Two component solvent system
representing simplex lattice.
Constraint is the concentration of A and B must add to
100%
Includes observing responses( solubility) at three point i.e.
100% A, 100% B and 50 – 50 mixtures of A and B
70. Eg: Preparation of tablet with excipients (three components)
gives 7 runs.
7
Starch
Stearic acidLactose 3
1A regular simplex lattice for a three
component mixture consist of seven
formulations
2
4
5
6
71. A simplex lattice of four component is shown by 15
formulation
4 formulations of each component A,B,C&D
6 formulation of 50-50 mixture of AB, AC, AD, BC, BD&CD.
4 formulation of 1/3 mixtures of three components ABC, ABD,
ACD, & BCD.
1 formulation of 25% of each of four (ABCD)
72. • 100% pure component is not taken as un acceptable
formulation is obtained, thus vertices does not represent the
pure single substance , therefore a transformation is
required.
Transformed % = ( Actual %- Minimum %)
(Maximum %-Minimum %)
73.
74. It represents mathematical techniques.
It is an extension of classic method.
It is applied to a pharmaceutical formulation and
processing.
This technique follows the second type of statistical
design
Limited to 2 variables - disadvantage
74
75. Determine objective formulation
Determine constraints.
Change inequality constraints to equality constraints.
Form the Lagrange function F:
Partially differentiate the lagrange function for each
variable & set derivatives equal to zero.
Solve the set of simultaneous equations.
Substitute the resulting values in objective functions
75
78. Polynomial models relating the response variables to
independents were generated by a backward stepwise
regression analysis program.
Y= B0+B1X1+B2X2+B3 X1
2
+B4 X2
2
+B5 X1 X2 +B6 X1X2
2
+ B7X2X1
2
+B8X1
2
X2
2
Y – Response
Bi – Regression coefficient for various terms containing
the levels of the independent variables.
X – Independent variables
78
80. Constrained optimization problem is to locate the
levels of stearic acid(x1) and starch(x2).
This minimize the time of invitro release(y2),average
tablet volume(y4), average friability(y3)
To apply the lagrangian method, problem must be
expressed mathematically as follows
Y2 = f2(X1,X2)-invitro release
Y3 = f3(X1,X2)<2.72-Friability
Y4 = f4(x1,x2) <0.422-avg tab.vol
80
85. It is defined by appropriate equations.
It do not require continuity or differentiability of
function.
It is applied to pharmaceutical system
For optimization 2 major steps are used
Feasibility search-used to locate set of response
constraints that are just at the limit of possibility.
Grid search – experimental range is divided in to
grid of specific size & methodically searched
85
86. Select a system
Select variables
Perform experiments and test product
Submit data for statistical and regression analysis
Set specifications for feasibility program
Select constraints for grid search
Evaluate grid search printout
8. Request and evaluate:.
a. “Partial derivative” plots, single or
composite
b. Contour plots
86
88. Five independent variables dictates total of 32
experiments.
This design is known as five-factor, orthagonal,
central,composite, second order design.
First 16 formulations represent a half-factorial design
for five factors at two levels .
The two levels represented by +1 & -1, analogous to
high & low values in any two level factorial.
88
89. 89
• The experimental design used was a modified factorial and is
shown in Table.
• The fact that there are five independent variable dictates that a
total of 27 experiments or formulations be prepared. This design is
known as a five-factor, orthogonal, central, composite, second-order
design . The firs 16 formulations represent a half-factorial design
for five factors at two levels, resulting in ½ X 25 =16 trials. The two
levels are represented by +1 and -1, analogous to the high and low
values in any two level factorial design. For the remaining trials,
three additional levels were selected: zero represents a base level
midway between the aforementioned levels, and the levels noted as
1.547 represent extreme (or axial) values.
92. Again formulations were prepared and are measured.
Then the data is subjected to statistical analysis followed by
multiple regression analysis.
The equation used in this design is second order polynomial.
y = 1a0+a1x1+…+a5x5+a11x12+…+a55x2
5+a12x1x2
+a13x1x3+a45 x4x5
92
93. 93
For the optimization itself, two major steps were used:
1. The feasibility search
2. The grid search.
The feasibility program is used to locate a set of response constraints that are
just at the limit of possibility.
. For example, the constraints in Table were fed into the computer and
were relaxed one at a time until a solution was found.
94. 94
This program is designed so that it stops after the first possibility, it is not a full
search.
The formulation obtained may be one of many possibilities satisfying the constraints.
95. 95
•The grid search or exhaustive grid search, is essentially a brute
force method in which the experimental range is divided into a grid
of specific size and methodically searched.
•From an input of the desired criteria, the program prints out all
points (formulations) that satisfy the constraints.
• Graphic approaches are also available and graphic output is provided
by a plotter from computer tapes.
96. A multivariant statistical technique called principle
component analysis (PCA) is used to select the best
formulation.
PCA utilizes variance-covariance matrix for the responses
involved to determine their interrelationship.
96
97. 97
•The output includes plots of a given responses as a function of a single variable (fig.11).
The abscissa for both types is produced in experimental units, rather
than physical units, so that it extends from -1.547 to + 1.547.
98. 98
The output includes plots of a given responses as a function of all five variable
(Fig 12).
99. 99
Contour plots (Fig.13) are also generated in the same manner. The specific
response is noted on the graph, and again, the three fixed variables must be
held at some desired level. For the contour plots shown, both axes are in
experimental unit (eu) .
100. It takes five independent variables in to account.
Persons unfamiliar with mathematics of optimization &
with no previous computer experience could carryout
an optimization study.
100
101. It is a technique used to reduce a second order regression
equation.
This allows immediate interpretation of the regression equation
by including the linear and interaction terms in constant term.
2variables=first order regression equation.
3variables/3level design=second order regression equation.
101
Y = Y0 +λ1W1
2
+ λ2W2
2
+..
102. 102
. In canonical analysis or canonical
reduction, second-order regression
equations are reduced to a simpler
form by a rigid rotation and translation
of the response surface axes in
multidimensional space, as shown in
Fig.14 for a two dimension system.
103. Forms of Optimization techniques:
1. Sequential optimization techniques.
2. Simultaneous optimization techniques.
3. Combination of both.
104. Sequential Methods:
Also referred as the "Hill climbing method".
Initially small number of experiments are done, then research is done
using the increase or decrease of response.
Thus, maximum or minimum will be reached i.e. an optimum solution.
Simultaneous Methods:
Involves the use of full range of experiments by an experimental design.
Results are then used to fit in the mathematical model.
Maximum or minimum response will then be found through this fitted
model.
105. Example:- Designing controlled drug delivery system
for prolonged retention in stomach required
optimization of variables like
•presence/ absence / concentration of stomach
enzyme
pH, fluid volume and contents of guts
Gastric motility and gastric emptying.
106. When given as single oral
tablet (A).
Same drug when given in
multiple doses (B)
Same drug when given as
optimized controlled
release formulation (C)
108. Artificial Neural Network & optimization of pharmaceutical
formulation-
ANN has been entered in pharmaceutical studies to
forecast the relationship b/w the response variables
&casual factors . This is relationship is nonlinear
relationship.
ANN is most successfully used in multi objective
simultaneous optimization problem.
Radial basis functional network (RBFN) is proposed
simultaneous optimization problems.
RBFN is an ANN which activate functions are RBF.
RBF is a function whose value depends on the distance
from the Centre or origin.
10/19/16 108