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

Weekly report

Ha-Ninh Nguyen

2021/07/02

Computational Optimization Laboratory

Department of Mechanical Engineering


Kunsan National University
Objective

Order Task description Status


1 Learning Optimization using ADCME On-going
Structural modeling analysis by COMSOL
2 1.Static On-going
2.Transient
3 Numerical Methods in Engineering with Python 3 On-going

Ha-Ninh NGUYEN 2
Table of content

I. BFGS

II. Newton Raphson method by ADCME

III. Parameter Inverse Problem

IV. Conclusion

V. Future work

Ha-Ninh NGUYEN 3
I. BFGS
In numerical optimization, the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm is an iterative method for
solving unconstrained nonlinear optimization problems. Like the related Davidon–Fletcher–Powell method,
BFGS determines the descent direction by preconditioning the gradient with curvature information. It does so
by gradually improving an approximation to the Hessian matrix of the loss function, obtained only from
gradient evaluations (or approximate gradient evaluations) via a generalized secant method.

The algorithm is named after Charles George Broyden, Roger Fletcher, Donald Goldfarb and David Shanno

Ha-Ninh NGUYEN 4
II. Newton Raphson method by ADCME
Given that x3 + 2x – 2 = 0 has a root between 0 and 1. Find the root to 2 decimal places using the Newton-
Raphson method.
Solution
f(x) = x3 + 2x – 2
f’(x) = 3x2 + 2
According to Newton Raphson formula, we have
Let x1 = 1
(1)3 +2 1 −2 (0.8)3 +2 0.8 −2
x2 = 1 - = 0.8; x3 = 0.8 - = 0.77142…; x4 = 0.7709… x5 = 0.7709…
3 (1)2 +2 3 (0.8)2 +2

 x = 0.77 (2dp)
If we try x1 = 0.5 then x1 = 0.5; x2 = 0.81; x3 = 0.722; x4 = 0.7709…; x5 = 0.7709…
x = 0.77 (2dp)

Ha-Ninh NGUYEN 5
II. Newton Raphson method by ADCME
Bring the problem into ACDME platform for implementation

To mark the quantity that gets updated in optimization

Fomula from problem using Newton Raphson form

Ha-Ninh NGUYEN 6
II. Newton Raphson method by ADCME
Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm

Iterative calculation result

Ha-Ninh NGUYEN 7
III. Parameter Inverse Problem
When X is just a scalar/vector, we call this type of problem parameter inverse problem. We consider a manufactured
solution: the exact x=1 and u(x) = x(1-x), so we have
φ(x) = 2

Assume we can observe u(0.5) = 0.25and the initial guess for X0 = 10. We use finite difference method to discretize the
1
PDE and the interval [0,1] is divided uniformly to 0 = x0 < x1 < … < xn=1, with n = 100, xi + 1 – xi = h =
𝑛

we can solve the problem with the following code snippet


using ADCME
n = 100
h = 1/n
X0 = Variable(10.0)
A = X0 * diagm(0=>2/h^2*ones(n-1), 1=>-1/h^2*ones(n-2), -1=>-1/h^2*ones(n-2)) # coefficient matrix for the finite difference
φ = 2.0*ones(n-1) # right hand side
u = A\φ
loss = (u[50] - 0.25)^2

sess = Session(); init(sess)


BFGS!(sess, loss)

Ha-Ninh NGUYEN 8
III. Parameter Inverse Problem

After around 7 iterations, the estimated X0 converges

Ha-Ninh NGUYEN 9
III. Conclusion
• ADCME is the gateway to inverse modeling with physics machine learning
• ADCME is necessary to optimize the value and constraint of numerical analysis (amount of heat
flux/location of heat flux)

Ha-Ninh NGUYEN 10
V. Future work
Continue implement on structural analysis and numerical method

Ha-Ninh NGUYEN 11

You might also like