I have created a function like the following, which contains an ODE system. And I want to know the effect of different parameters.
myodessystem[k1_, k2_, time_] := Module[{odes, y, x, sol, myfun},
odes = {y'[x] == k1 y[x] Cos[k2 x + y[x]], y[0] == 1};
sol = NDSolve[odes, y, {x, 0, time}];
myfun = y[x] /. sol
]
But I can not get the solutions I want:
mysolve = myodessystem[1, 1, 30]
(* {InterpolatingFunction[{{0., 30.}}, <>][x$12879]} *)
And it does not work when I assign a value to the result function:
mysolve[10]
(* {InterpolatingFunction[{{0., 30.}}, <>][x$12879]}[10] *)
How can I get the solution of the ODE and get the result value when I assign a value to it?