So Metropolis-Hastings for example is a probabilistic algorithm. You don't need a probabilistic algorithm. (Well, you do when you want to estimate your physiological parameters, the Bayesian stuff and so on, but that is a whole separate can of worms). I didn't look too carefully at your objective function but it looked continuous - small perturbations in input mean small changes in the objective function. Like hypoglycemic readings, you can easily calculate "how hypoglyemic" rather than a yes/no. Naturally there are places where the objective function isn't continuous and that's where you have to do a discrete-style search, but when it's mostly continuous there are well-known numerical methods. Like check out
https://docs.scipy.org/doc/scipy/reference/optimize.html, it isn't necessarily what you need but looking up the Wikipedia pages of the method names will be helpful. I've also found ChatGPT knows an insane amount of math, I wouldn't trust it to write a specific algorithm but it can give intelligent comparisons and list similar algorithms.
What I was saying is I don't think N_51 is the right way to model a dose. I would model it as a real number in the interval [0,50]. I would still round whatever the model gave to what I could actually measure out decently, but within the model I would not use discrete numbers.