function output = struveh1approx2(x) % Struve H1 routine that evaluates the asymptotic expansion for large arguments and % the series expansion for small arguments % % Robert J. McGough % Michigan State University % 18 Dec 2005 ixle4 = find(x <= 4.7); x2 = x.^2; output(ixle4) = 2/pi * (x2(ixle4) / 3 - x2(ixle4).^2 / 3^2 / 5 + x2(ixle4).^3 / 3^2 / 5^2 / 7 - x2(ixle4).^4 / 3^2 / 5^2 / 7^2 / 9 + x2(ixle4).^5 / 3^2 / 5^2 / 7^2 / 9^2 / 11 - + x2(ixle4).^6 / 3^2 / 5^2 / 7^2 / 9^2 / 11^2 / 13); ixgt4 = find(x > 4.7); output(ixgt4) = 2/pi - sqrt(2 / pi ./ x(ixgt4)) .* cos(x(ixgt4) - pi / 4);