scottprahl / iad

Forward and Inverse Radiative Transport using the Adding-Doubling method
MIT License
22 stars 8 forks source link

Possible error in value initialisation? #9

Closed jgroehl closed 10 months ago

jgroehl commented 2 years ago

Dear Scott,

a student of mine @daniil1024 stumbled across this line in the iad code:

https://github.com/scottprahl/iad/blob/20bf2cc04b0c4937cba2e76330c4b9c2955b9a36/src/iad_pub.c#L463

It seems that it is supposed to be related to the total sphere area and as such would need an additional factor of 4?

double sphere = 4 * default_sphere_d * default_sphere_d; 

Possibly doesn't matter at all as it is just the initial guess, but it might be more correct this way?

Best wishes, Janek

scottprahl commented 10 months ago

My apologies. I forgot to look into this bug.

@daniil1024 and @jgroehl The sphere area is 𝜋d² but the port areas are 𝜋d²/4 so you are correct.

This is fixed in v13-3-2 (to be released soon) and makes a small sphere correction even smaller.