EDIT: I believe this is not a duplicate question, because the answers to questions pointed to as similar DO NOT give practical solutions to the problems, at least not for normal Mathematica users like me (not computer science experts) who are endlessly confused by the arcane details of Set, SetDelayed, Evaluate, etc.
I thank Karsten 7 here who produced a practical, usable answer
EDIT: in view of the questions below, in particular Bill's one, here is the puzzling code. Manipulate and the first Plot do not work, the last Plot does. Why???:
f[x_] = a + c x^2 + d x^3;
sol = Solve[{f[0] == f0, f[1] == f1, f'[1] == ff1, f'[0] == 0}, {a, c, d}, Reals];
g[t_, f0_, f1_, ff1_] := f[t] /. sol[[1]];
Manipulate[
Plot[g[t, f0, f1, ff1], {t, 0, 1}], {{f0, 0}, 0, 1}, {{f1, 1/2}, 0, 1}, {{ff1, 0}, -1, 0}]
Plot[g[t, 0.8, 0.9, -1/2], {t, 0, 1}]
Plot[g[t, f0, f1, ff1] /. {f0 -> 0.8, f1 -> 0.9, ff1 -> -1/2}, {t, 0, 1}]
Manipulate
. Have a look atManipulate[{a, Hold[a]}, {a, 0, 1}]
. $\endgroup$Manipulate[..., LocalizeVariables -> False]
is easier to understand and use than just about anything else. (Those to whom all variables being global is an abomination will shudder.) HTH. :) $\endgroup$f0
etc. do not appear in the literal (lexical), unevaluated RHSf[t] /. sol[[1]]
. This is related toSetDelayed
in that the substitution of the parameters is done before the RHS is evaluated. Sincet
is the only parameter appearing in the RHS, it is the only one substituted. Then the RHS is evaluated and global symbolsf0
etc. remain.Manipulate
by default localizes symbols, so that thef0
in it is different than the globalf0
ing[t]
. $\endgroup$InterpolatingPolynomial
:Manipulate[Plot[InterpolatingPolynomial[{{{0}, f0, 0}, {{1}, f1, ff1}}, t], {t, 0, 1}], {{f0, 0}, 0, 1}, {{f1, 1/2}, 0, 1}, {{ff1, 0}, -1, 0}]
. I would have answered your related question, but the value of the interpolating polynomial sometimes exceeds1
, violating a condition of that question. $\endgroup$