Skip to content

Commit

Permalink
Update Fermi demo
Browse files Browse the repository at this point in the history
  • Loading branch information
henry2004y committed Oct 29, 2024
1 parent 112e206 commit 6cd409b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions docs/examples/advanced/demo_fermi_foreshock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ tspan = (0, 40)
## Number of particles
trajectories = 1000;

# Case 1: 0 core field
# **Case 1**: 0 core field

param = prepare(E, Bcase1; species=Electron);
prob = ODEProblem(trace!, stateinit, tspan, param)
Expand All @@ -262,13 +262,19 @@ imax = find_max_acceleration_index(sols)
f = plot_multiple(sols[imax])
f = DisplayAs.PNG(f) #hide

# Trajectory of the most accelerated electron.

f = plot_dist(sols, t=tspan[1], case=1, slice=:xy)
f = DisplayAs.PNG(f) #hide

# Initial velocity distribution.

f = plot_dist(sols, t=tspan[2], case=1, slice=:xy)
f = DisplayAs.PNG(f) #hide

# Case 2: B fluctuation core field
# Final velocity distribution

# **Case 2**: B fluctuation core field
# In this case we use the native Boris pusher for demonstration. The smallest electron gyroperiod in the magnetosheath (B ∼ 20 nT) is about $2\times 10^{-3}\,\mathrm{s}$, and we use a time step $\Delta t = 2\times 10^4\mathrm{s}$.

const δBfunc = let
Expand All @@ -287,8 +293,14 @@ imax = find_max_acceleration_index(sols)
f = plot_multiple(sols[imax])
f = DisplayAs.PNG(f) #hide

# Trajectory of the most accelerated electron.

f = plot_dist(sols, t=tspan[1], case=2, slice=:xy)
f = DisplayAs.PNG(f) #hide

# Initial velocity distribution.

f = plot_dist(sols, t=tspan[2], case=2, slice=:xy)
f = DisplayAs.PNG(f) #hide
f = DisplayAs.PNG(f) #hide

# Final velocity distribution

0 comments on commit 6cd409b

Please sign in to comment.