可以用collect()简化v的表达式。实现过程:
syms u p
x=u.*cos(20)*cos(v);
y=u.*cos(20)*sin(v); %(1)
z=u.*sin(20)+p.*v;
n1= p.*cos(20).*sin(v)-(u.*cos(20)*sin(20)*cos(v));
n2=-p.*cos(20).*cos(v)-(u.*cos(20)*sin(20)*sin(v)); %(2)
n3=u.*(cos(20))^2;
eq=vpa(z.*n1+a.*cot(20).*n2+(a-x+p.*cot(20))*n3);
collect(eq)