seacode / gmacs

A generic size-structured stock assessment model
https://seacode.github.io/gmacs
18 stars 14 forks source link

BBRKC 2017: error in matrix inverse #196

Open adletaw opened 6 years ago

adletaw commented 6 years ago

Error arises when problematic sections (#195) are commented out:

+--------------------------+
| Beginning report section |
+--------------------------+
pos 1
pos 2

Initial statistics: 288 variables; iteration 0; function evaluation 0; phase 5
Function value  -3.4773323e+03; maximum gradient component mag  -6.5210e+04

Intermediate statistics: 288 variables; iteration 50; function evaluation 57; phase 5
Function value  -3.9347267e+03; maximum gradient component mag   1.0052e+04
288 variables; iteration 100; function evaluation 109; phase 5
Function value  -4.1101173e+03; maximum gradient component mag   2.0217e+04
288 variables; iteration 150; function evaluation 159; phase 5
Function value  -4.3049686e+03; maximum gradient component mag  -1.5942e+04
288 variables; iteration 200; function evaluation 212; phase 5
Function value  -4.4420698e+03; maximum gradient component mag  -9.7185e+03
Error in matrix inverse -- matrix singular in inv(dmatrix)
Makefile:25: recipe for target 'run' failed
make: *** [run] Error 1
quantifish commented 6 years ago

Which directory are you trying to run this from?

adletaw commented 6 years ago

From within the model directory:

examples/bbrkc_2017/model_1

quantifish commented 6 years ago

I get a different issue:

+--------------------------+
| Beginning report section |
+--------------------------+
Index bounds do not match in dvector elem_prod(const dvector&, const dvector&)
Makefile:25: recipe for target 'run' failed
make: *** [run] Error 1
adletaw commented 6 years ago

Okay. I'm running it on Linux. You are on Mac right?

quantifish commented 6 years ago

Nah on linux too. I commented out a couple of sections that contain unfinished code and the model ran OK (but wasn't positive definite) - I've pushed these changes so give it a go and see how you get on.