Lagrange optimimzation with a Diff.eq constraint

77 Views Asked by At

sorry in advance if my English isn't perfect here, it is not my first language( or second, for that matter...)

im having some issues with understanding some of the details. the question is as follows:

Given $$ (b(x){u(x)}'')''=f(x) $$ minimize $$\int_{0}^{1}f(x)u(x)dx$$ Now, this is the Euler-bernoulli eq for beams. the point here is to solve this numerically, so we replace all second derivatives with finite differences of the form $$ u_i=\frac{(u_{i+1}-2u_i+u_{i-1})}{h^2}$$ and rewrite the original eq as a system:

$$w_n=B_nD^2U_n, n=1,2,3...N-1$$. $$ D^2W_n=F_n, n=1,2,3...N-1 $$

Now, the lagrangian of this approx. is $$L(U,B,\lambda )=\sum_{n=1}^{N-1}F\cdot U-\lambda \cdot (F-D^2BD^2U)$$, where $D^2$ is a matrix approximation to the second derivative for n-1 points of discretization. and B is diagonal matrix containing the different values of b( the stiffness of the beam), at every point n. lets assume for simplicity that we only have 3 different b values, so B=diag(b1,b2,b3) now we need to differentiate the lagrangian. ones of those partials is $\partial _{b_i} L(U,B,\lambda )$. Now, i dont understand what it even means to differentiate with regard to an element of a matrix... i mean, if i have B=diag[b1,b2,b3], and i derive with regards to b1, wont it just be diag[1,0,0]? and for b2 diag[0,1,0] and so on?