10.7 KB · commit a9602da
← Previous: NM-5 Lower — Trapezoidal, 3/8, Romberg | 🏠 Index | Next: NM-7 Numerical Differentiation →
Section: A (Numerical Methods) | Priority: 🟡 | Exam Frequency: 2/8 years | Subtopics: NM-6.1, NM-6.2, NM-6.3 Sources: Class Notes (no direct Jain chapter), Shishir Notes §04
Optimization is a light topic. It appeared in 2018 (finding maxima from tabulated data, 6 marks) and 2021 (constrained vs. unconstrained theory + Newton's method for maxima, 5 marks total). That makes it a low-frequency topic, but when it appears, it carries decent marks. The Newton's method connection to NM-2.4 makes it easy to prepare if you already know root finding.
Optimization: Finding the values of decision variables that maximise or minimise an objective function f(x), possibly subject to constraints.
Unconstrained optimization: No restrictions on the variables. The optimum satisfies ∇f=0 (gradient is zero).
Constrained optimization: The variables must satisfy conditions written as g(x)≤0 (inequality constraints) or h(x)=0 (equality constraints). Solved using Lagrange multipliers or KKT conditions.
The difference is about whether the variables are free or restricted.
Unconstrained: Choose x anywhere in the domain. The stationarity condition is:
∇f=0Example: fitting y=a+bx by least squares. Nothing restricts a or b.
Constrained: Extra rules apply. Written formally:
minimise f(x)subject togi(x)≤0,hj(x)=0Example: minimise the weight of a structure subject to stress limits on each member.
Comparison table:
| Unconstrained | Constrained | |
|---|---|---|
| Restrictions | None | Equality and inequality conditions |
| Stationarity test | ∇f=0 | KKT conditions with multipliers |
| Lagrange multipliers | Not needed | Essential |
| Optimum location | Interior point | Often on the boundary |
| Feasible region | Whole space | A subset |
| Difficulty | Easier | Harder; more constraints mean more cases |
The key insight: in the constrained case, the optimum often sits on a boundary. There, the plain gradient test (∇f=0) fails because the feasible directions are restricted. That is why Lagrange multipliers and KKT conditions exist.
To find a maximum or minimum of f(x), solve f′(x)=0. This is a root-finding problem for the derivative. Apply Newton-Raphson to g(x)=f′(x):
xn+1=xn−g′(xn)g(xn)=xn−f′′(xn)f′(xn)After finding the critical point, always check whether it is a maximum or minimum:
This check is not optional. Newton applied to f′=0 finds any critical point. It does not distinguish between maxima and minima.
Appeared: 2021 Q.6(b) — (03 marks)
Full Answer:
Step 1. Set up the iteration. f′(x)=2cosx−5x, f′′(x)=−2sinx−51.
xn+1=xn−−2sinxn−1/52cosxn−xn/5Step 2. Iterate from x0=2.5.
At x0=2.5: f′(2.5)=2cos2.5−0.5=−2.10229, f′′(2.5)=−2sin2.5−0.2=−1.39694.
| Iteration | xn | f′(xn) | f(xn) |
|---|---|---|---|
| 0 | 2.5000000000 | −2.1022872 | 0.5719443 |
| 1 | 0.9950815513 | +0.8898527 | 1.5785880 |
| 2 | 1.4690107528 | −0.0905823 | 1.7738494 |
| 3 | 1.4276423210 | −0.0001973 | 1.7757256 |
| 4 | 1.4275517793 | −0.0000000 | 1.7757257 |
| 5 | 1.4275517788 | 0 | 1.7757257 |
Iteration 1: x1=2.5−−1.3969443−2.1022872=2.5−1.5049184=0.9950816.
Step 3. Confirm it is a maximum.
f′′(1.42755)=−2sin(1.42755)−0.2=−2.179516, which is negative. So the critical point is a maximum.
xmax=1.42755,f(xmax)=1.77573Appeared: 2021 Q.6(d) — (02 marks)
Full Answer:
Unconstrained optimization. No restrictions. Choose x freely to maximise or minimise f(x). Stationarity condition: ∇f=0.
Example: least squares regression. Nothing restricts the coefficients.
Constrained optimization. Extra conditions must hold: gi(x)≤0 and hj(x)=0. Solved using Lagrange multipliers. The optimum frequently sits on a boundary, where the plain gradient test is useless.
Example: minimise weight of a truss subject to load limits on each member.
| Unconstrained | Constrained | |
|---|---|---|
| Restrictions | None | Equality and inequality |
| Stationarity | ∇f=0 | KKT with multipliers |
| Optimum location | Interior | Often on boundary |
When a function is known only at discrete points (a table), find the maximum or minimum by:
The backward form is natural when the maximum is near the end of the table. The forward form is natural when it is near the start.
Appeared: 2018 Q.5(b) — (06 marks)
Full Answer:
| x | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 |
|---|---|---|---|---|---|
| y | 0.9320 | 0.9636 | 0.9855 | 0.9975 | 0.9996 |
Step 1. Build the difference table (h=0.1):
| 0.9320 | 0.9636 | 0.9855 | 0.9975 | 0.9996 | |
|---|---|---|---|---|---|
| Δ | 0.0316 | 0.0219 | 0.0120 | 0.0021 | |
| Δ2 | −0.0097 | −0.0099 | −0.0099 | ||
| Δ3 | −0.0002 | 0.0000 | |||
| Δ4 | 0.0002 |
All first differences are positive but falling. The last one (0.0021) is small. The second differences are all negative. So y is still rising at x=1.5 but levelling off. The maximum lies just inside the end of the table, near x=1.6.
Step 2. Use the backward derivative. At x4=1.6 with q=(x−x4)/h:
dxdy=h1[∇y4+22q+1∇2y4+63q2+6q+2∇3y4+244q3+18q2+22q+6∇4y4]The backward differences at x4:
∇y4=0.0021,∇2y4=−0.0099,∇3y4=0.0000,∇4y4=0.0002Step 3. Set dxdy=0. With ∇3y4=0 and ∇4y4 tiny, the first two terms dominate:
0.0021+22q+1(−0.0099)=0 0.0021=(q+0.5)(0.0099) q+0.5=0.00990.0021=0.212121 q=−0.287879 x=x4+hq=1.6+0.1(−0.287879)=1.5712Step 4. Evaluate y there. Using the backward Newton polynomial:
y=y4+q∇y4+2q(q+1)∇2y4+6q(q+1)(q+2)∇3y4+24q(q+1)(q+2)(q+3)∇4y4At q=−0.287879:
y=0.9996+(−0.287879)(0.0021)+2(−0.287879)(0.712121)(−0.0099)+0+24(−0.287879)(0.712121)(1.712121)(2.712121)(0.0002) y=0.9996−0.0006045+0.0010148−0.0000079=1.0000023 x=1.57 (correct to two decimal places),ymax=1.0000← Previous: NM-5 Lower — Trapezoidal, 3/8, Romberg | 🏠 Index | Next: NM-7 Numerical Differentiation →