Hover over the menu bar to pick a physics animation.

TextBox Arrray Created Using Javascript

Reason for this Utility Program

We often need and indefinite number of html elements for a program. While it is possible to form these by copy and paste inside the .html code, this method is not extensible. javascript has the document.createElement() method that creates an element. This element can be styled using the .style. method. After styling, the element can be added to to the dcument body using the document.body.appendChild() method. This child element cannot be modified on the .html page except through javascript.

What this utility does

The utility creates 24 textBoxes representing the 24 hours of an earth day. The original concept was for the client to select some checkboxes to represent times when a medicine dose was taken. From these dose times and the half lives of the medicine we could compute the amount of medicine still in effect in the body at any later time. It is assumed that the dose is the same on subsequent days. Other uses of the utility are, for example, temperature processing of materials such as semiconductors all of which have definite dopant diffusion rates.

Instead, here we have added a new variable which is dose amount at any chosen hour. As an extension of the utility, if dosage is not the same on subsequent days, using this program as a template, we can easily provide additional 24 textBox arrays that represent these subsequent days.

Decay of Medical Doses

Since the residual medicine will decay exponentially, the remaining medicine at time `t` is:

`"residual(t)"=sum_(i=0)^(t_d(i)ltt)exp(-(t-(t_d(i)))/tau_e)`      

where the exponential time constant, `tau_e`, is:

`tau_e=-tau_(1/2)/log_e(1/2)`

and the time of the dose, `t_d(i)`, is determined by the checked checkbox number times 1 hour.