Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Calcified fraction (possibly) not calculated correctly in standard_volume_update_function #133

Closed
JulianoGianlupi opened this issue Jan 19, 2023 · 5 comments

Comments

@JulianoGianlupi
Copy link

In PhysiCell_standard_models.cpp's standard_volume_update_function I believe the calcified fraction update is not correct. All dynamic volumes except it are updated following a forward Euler method, e.g.

phenotype.volume.fluid += dt * phenotype.volume.fluid_change_rate * ( phenotype.volume.target_fluid_fraction * phenotype.volume.total - phenotype.volume.fluid );

The calcified fraction update does not have the + in the +=. It reads

phenotype.volume.calcified_fraction = dt * phenotype.volume.calcification_rate * (1- phenotype.volume.calcified_fraction);

This means the cell will never calcify completely, it's calcified fraction will fluctuate around dt * phenotype.volume.calcification_rate

@JulianoGianlupi
Copy link
Author

Going by equation 37 in supplemental information 1 of PhysiCell's paper the intention was for the equation to read

phenotype.volume.calcified_fraction += dt * phenotype.volume.calcification_rate * (1- phenotype.volume.calcified_fraction);

@JulianoGianlupi
Copy link
Author

Addressed in Pull Request #134

@MathCancer
Copy link
Owner

@JulianoGianlupi thank you so much!! This is a very good catch! (And we need to catch up, by the way!)

I'll make sure this gets folded into PhysiCell 1.11.0.

@MathCancer
Copy link
Owner

Actually, i want to take a closer look ...

This is the line (Line 548) that adds the extra calcification:

		* (1- phenotype.volume.calcified_fraction);```
		
You're right that it SHOULD be 		
		
```phenotype.volume.calcified_fraction += dt * phenotype.volume.calcification_rate 
		* (1- phenotype.volume.calcified_fraction);```

From what I can see, the PR mistakenly changes a different line instead: 

from: ```phenotype.volume.fluid_fraction = phenotype.volume.fluid / ```

to: ```phenotype.volume.fluid_fraction += phenotype.volume.fluid / ```


@MathCancer
Copy link
Owner

Will now be fixed in 1.11.0, thanks to you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants