Hello all. I am not an experienced Mathematica user; been using it for the past year or so. I am completely self-taught.
I have some successful and useful notebooks that I have been using. I then got the idea of exporting them as CDFs to share with others and discovered that I am doing a lot wrong. The first issue was simple: add "SaveDefinities -> True" to all my Manipulate statements. Worked fine if all my control objects are kept within the Manipulate function. However, I tried to get a bit fancier and then ran into trouble. I am completely lost where "Dynamic" (or related) functions belong.
I have tried to condense what I working on into a skeleton script, below. As a CDF, when this file first opens up, it doesn't know default values for v0m, viu, etc. How do I correctly specify them? Feel free to also comment/criticize on my overall approach. I now this script doesn't make any sense; it is just a mock up of my much larger script, which I am happy to share if people want.
Thanks in advance!
cal[v0m_, viu_, maxI_] := (v0m + viu + maxI);
v0m = 1;
viu = 2;
maxI = 3;
model = 1;
resLigand = False;
Grid[{
{"Binding Model",
SetterBar[
Dynamic[model], {1 -> "One Site", 2 -> "Two Independent Sites",
3 -> "Two Cooperative Sites"}]},
{"Residual Ligand?", Checkbox[Dynamic[resLigand]]},
{"Cell Volume (mL)", InputField[Dynamic[v0m]]},
{"Injection Volume (uL)", InputField[Dynamic[viu]]},
{"Number of Injections", InputField[Dynamic[maxI], Number]},
{Dynamic@Switch[model + Switch[resLigand, False, 0, True, 3],
1, Manipulate[(output = cal[v0m, viu, maxI];
output + model + variable +
Switch[resLigand, False, 0, True, 3]), {variable, 0.1, 1.0}],
2, Manipulate[(output = cal[v0m, viu, maxI];
output + model + variable +
Switch[resLigand, False, 0, True, 3]), {variable, 0.1, 1.0}],
3, Manipulate[(output = cal[v0m, viu, maxI];
output + model + variable +
Switch[resLigand, False, 0, True, 3]), {variable, 0.1, 1.0}],
4, Manipulate[(output = cal[v0m, viu, maxI];
output + model + variable +
Switch[resLigand, False, 0, True, 3]), {variable, 0.1, 1.0}],
5, Manipulate[(output = cal[v0m, viu, maxI];
output + model + variable +
Switch[resLigand, False, 0, True, 3]), {variable, 0.1, 1.0}],
6, Manipulate[(output = cal[v0m, viu, maxI];
output + model + variable +
Switch[resLigand, False, 0, True, 3]), {variable, 0.1, 1.0}]
]}
}]