Skip to content

BBall #60

Description

@mongibellili

Model

function bbal(du, u, p, t)
    du[1] =u[2]
    du[2] =-9.8- 0.018375*u[2]
    if u[1]<0 
        if  u[2]<-0.1  
            u[2]=-u[2] *0.8
        else
            t=Inf  # stop the simulation
        end
    end
end
u0 = [20.0,0.0]
tspan = (0.0, 15.0)
prob = ODEProblem(bbal, u0, tspan)
abstol=1e-3
reltol=1e-2
alg= liqss2()
sol = solve(prob, alg,reltol=reltol,abstol=abstol)

Results FT=15:

Image
liqss2:
The total simulation steps: 270
The number of events: 11
The number of state steps per Var: [251, 8]
  36.200 μs (59 allocations: 19.45 KiB) 
qss2:
The total simulation steps: 295
The number of events: 15
The number of state steps per Var: [257, 23]
  35.100 μs (50 allocations: 19.12 KiB)

Results FT=10:

liqss2 = 
The total simulation steps: 117
The number of events: 4
The number of state steps per Var: [105, 8]
  17.200 μs (59 allocations: 19.45 KiB)
qss2 = 
The total simulation steps: 137
The number of events: 8
The number of state steps per Var: [115, 14]
  17.600 μs (50 allocations: 19.12 KiB)

Raising the horizontal surface to 5.0 and FT=10

liqss2 = 
The total simulation steps: 81
The number of events: 8
The number of state steps per Var: [59, 14]
  13.900 μs (59 allocations: 19.45 KiB)
qss2 = 
The total simulation steps: 99
The number of events: 7
The number of state steps per Var: [76, 16]
  14.500 μs (50 allocations: 19.12 KiB)

More events until FT=100 (no dumping)

Image
liqss2:
The total simulation steps: 738
The number of events: 54
The number of state steps per Var: [599, 85]
  105.000 μs (61 allocations: 36.45 KiB)
qss2:
The total simulation steps: 924
The number of events: 62
The number of state steps per Var: [716, 146]
  117.700 μs (52 allocations: 36.12 KiB)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions