How can I plot the product of the NDSolve result, e.g. x[t]/.solution and any known function, for instance, Sin[x]?


2 Answers 2


In the examples you find:

Plot[Evaluate[y[t] /. s], {t, 0, 30}, PlotRange -> All]

Expand it like this for the product with Sin[t]:

Plot[Evaluate[y[t] /. s] * Sin[t], {t, 0, 30}, PlotRange -> All]

If you meant Sin[x], then I suppose something like

 Plot[Evaluate[Sin[x[t]] /. solution], {t, 0, 20}]

is what you're after. In this case, the term "product" should be read as "composition."

If, on the other hand, you meant to multiply the solution by Sin[t], then perhaps

Plot[Evaluate[Sin[t] x[t] /. solution], {t, 0, 20}]

will do. (Evaluate has to be the Head of the argument for it to override the HoldAll attribute of Plot.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.