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

Test Sensitivity Method #1

Open
jiweiqi opened this issue Mar 23, 2021 · 3 comments
Open

Test Sensitivity Method #1

jiweiqi opened this issue Mar 23, 2021 · 3 comments

Comments

@jiweiqi
Copy link
Member

jiweiqi commented Mar 23, 2021

'h2o2 brute force'
p_diff = 5e-4
image

p_diff = 5e-3
image

p_diff = 5e-2
image

p_diff = 5e-1
image

@jiweiqi
Copy link
Member Author

jiweiqi commented Mar 23, 2021

'sens_BVP'

image

mthread=10
image

@jiweiqi
Copy link
Member Author

jiweiqi commented Mar 24, 2021

thread = 18 on Linux

![eigs](https://user-images.githubusercontent.com/8445647/112236163-45042200-8c16-11eb-8a85-93531cf0a9a9.png)

@jiweiqi
Copy link
Member Author

jiweiqi commented Mar 24, 2021

Debuging code

for i = 2:ng
        u = @view(pred[:, i])
        du = similar(u)
        i_F = 1 + (i - 1) * nu:i * nu - 1
        @view(Fp[i_F, :]) .= jacobian((du, x) -> dudt!(du, u, x, 0.0),
                                        du, p)::Array{Float64,2} .* (-idt)
        @view(Fy[i_F, i_F]) .= jacobian((du, x) -> dudt!(du, x, p, 0.0),
                                        du, u)::Array{Float64,2} .* (-idt)
    end
    @show sum(Fp) sum(Fy)
    @show sum(Fy[end-nu:end, end-nu:end])
    @show sum(Fy[end-20*nu:end, end-20*nu:end])

    @threads for i = 2:ng
        u = @view(pred[:, i])
        du = similar(u)
        i_F = 1 + (i - 1) * nu:i * nu - 1
        Fp[i_F, :] .= jacobian((du, x) -> dudt!(du, u, x, 0.0),
                                    du, p)::Array{Float64,2} .* (-idt)
    end
    @threads for i = 2:ng
        u = @view(pred[:, i])
        du = similar(u)
        i_F = 1 + (i - 1) * nu:i * nu - 1
        Fy[i_F, i_F] .= jacobian((du, x) -> dudt!(du, x, p, 0.0),
                                    du, u)::Array{Float64,2} .* (-idt)
    end
    @show sum(Fp) sum(Fy)
    @show sum(Fy[end-nu:end, end-nu:end])
    @show sum(Fy[end-20*nu:end, end-20*nu:end])

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

No branches or pull requests

1 participant