This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| simulate_concentration <- function(sequence_string, | |
| total_days = 14, | |
| half_life_hours = 30, | |
| dose = 100) { | |
| # sequence_string: e.g., "AAAAAAABBBBBBB" (length == total_days) | |
| # returns hourly concentration in relative units under first-order elimination | |
| # Precompute constants locally (avoid hidden global dependencies) | |
| k <- log(2) / half_life_hours | |
| total_hours <- total_days * 24 |