Cody

Problem 45982. Evaluate the incomplete elliptic integrals

Solution 2606983

Submitted on 24 Jun 2020 by Tim
  • Size: 73
  • This is the leading solution.
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 = 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))

Suggested Problems

More from this Author50

Community Treasure Hunt

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

Start Hunting!