Cody

# Problem 43285. Solve equation numerically

Solution 1025868

Submitted on 21 Oct 2016 by Abhishek Jain
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
h=0.1 y1=1 y_correct = 2.3579; assert(abs(e1solver(h,y1)-y_correct)<0.01)

h = 0.1000 y1 = 1 y = 1 y = 1.0000 1.1000 y = 1.0000 1.1000 1.2100 y = 1.0000 1.1000 1.2100 1.3310 y = 1.0000 1.1000 1.2100 1.3310 1.4641 y = 1.0000 1.1000 1.2100 1.3310 1.4641 1.6105 y = 1.0000 1.1000 1.2100 1.3310 1.4641 1.6105 1.7716 y = 1.0000 1.1000 1.2100 1.3310 1.4641 1.6105 1.7716 1.9487 y = 1.0000 1.1000 1.2100 1.3310 1.4641 1.6105 1.7716 1.9487 2.1436 y = Columns 1 through 9 1.0000 1.1000 1.2100 1.3310 1.4641 1.6105 1.7716 1.9487 2.1436 Column 10 2.3579 z = 2.3579

2   Pass
clc clear h=0.1 y1=2 y_correct = 4.7159; assert(abs(e1solver(h,y1)-y_correct)<0.01)

h = 0.1000 y1 = 2 y = 2 y = 2.0000 2.2000 y = 2.0000 2.2000 2.4200 y = 2.0000 2.2000 2.4200 2.6620 y = 2.0000 2.2000 2.4200 2.6620 2.9282 y = 2.0000 2.2000 2.4200 2.6620 2.9282 3.2210 y = 2.0000 2.2000 2.4200 2.6620 2.9282 3.2210 3.5431 y = 2.0000 2.2000 2.4200 2.6620 2.9282 3.2210 3.5431 3.8974 y = 2.0000 2.2000 2.4200 2.6620 2.9282 3.2210 3.5431 3.8974 4.2872 y = Columns 1 through 9 2.0000 2.2000 2.4200 2.6620 2.9282 3.2210 3.5431 3.8974 4.2872 Column 10 4.7159 z = 4.7159