Hi, I am using the symbolic math toolbox to find an expression for the sine of an angle I do have the cosine of, defined as such:
syms theta_Za cos_theta_Zb phi_Za N theta_ab phi_ab theta_b phi_b real
Tay_ord = 5 %truncation order for the Taylor series expansion
A = 3/(8*pi)*sin(theta_Za)*sin(theta_ab)*exp(-1i*(phi_Za-phi_ab));
B = 3/(4*pi)*cos(theta_Za)*cos(theta_ab);
C = 3/(8*pi)*sin(theta_Za)*sin(theta_ab)*exp(1i*(phi_Za-phi_ab));
cos_theta_Zb = ((4*pi)/3)*(A+B+C);
So the most straightforward way of doing this was to include in the expression I need (polX_b) the sine of the arccosine of cos_theta_Zb:
polX_b = (1-exp(-N.*sin(acos(cos_theta_Zb))*cos(phi_b)));
Although, MATLAB does not seem to handle this properly and when I try to include polX_b in the calculation I am interested to perform (Taylor series expansion followed by term by term integration of a product of polX_b and three other (1-exp(...)) expression) I cannot find a closed form solution of the integral. Code shown below:
polZ_a = (1-exp(-N.*cos(theta_Za)));
polZ_b = (1-exp(-N.*(cos_theta_Zb)));
polX_a =(1-exp(-N.*(sin(theta_Za)*cos(phi_Za))));
ZZXX_2_osc = (polZ_a)*(polZ_b)*(polX_a)*(polX_b);
Tay_ZZXX_2_osc = (taylor(ZZXX_2_osc,N,0,'Order',Tay_ord));
int_theta_Tay_ZZXX = simplify((int(Tay_ZZXX_2_osc*sin(theta_Za), theta_Za, [0 pi],'IgnoreAnalyticConstraints',true)))
What could be the most convenient way of fixing this script?
Thanks a lot in advance