Hide details of ParametricFunction

I use ParametricNDSolve to return a particular combination of the (vector) variables, at the end of the integration range.

This gives a ParametricFunction with the gory details in the output box, that I would like to hide if possible: A smaller definite example:

f = ParametricNDSolveValue[{Y'[x] == q Y[x], Y == Table[1, 4],
v'[x] == Sin[x], v == 0},
Exp[-v]*Sin[v + 1] Y.Y, {x, 0, 4}, q];

Then if I ask for f, I get the full description:

f Is there a neat way to do this, that will not slow down the evaluation at parameter values?

• What about ; after ParametricNDSolveValue[[...]? – Ulrich Neumann Jun 5 at 14:37
• The function is the output of one function, to then be used later on in my package for finding roots, plotting etc. I know this is a small thing, but people are likely to just use the first function without a semicolon at the end. – KraZug Jun 5 at 15:04

You could use a function as the second argument:

func[a_, b_] := Exp[-a] Sin[a+1] b.b
g = ParametricNDSolveValue[
{Y'[x]==q Y[x], Y==Table[1,4], v'[x]==Sin[x], v==0},
Unevaluated @ func[v,Y],
{x, 0, 4},
q
] It still works:

f /@ Range[0, 4]
g /@ Range[0, 4]

{0.358834, 1069.67, 3.18864*10^6, 9.5052*10^9, 2.83346*10^13}

{0.358834, 1069.67, 3.18864*10^6, 9.5052*10^9, 2.83346*10^13}

• Thank you. I tried something similar with Hold but that didn't work. – KraZug Jun 5 at 19:21