Skip to content

Commit

Permalink
- numerical trick for hess
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18153 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Vitalij Ruge committed Nov 15, 2013
1 parent 86724e3 commit 15be539
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions SimulationRuntime/c/optimization/lagrangeFun/ipopt_hessian.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,14 @@ Bool ipopt_h(int n, double *v, Bool new_x, double obj_factor, int m, double *lam

for(ii = 0; ii <1; ++ii)
{
for(j = 0; j<iData->nx; ++j)
iData->sh[j] = iData->d1[4]*(lambda[j] - lambda[j + iData->nx]) + lambda[j + 2*iData->nx];

for(p = 0, x= v, ll = lambda;p <iData->deg+1;++p, x += iData->nv)
{
mayer_yes = iData->mayer && ii+1 == iData->nsi && p == iData->deg;

if(p){
num_hessian(x, iData->time[p], iData, ll,iData->lagrange,mayer_yes,obj_factor);
}else{
num_hessian(x, iData->time[p], iData, iData->sh,iData->lagrange,mayer_yes,obj_factor);
num_hessian(x, iData->time[p], iData, ll + 2*iData->nx,iData->lagrange,mayer_yes,obj_factor);
}

for(i=0;i< iData->nv;++i)
Expand Down

0 comments on commit 15be539

Please sign in to comment.