Cody

# Problem 45982. Evaluate the incomplete elliptic integrals

Solution 3894578

Submitted on 28 Nov 2020 by cokakola
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
m = 16/25; phi = pi/7; n = 0.2; F_correct = 0.458608414805464; E_correct = 0.439360453883539; Pi_correct = 0.464765785383336; [F,E,Pi] = ellipticIntegrals(m,phi,n); errorF = abs(F-F_correct)/F_correct; errorE = abs(E-E_correct)/E_correct; errorPi = abs(Pi-Pi_correct)/Pi_correct; assert(all([errorF errorE errorPi] < 1e-8))

2   Pass
m = 16/25; phi = pi/2; n = 0.2; F_correct = 1.995302777664729; E_correct = 1.276349943169906; Pi_correct = 2.262478943418680; [F,E,Pi] = ellipticIntegrals(m,phi,n); errorF = abs(F-F_correct)/F_correct; errorE = abs(E-E_correct)/E_correct; errorPi = abs(Pi-Pi_correct)/Pi_correct; assert(all([errorF errorE errorPi] < 1e-8))

3   Pass
m = 1/64; phi = pi/3; n = 0.4; F_correct = 1.049610464554263; E_correct = 1.044793820490869; Pi_correct = 1.203999963286716; [F,E,Pi] = ellipticIntegrals(m,phi,n); errorF = abs(F-F_correct)/F_correct; errorE = abs(E-E_correct)/E_correct; errorPi = abs(Pi-Pi_correct)/Pi_correct; assert(all([errorF errorE errorPi] < 1e-8))

4   Pass
m = 1/40; phi = pi/3; n = 0.35; F_correct = 1.051071572767161; E_correct = 1.043347162655471; Pi_correct = 1.182205359771783; [F,E,Pi] = ellipticIntegrals(m,phi,n); errorF = abs(F-F_correct)/F_correct; errorE = abs(E-E_correct)/E_correct; errorPi = abs(Pi-Pi_correct)/Pi_correct; assert(all([errorF errorE errorPi] < 1e-8))

5   Pass
m = 0; phi = rand(1); n = 0.4; F_correct = phi; E_correct = phi; [F,E,~] = ellipticIntegrals(m,phi,n); errorF = abs(F-F_correct)/F_correct; errorE = abs(E-E_correct)/E_correct; assert(all([errorF errorE] < 1e-8))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!