Skip to content

Commit

Permalink
Update lab seminar
Browse files Browse the repository at this point in the history
  • Loading branch information
fuodorov committed Mar 22, 2024
1 parent 3ad2314 commit ce3d045
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 2 deletions.
1 change: 1 addition & 0 deletions lab_seminar.tex
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
\input{src/slides/redpic/red_scheme}
\input{src/slides/redpic/development}
\input{src/slides/redpic/performance}
\input{src/slides/redpic/listing_example}
\input{src/slides/redpic/simulation}
\input{src/slides/redpic/conclusion}
\input{src/slides/thanks}
Expand Down
2 changes: 1 addition & 1 deletion src/slides/redpic/conclusion.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ \section{Итоги}
\begin{itemize}
\item Разработан REDPIC - инструмент на основе релятивистской разностной схемы.
\item Достигнуто хорошее совпадение с KENV и PIC кодом ASTRA в 5-метровом ускорительном тракте.
\item REDPIC оформлен как python-библиотека и доступен на Github.
\item REDPIC оформлен как python-библиотека и доступен на Github\footnote[1]{https://github.com/fuodorov/redpic}.
\item Программа зарегистрирована и внесена в Реестр программ для ЭВМ (№~2023688768).
\end{itemize}
\end{frame}
1 change: 1 addition & 0 deletions src/slides/redpic/development.tex
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ \subsection*{Функциональное тестирование}
\end{frame}

\begin{frame}
\frametitle{\insertsubsection}
Далее, для тестирования пишутся все конкретные сценарии для проверки работоспособности той или иной функции ПО.
Пример для конкретного сценария моделирования электронного пучка:
\begin{itemize}
Expand Down
49 changes: 49 additions & 0 deletions src/slides/redpic/listing_example.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
\section{Листинг моделирования транспортировки пучка}

\begin{frame}[fragile]
\frametitle{\insertsection}
\begin{lstlisting}[language=python]
import redpic as rp

acc = rp.accelerator.Accelerator(0.7, 5, 0.01)

# Unique name, z-position [m], Ez [MV/m], Ez(z) profile
acc.add_accel('Acc. 1', 4.096, -1.1, 'Ez.dat')
acc.add_accel('Acc. 2', 5.944, -1.1, 'Ez.dat')

# Unique name, z-position [m], Bz [T], Bz(z) profile
acc.add_solenoid('Sol. 1', 0.450, -0.0580, 'Bz.dat')
acc.add_solenoid('Sol. 2', 0.957, 0.0390, 'Bz.dat')
acc.add_solenoid('Sol. 3', 2.107, 0.0250, 'Bz.dat')
acc.add_solenoid('Sol. 4', 2.907, 0.0440, 'Bz.dat')
acc.add_solenoid('Sol. 5', 3.670, 0.0400, 'Bz.dat')
acc.add_solenoid('Sol. 6', 4.570, 0.0595, 'Bz.dat')
acc.add_solenoid('Sol. 7', 5.470, 0.0590, 'Bz.dat')

acc.compile()
\end{lstlisting}
\end{frame}

\begin{frame}[fragile]
\frametitle{\insertsection}
\begin{lstlisting}[language=python]
beam = rp.beam.RadialUniformBeam(
type=rp.constants.electron,
energy = 1.32, # MeV
current = 0.5e3, # A
radius_x = 48e-3, # initial r (m)
radius_y = 48e-3, # initial r (m)
radius_z = 3.5,
radius_xp = 2*35.0e-3, # initial r' (rad)
radius_yp = 2*35.0e-3, # initial r' (rad)
x = 0.0e-3, # horizontal centroid position (m)
xp = 0.0e-3, # horizontal centroid angle (rad)
y = 0, # vertical centroid position (m)
normalized_emittance = 200e-6 # m*rad
)
beam.generate(10_000)

rp_sim = rp.solver.Simulation(beam, acc)
rp_sim.track()
\end{lstlisting}
\end{frame}
2 changes: 1 addition & 1 deletion src/slides/thanks.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ \section{Благодарности}

\begin{frame}
\centering
Спасибо за ваше внимание!
Спасибо за внимание!
\end{frame}

0 comments on commit ce3d045

Please sign in to comment.