Compute the partial derivative of the nodal displacements using the Sherman Morrison Woodbury formula.
[U,dU] = dfemtruss_smw(ffd,x,ddl,params)
a function which returns the parameters of a structure. Must have the following prototype:
The varargin(1)
parameters is optional.
the vector of optimization parameters.
a list of nodes on which we want to compute the partial derivatives.
a plist (created using the parameters module) which handles
some parameters for the dfemtruss_smw
function. Can be:
'delta_h': the size of the finite difference step. Default value: 1e-6
the vector of nodal displacement.
partial derivative of the nodal displacement solution (wrt to the points given in x). A matrix of size length(ddl) x length(x).
Compute the partial derivative of the nodal displacements using the Sherman Morrison Woodbury formula.
// Code sample extracted from demos/brid_optim_smw.sce // This code will not work if copy / pasted from this help page ! function y=fobj_truss(x) [t,p,e,A,E,rho,F] = bridge_optim(x); [U,P,R]= femtruss(bridge_optim, %F, x); // First objective: minimize the deformation at nodes 2, 3, 4 with respect to y // The deck of the bridge Pos_deck = localise2d(IndexNodeVarInf); y = sqrt(sum(U(Pos_deck).^2)); endfunction function dy=dfobj_truss(x) Pos_deck = localise2d(IndexNodeVarInf); [U,dU] = dfemtruss_smw(bridge_optim,x,Pos_deck); for i=1:length(x) dy(i) = 2*U(Pos_deck) * dU(:,i); end endfunction function [y, dy, ind]=optim_fobj_truss(x, ind) y = fobj_truss(x); dy = dfobj_truss(x)'; endfunction | ![]() | ![]() |