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[0] == Table[1, 4],
v'[x] == Sin[x], v[0] == 0},
Exp[-v[4]]*Sin[v[4] + 1] Y[4].Y[4], {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[0]==Table[1,4], v'[x]==Sin[x], v[0]==0},
Unevaluated @ func[v[4],Y[4]],
{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