Cody

Problem 45976. Evaluate the Struve function

Solution 2598361

Submitted on 22 Jun 2020 by Tim
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 0; p = randi(8,1); Hp_correct = 0; assert(isequal(StruveFn(p,x),Hp_correct))

2   Pass
x = 0.4; p = 0; Hp_correct = 0.2501497138634162; assert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct<1e-6)

3   Pass
x = 10; p = 0; Hp_correct = 0.1187436836875042; assert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct<1e-6)

4   Pass
x = rand(1); p = 1/2; Hp_correct = sqrt(2/(pi*x))*(1-cos(x)); assert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct<1e-6)

5   Pass
x = 4.2; p = 1; Hp_correct = 1.036818631956923; assert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct<1e-6)

6   Pass
x = pi^2; p = 3; Hp_correct = 4.10841348624688; assert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct<1e-6)