I would like to use ParametricPlot3D
in the following general way:
ParametricPlot3D[\[Sigma][u,v],{u,0,2Pi},{v,-f[u],f[u]}].
The problem is that my specific function f[u]
is defined via a numerical procedure (NMinimize
). Hence, although I obtain the desired plot, I also get some error messages.
Below is an example. (The specifics of the function f[u]
are totally unimportant, I just cooked it up.)
\[Sigma][u_, v_] = {Cos[u], Sin[u], v}
f[u_] := Evaluate[
v /. First[NDSolve[{v'[t] == 0, v[0] == u}, v, {t, 0, 2 Pi}]]][0]
ParametricPlot3D[\[Sigma][u, v], {u, 0, 2 Pi}, {v, -f[u], f[u]}]
Question: What is the best way to avoid the error messages displayed below? I am aware about the possibility of using RegionFunction
, but I am curious to know whether it can be avoided.
ReplaceAll::reps: {(v^\[Prime])[t]==0,v[0]==u} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
NDSolve::ndinnt: Initial condition u is not a number or a rectangular array of numbers.
ReplaceAll::reps: {(v^\[Prime])[t]==0,v[0]==u} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
ReplaceAll::argx: ReplaceAll called with 2 arguments; 1 argument is expected.
ReplaceAll::reps: {(v^\[Prime])[t]==0.,v[0.]==u} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
General::stop: Further output of ReplaceAll::reps will be suppressed during this calculation.
ReplaceAll::argx: ReplaceAll called with 2 arguments; 1 argument is expected.
NDSolve::ndinnt: Initial condition u is not a number or a rectangular array of numbers.
ReplaceAll::argx: ReplaceAll called with 2 arguments; 1 argument is expected.
General::stop: Further output of ReplaceAll::argx will be suppressed during this calculation.
NDSolve::ndinnt: Initial condition u is not a number or a rectangular array of numbers.
General::stop: Further output of NDSolve::ndinnt will be suppressed during this calculation.