Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

share|improve this question

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]
share|improve this answer

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.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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