How to extract coefficient in maple?
I'm using maple for differentiatio开发者_如何转开发n eguation. And I have a problem. I want to express the d/dt(alpha(t))
variable held constant from this equation (a part for example):
-2*(diff(alpha(t), t))*sin(beta(t))*(diff(beta(t), t))*cos(psi(t))*
cos(theta(t))-2*(diff(alpha(t), t))*cos(beta(t))*sin(psi(t))*(diff(psi(t),t))*
cos(theta(t))-2*(diff(alpha(t), t))*cos(beta(t))*cos(psi(t))*sin(theta(t))*
(diff(theta(t), t))-2*(diff(beta(t), t))*sin(alpha(t))^2*(diff(alpha(t),t))*
cos(beta(t))*sin(psi(t)).
Any help is appropriate. Thanks
You can do this with a substitution. For example, let's assume that the large output involving derivatives was produced by running some code that I'll abbreviate as 'mycode;'. Then you can do this:
output := mycode;
new_output := subs(diff(alpha(t), t) = v,output);
Then, in new_output, instance of the symbol diff(alpha(t), t) will be replaced by the symbol v, and then you can use a function like coeff to strip the coefficients of v. This way, you can figure out what the trig-polynomial representation of output is.
精彩评论