Say I have an expression of this sort:
Derivative[5][x1][t]+Derivative[3][x2][t]+x1[t]+Derivative[2][x1][t]
and so on...
I would like to ask Mathematica to neglext all expressions having derivatives higher than a given order (say N).
What would be a good solution for that?
Answer
Derivative[5][x1][t] + Derivative[3][x2][t] + x1[t] +
Derivative[2][x1][t] /. Derivative[k_][x_][t_] /; k >= 3 :> 0
x1[t] + (x1^[Prime][Prime])[t]
For understanding /;
see the documentation of Condition
.
Comments
Post a Comment