[ADOL-C] sparse jacobian: inf's and nan's in non-zeros values array
Antoine De Blois
antoine.deblois at aero.bombardier.com
Tue Mar 26 13:52:10 EDT 2013
Hi Kshitij,
Thank you for your response.
Yes the inf's and nan's appear at the same taping point. I will try what you suggest for the seed matrix. In the meantime, I was able to make my code work by spotting where the nan was coming from. I simply changed the following line from:
pow(fabs(spi)),zeta);
to
pow(fabs(spi)+epsilon,zeta);
The question remains why it works fine for the dense jacobian and not for the sparse one. Let's see what the seed matrix tells us. I'll keep you posted.
Regards,
Antoine
-----Message d'origine-----
De : adol-c-bounces at list.coin-or.org [mailto:adol-c-bounces at list.coin-or.org] De la part de Kshitij Kulshreshtha
Envoyé : Tuesday, March 26, 2013 1:15 PM
À : adol-c at list.coin-or.org
Objet : Re: [ADOL-C] sparse jacobian: inf's and nan's in non-zeros values array
Hello,
Are the inf's and nan's happening at the same evaluation point as the taping point?
Since the number of dependents in your function are quite small you may try to invoke the vector reverse mode for computing the dense jacobian.
It will require as seed matrix the identity matrix of 5x5 size. If this still gives you inf's and nan's there is something inherently wrong in the function which is doing invalid operations like division by zero.
Once the first inf occurs, any further computation will create nan's.
There are ways to stop the evaluation in a debugger whenever an invalid arithmetic operation occurs. This will lead you to the first occurance of an inf or nan.
However if the dense jacobian is correct and free of inf's and nan's, try to print out the seed matrix used for sparse jacobian computation and see if it has any inf's or nan's.
If all else fails, we'll need to look at your code (or any example that reproduces the problem).
Best
Kshitij.
As on 22.03.2013 15:21h, Antoine De Blois did write:
> Hi everyone,
>
>
>
> I created a ticket on the trac system, but I don’t know which is the
> preferred way (trac or mailing list) please advise. Here is my problem:
>
>
>
> I am trying to solve the jacobian of a residual function in my
> structured CFD solver. In my application, I have 5 dependent
> variables and roughly
>
> 1700 independent variables. The number of non-zero values in the
> jacobian matrix is roughly 200, hence the usage of the sparse_jac driver.
>
>
>
> The jacobian driver works perfectly fine, but I obtain inf's and nan's
> in the non-zeros values array. Note that the row and column index
> arrays are fine when compared to the entire matrix output of the
> jacobian driver. I tried changing the option array without success.
>
>
>
> I was using version 2.3.0 and recently upgraded to 4.3.1 with the same
> behavior. I am using colpack version 1.0.9.
>
>
>
> Can you please help me with my problem?
>
> Thank you for your time,
>
> Antoine
>
>
>
> _______________________________________________
> ADOL-C mailing list
> ADOL-C at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/adol-c
--
Dr. Kshitij Kulshreshtha
Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.
Büro: A3.235
Privatanschrift:
Arnikaweg 62
33100 Paderborn.
_______________________________________________
ADOL-C mailing list
ADOL-C at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/adol-c
More information about the ADOL-C
mailing list