Skip to content

Commit

Permalink
- changed numiracl handling for hessian in first intervall
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@18235 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Vitalij Ruge committed Nov 22, 2013
1 parent 90332cc commit 4be61a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ int loadDAEmodel(DATA *data, IPOPT_DATA_ *iData)
iData->d1[2] = 0.8541019662496845446137605030969143531609275394172;
iData->d1[3] = 0.17082039324993690892275210061938287063218550788345;
iData->d1[4] = 0.44721359549995793928183473374625524708812367192230;
iData->invd1_4 = 2.2360679774997896964091736687312762354406183596115;

iData->d2[0] = 3.3013155617496424838955952368431696002490512113396;
iData->d2[1] = 5.8541019662496845446137605030969143531609275394172;
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/c/optimization/ipoptODEstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ typedef struct IPOPT_DATA_
double *d1;
double *d2;
double *d3;

double invd1_4;
double **d1_;
double **d2_;
double **d3_;
Expand Down
7 changes: 4 additions & 3 deletions SimulationRuntime/c/optimization/lagrangeFun/ipopt_hessian.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ Bool ipopt_h(int n, double *v, Bool new_x, double obj_factor, int m, double *lam

if(p){
num_hessian(x, iData->time[p], iData, ll,iData->lagrange,mayer_yes,obj_factor);
ll += iData->nx;
}else{
num_hessian(x, iData->time[p], iData, ll + 2*iData->nx,iData->lagrange,mayer_yes,obj_factor);
for(i = 0; i< iData->nx; ++i)
iData->sh[i] = iData->d1[4]*(ll[i] - ll[i + iData->nx] + iData->invd1_4*ll[i+2*iData->nx]);
num_hessian(x, iData->time[p], iData, iData->sh ,iData->lagrange,mayer_yes,obj_factor);
}

for(i=0;i< iData->nv;++i)
Expand All @@ -137,8 +140,6 @@ Bool ipopt_h(int n, double *v, Bool new_x, double obj_factor, int m, double *lam
r += iData->nv;
c += iData->nv;

if(p)
ll += iData->nx;
}

}
Expand Down

0 comments on commit 4be61a1

Please sign in to comment.