I am attempted to create a function with will be dynamically update when I input the initial parameters in the InputField space, but it doesn’t work, I misunderstand something here:
Both SetDelayed and Sum have the attribute HoldAll, also the n in your Sum is localized in the Sum and is not the n that you are changing globally --so you need to get your n into the definition via a Pure function.
I believe that the following works:
Dynamic@If[NumberQ[n], Function[nn,
f[t_] :=
Sum[A[[3 i - 2]] PDF[NormalDistribution[A[[3 i - 1]], A[[3 i]]],
t], {i, nn}]
][n]
]
Why is it that when put semicolon after your code, it doesn’t subsequently execute the Dynamic@Plot[f[t], {t, -10, 10}] command? What is special about the semicolon?
Another problem seems to be that when I use the function:
Dynamic@(If[NumberQ[n], f[t_]: = Sum[A[[3 i - 2]] PDF[NormalDistribution[A[[3 i - 1]], A[[3 i]]], t], {i, n}]])
the machine is getting close to freezing, while this version:
Dynamic@(If[NumberQ[n], f = Sum[A[[3 i - 2]] PDF[NormalDistribution[A[[3 i - 1]], A[[3 i]]], t], {i, n}]])