ChrisCurrin/multi-compartment_multi-anion

Diffusion causes numerical instability

ChrisCurrin opened this issue · 4 comments

With diffusion changing the value of e.g. cli for compartments, an error is encountered in Compartment step function:
`RuntimeWarning: invalid value encountered in log

dcl = _time.dt * self.Ar * (gcl * (self.V + R * np.log(self.clo / self.cli)) - self.jkcc2)`

Please advise on diffusion calculation and updating of values

Sounds like you need some backwards Euler!

Sent from a smartphone

On 26 Aug 2016 18:54, "Christopher" notifications@github.com wrote:

With diffusion changing the value of e.g. cli for compartments, an error
is encountered:
RuntimeWarning: invalid value encountered in log
dcl = _time.dt * self.Ar * (gcl * (self.V + R * np.log(self.clo /
self.cli)) - self.jkcc2)

Please advise on diffusion calculation and updating of values


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIFhTbV5JXJwZHucE2x23kWLT64N0VYKks5qjxmFgaJpZM4JuQ3w
.

Or Ranga - Katta!

On Fri, 26 Aug 2016, 20:52 pyjamashark notifications@github.com wrote:

Sounds like you need some backwards Euler!

Sent from a smartphone

On 26 Aug 2016 18:54, "Christopher" notifications@github.com wrote:

With diffusion changing the value of e.g. cli for compartments, an error
is encountered:
RuntimeWarning: invalid value encountered in log
dcl = _time.dt * self.Ar * (gcl * (self.V + R * np.log(self.clo /
self.cli)) - self.jkcc2)

Please advise on diffusion calculation and updating of values


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AIFhTbV5JXJwZHucE2x23kWLT64N0VYKks5qjxmFgaJpZM4JuQ3w

.


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AH0c_hXWZat3jIa_CAjej55ARl0yfLveks5qjzXlgaJpZM4JuQ3w
.

Latest changes appear to have diffusion working to a reasonable
extent. Values may need to be tweaked to be realistic, but it works in
principle.
I shall push changes tonight when I have Internet

On 26/08/2016, Christopher chris.crisur@gmail.com wrote:

Or Ranga - Katta!

On Fri, 26 Aug 2016, 20:52 pyjamashark notifications@github.com wrote:

Sounds like you need some backwards Euler!

Sent from a smartphone

On 26 Aug 2016 18:54, "Christopher" notifications@github.com wrote:

With diffusion changing the value of eg cli for compartments, an error
is encountered:
RuntimeWarning: invalid value encountered in log
dcl = _time.dt * self.Ar * (gcl * (self.V + R * np.log(self.clo /
self.cli)) - self.jkcc2)

Please advise on diffusion calculation and updating of values


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIFhTbV5JXJwZHucE2x23kWLT64N0VYKks5qjxmFgaJpZM4JuQ3w
.


You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.

Chris

I'm going to close this issue for now. The exact values/implementation may need tweaking, but works in principle