1 function Hessian_der = lin_evol_opt_fd_Hessian_der(model, model_data, mu,h)
2 %
function U_der = lin_evol_opt_fd_Hessian(model, model_data, mu,h)
4 %
function caluculating the third derivative of a
function, by a
5 % sensitivity PDE
for the first derivative and then finite differences
for
6 % the second derivative of the first derivative :-)
8 % Markus Dihlmann 20.06.2011
14 old_mu = get_mu(model);
21 compute_derivative_old = model.compute_derivative_info;
23 model.compute_derivative_info =1;
26 H= lin_evol_opt_fd_Hessian(model, model_data, mu,h);
30 Hessian_der = cell(size(H,1)^2,n_params);
35 model = set_mu(model, mu);
36 Hh = lin_evol_opt_fd_Hessian(model, model_data,mu,h);
39 Hessian_der{(i-1)*n_params+j,k} = (-H{i,j}+Hh{i,j})./h;
43 model = set_mu(model,mu);
46 model = set_mu(model, old_mu);
47 model.compute_derivative_info = compute_derivative_old;