Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITP method implementation #67

Closed
wants to merge 17 commits into from
Closed

ITP method implementation #67

wants to merge 17 commits into from

Conversation

yash2798
Copy link
Member

Tackles this #184

@codecov
Copy link

codecov bot commented Jun 23, 2023

Codecov Report

Merging #67 (6a1a40f) into main (b2a43e0) will decrease coverage by 89.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #67       +/-   ##
==========================================
- Coverage   92.30%   3.25%   -89.05%     
==========================================
  Files          16      17        +1     
  Lines         819     859       +40     
==========================================
- Hits          756      28      -728     
- Misses         63     831      +768     
Impacted Files Coverage Δ
src/SimpleNonlinearSolve.jl 33.33% <ø> (-60.01%) ⬇️
src/itp.jl 0.00% <0.00%> (ø)

... and 15 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

src/itp.jl Outdated Show resolved Hide resolved
@yash2798
Copy link
Member Author

@ChrisRackauckas I am kinda confused why such an error in only some test cases is happening. Do you have any inputs that might help? The code seems alright but maybe can you review it once?

@ChrisRackauckas
Copy link
Member

How much has the solution converged?

@yash2798
Copy link
Member Author

How much has the solution converged?

The solution (root of the function) has converged well upto the tolerance. This can be also be seen as the tests for this also pass. Just the AD tests fail only for a handful values for the parameter p.

@yash2798
Copy link
Member Author

`g = function (p)
probN = IntervalNonlinearProblem{false}(f, typeof(p).(tspan), p)
sol = solve(probN, Itp())
return sol.u
end

for p in 1.1:0.1:100.0
@test g(p) ≈ sqrt(p)
@test ForwardDiff.derivative(g, p) ≈ 1 / (2 * sqrt(p))
end`

All these tests @test g(p) ≈ sqrt(p) pass.

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Jun 30, 2023

How close to zero is the evaluation?

@ChrisRackauckas
Copy link
Member

Try and recreate the derivative calculation in the REPL: https://github.com/SciML/SimpleNonlinearSolve.jl/blob/main/src/ad.jl#L2-L28

@yash2798
Copy link
Member Author

okay i'll take a look

@yash2798
Copy link
Member Author

yash2798 commented Jul 6, 2023

@ChrisRackauckas I tried doing the derivative calc in the repl but nothing significant came up. Also, I am a little confused about what this function scalar_nlsolve_ad does? I can see that it is called in some dispatches written down after that but if I am not mistaken i don't see any dispatches that handle any algorithm except the Bisection one?

for Alg in [Bisection]

@yash2798 yash2798 changed the title [WIP] ITP method implementation ITP method implementation Jul 10, 2023
@ChrisRackauckas
Copy link
Member

It looks like there are test failures?

@oscardssmith
Copy link
Contributor

The broad strokes of this look good.

@yash2798
Copy link
Member Author

The broad strokes of this look good.

@oscardssmith you mean some scope for improvement still left?

@oscardssmith
Copy link
Contributor

I just mean that all the tests seem to suggest that it is broken.

@yash2798 yash2798 closed this Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants