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

Update QNDF to new nlsolver #1165

Merged
merged 3 commits into from
Jun 6, 2020
Merged

Conversation

utkarsh530
Copy link
Member

No description provided.

@ChrisRackauckas
Copy link
Member

How's the latest benchmark? I assume that this would "fix it".

@utkarsh530
Copy link
Member Author

utkarsh530 commented Jun 5, 2020

Before:
wp_all_prev

After:
image
@ChrisRackauckas

@.. tmp = (uprev + tm - ϕ)/ (dt * β₀)

else
dz = nlsolver.cache.dz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am out of sync due to the MLH things, but we don't handle mass matrix intrinsically in nlsolve? tmp depending on mass matrix sounds spectical

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is right.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright 👍 I need to see the new nlsolver changes.


@test _norm_dsol(QNDF1(),prob,prob2) ≈ 0 atol=1e-12
@test _norm_dsol(QNDF2(),prob,prob2) ≈ 0 atol=1e-12
@test _norm_dsol(QNDF(),prob,prob2) ≈ 0 atol=1e-7
@test _norm_dsol(QNDF(),prob,prob2) ≈ 0 atol=1e-12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is nice

@utkarsh530 utkarsh530 closed this Jun 5, 2020
@utkarsh530 utkarsh530 reopened this Jun 5, 2020
@utkarsh530
Copy link
Member Author

utkarsh530 commented Jun 5, 2020

I updated the plots slightly for better comparison (due to ode15s).
Let me know if any changes are required.
@ChrisRackauckas @YingboMa

Comment on lines +748 to +760
nlsolver.z = uprev + sum(D)

mass_matrix = f.mass_matrix

if mass_matrix == I
nlsolver.tmp = @.. (u₀ - ϕ)/ (dt * β₀)
else
_tmp = mass_matrix * @.. (u₀ - ϕ)
nlsolver.tmp = @.. _tmp / (dt * β₀)
end
nlsolver.γ = β₀
nlsolver.α = α₀
nlsolver.method = COEFFICIENT_MULTISTEP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit surprised about the mix of broadcasted and non-broadcasted expressions (not only in these lines, here it would be just uprev .+ sum(D), but also above e.g. in ϕ += γₖ[i] * D[i]). Shouldn't we consistently use broadcasting? Or does it still impact performance?

Copy link
Member Author

@utkarsh530 utkarsh530 Jun 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree, actually, there's some dimensional problem like that D is 1x5 matrix and γ is 6-Array, hence probably the person who did before looped using []; it was originally defined like that. We can change it probably for more consistent operation using broadcast, maybe in another PR.

@YingboMa
Copy link
Member

YingboMa commented Jun 5, 2020

Why are there two QNDFs in the plots? Is it one QNDF and one QBDF? Which one is better? The WPD curve looks really suspicious since the convergence looks erratic.

@utkarsh530
Copy link
Member Author

Why are there two QNDFs in the plots? Is it one QNDF and one QBDF? Which one is better? The WPD curve looks really suspicious since the convergence looks erratic.

The 'inverted green triangle' legend is QBDF and the other one is QNDF.

@YingboMa
Copy link
Member

YingboMa commented Jun 5, 2020

Do you mind to benchmark QNDF/QBDF against TRBDF2, QBDF2, ABDF2, Trapezoid, and Rosenbrock23?

@ChrisRackauckas
Copy link
Member

Looks like it didn't move... which is odd.

@utkarsh530
Copy link
Member Author

Do you mind to benchmark QNDF/QBDF against TRBDF2, QBDF2, ABDF2, Trapezoid, and Rosenbrock23?

Before:

wp_all_prev
After:
wp_all_new

@YingboMa
Copy link
Member

YingboMa commented Jun 5, 2020

What's the benchmark problem?

@utkarsh530
Copy link
Member Author

utkarsh530 commented Jun 5, 2020

POLLU, with testsol as Rodas5

@utkarsh530
Copy link
Member Author

@YingboMa any further changes to be done? The build is passing here

@ChrisRackauckas ChrisRackauckas merged commit 6101844 into SciML:master Jun 6, 2020
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.

5 participants