Hello,
I want to use a variable in a formula multiple times without having to enter the same values more than once. For example, the effective half-life of radionuclide after ingestion is defined as:
effectiveHalflife[physicalHalflife_, biologicalHalflife_] :=
(physicalHalflife * biologicalHalflife) / (physicalHalflife + biologicalHalflife)
The residual mass after some elapsed time then would be:
residualMass[n0_, time_, physicalHalflife_, biologicalHalflife_] :=
n0 * 0.5^(time/effectiveHalflife[physicalHalflife, biologicalHalflife])
I now want to build a widget of this formula, but I can't find out how to reuse physical- and biological halflife without having to enter these twice. Say I already have this template:
[//quantity:${ingestedMass}//] * 0.5^
([//quantity:${elapsedTime}//] /
([//quantity:${phyHl}//] * [//quantity:${bioHl}//] /
([//quantity:${phyHl}//] + [//quantity:${bioHl}//])
)
)
How would reuse phyHl and bioHl without having to enter these values twice?
Thanks,
Alex.