📄 homework1.tex
字号:
\author{Paul Sava}\title{Homework 1}\input{pcs}% ------------------------------------------------------------\section{Prerequisites}\begin{enumerate}\item Log into your class account and prepare for the assignment:\begin{itemize}\item \texttt{cd ~/geo391} and run \texttt{scons update} \parto bring the latest class assignment to your local directory.\item \texttt{cd ~/geo391/hw1} \parto change directory to your current homework.\end{itemize}\item Open the file \texttt{homework1} in your favorite text editorand change the name at the top of the file.Run \texttt{scons homework1.read} to build and read this file.\item This homework has $2$ parts. Part $A$ is mandatory (max $100$ points).Part $B$ is optional but with extra credit (max $50$ points).If you answer only part $A$, \texttt{cd hw1a},run the commands in this directory according to the instructions. When you are done, run \texttt{scons lock} andreturn to the \texttt{hw1} directory.If you also answer part $B$, \texttt{cd hw1b},run the commands in this directory according to the instructions. When you are done, run \texttt{scons lock} andreturn to the \texttt{hw1} directory.When you are done, uncomment the ``plot'' lines in this documentto include your figures, add your answers, and run\texttt{scons homework1.read}. When you are happy with your answer, print the document andbring it to class. Don't forget to update your name on the file.\end{enumerate}% ------------------------------------------------------------\section{Part A: SConstruct assignment}\begin{enumerate}\item In this assignment, you will get familiar with the computer library called \texttt{RSF} and the reproducible testingenvironment using \texttt{scons}.You will run a number of commands defined in the \texttt{SConstruct} file, modify them, observe and comment on the results, and finally include commentsin this homework document.We will use this setup in future labs, so try to get familiar withit as much as possible to avoid being distracted in future labs.\item \texttt{cd ~/geo391/hw1/hw1a}\item open the \texttt{SConstruct} file in your favorite text editor.\item Observe typical commands in the \texttt{SConstruct} file:\begin{itemize}\item \texttt{Flow} describes a flow with which we produce one or more outputs using one or more inputs and execution rules andparameters. The generic format is:\par\texttt{ Flow(output,input,command) }\parFor example\par\texttt{ Flow('mm0','vel','window n2=\%(nx)d min2=\%(ox)g' \% par)}\parproduces output \texttt{mm0.rsf} from input \texttt{vel.rsf} using the rule\par\texttt{'window n2=\%(nx)d min2=\%(ox)g'} where parameters\texttt{nx} and \texttt{ox} are extracted from the dictionary \texttt{par}.\item \texttt{Plot} produces an output plot file in \texttt{vplot} format, that can be displayed using the program \texttt{xtpen}.For example\par\texttt{ Plot(mm,igrey('allpos=y bias=4715',par))}\parproduces output \texttt{mm.vpl} from input \texttt{mm.rsf} using the rule defined by the function \texttt{igrey} with arguments \texttt{allpos=y bias=4715}.\item \texttt{Result} is similar with \texttt{Plot} exceptthat outputs\end{itemize}\item In this homework, you will analyze wave propagation modeledusing the acoustic wave-equation. You will observe and discuss $3$ pre-defined models and $2$ pre-defined acquisition geometries (experiments).Feel free to add more examples by replicating the rules in the\texttt{SConstruct} file.\item For each model-experiment pair, you will observeplots for the model and a wavefield snapshot (acquisition overlain),and recorded data.Each triplet model-wavefield-data is annotated with a balloonlabel with a letter (e.g. A). Modify the \texttt{x0} and \texttt{y0} parameters in the \texttt{SConstruct} file to indicate a consistent event across all 3 figures for each model. By default, the labels are inarbitrary positions that do not point to anything in particular.Use section ``Discussion'' to list all of them in this document and describe what you wanted to indicate. For example, you can point at a reflector on the model plot,a wave reflected from this reflector in the wavefield plot andthe same reflected wave in the acquired data.You can identify direct arrivals, reflected arrivals, multiple reflection or anything else that you might find interesting.This exercise is about being creative and seeing things,as well as getting used to the \texttt{SConstruct} setup.\end{enumerate}% ------------------------------------------------------------\inputdir{hw1a}\section{Discussion}\begin{enumerate}\item Model 0, experiment 0, label A% \plot{me-0-0}{width=6.0in}{Model 0, experiment 0}% \plot{ww-0-0}{width=6.0in}{Model 0, experiment 0}% \plot{dd-0-0}{width=6.0in}{Model 0, experiment 0}\item Model 0, experiment 1, label B% \plot{me-0-1}{width=6.0in}{Model 0, experiment 1}% \plot{ww-0-1}{width=6.0in}{Model 0, experiment 1}% \plot{dd-0-1}{width=6.0in}{Model 0, experiment 1}\item Model 1, experiment 0, label C% \plot{me-1-0}{width=6.0in}{Model 1, experiment 0}% \plot{ww-1-0}{width=6.0in}{Model 1, experiment 0}% \plot{dd-1-0}{width=6.0in}{Model 1, experiment 0}\item Model 1, experiment 1, label D% \plot{me-1-1}{width=6.0in}{Model 1, experiment 1}% \plot{ww-1-1}{width=6.0in}{Model 1, experiment 1}% \plot{dd-1-1}{width=6.0in}{Model 1, experiment 1}\item Model 2, experiment 0, label E% \plot{me-2-0}{width=6.0in}{Model 2, experiment 0}% \plot{ww-2-0}{width=6.0in}{Model 2, experiment 0}% \plot{dd-2-0}{width=6.0in}{Model 2, experiment 0}\item Model 2, experiment 1, label F% \plot{me-2-1}{width=6.0in}{Model 2, experiment 1}% \plot{ww-2-1}{width=6.0in}{Model 2, experiment 1}% \plot{dd-2-1}{width=6.0in}{Model 2, experiment 1}\end{enumerate}When you are done, run \texttt{scons lock} to archive your pictures so they can be included in your answer.Don't forget to uncomment the plots in \texttt{homework1.tex}.% ------------------------------------------------------------\inputdir{hw1b}\section{Part B: programming assignment (extra credit)}\begin{enumerate}\item \texttt{cd ~/geo391/hw1/hw1b}\item The file \texttt{AFDM.c} is a \texttt{C} programfor time-domain acoustic finite-difference modeling.The \texttt{SConstruct} file contains all the rules for compiling andrunning tests with this program. Every change in the program willautomatically recompile it and create an updated executable,so you don't need to worry about doing anything special about this.Just make your changes and run the tests using \texttt{scons}.The program is set for models with constant density.You will modify this program to include the variable-density term.Consult the class notes for details.\itemYou will use the Python function \texttt{amodel} (alreadydefined in the SConstruct file) to run tests for both constant-densityand variable-density modeling.The lines\par\texttt{ amodel('dv','wv','wav','vv','rr','sc','rc','free=n dens=n') }\par\texttt{ amodel('dr','wr','wav','vv','rr','sc','rc','free=n dens=y') }\pargenerate\begin{itemize}\item the data files \texttt{dv} and \texttt{dr} corresponding to constant-densityand variable-density, respectively. You are basically running the same program, but the flag\texttt{dens=y} indicates if you use or ignore density.\item the wavefield files \texttt{dv} and \texttt{dr} corresponding to constant-densityand variable-density, respectively. \end{itemize}The source wavelet is in \texttt{wav},the velocity in \texttt{vv}, andthe density in \texttt{rr}. The source coordinates are in \texttt{sc} andthe receiver coordinates are in \texttt{rc}.All input files are predefined for you, so you don't need to change them.However, feel free to duplicate the rules in the \texttt{SConstruct} file and experiment at will.\itemWhen you are finished modifying the program, run the commands:\begin{itemize}\item \texttt{scons mcomp.view} to view the velocity and density models.\item \texttt{scons wvmovie.view} to view a movie of the pulse in\texttt{wav} propagate through the medium with constant density.\item \texttt{scons wrmovie.view} to view a movie of the pulse in\texttt{wav} propagate through the medium with variable density.\item \texttt{scons wcomp} to compare snapshots of the wavefieldfor the two cases.\item \texttt{scons dcomp} to compare the data recorded at the surfacefor the two cases.\end{itemize}Initially, the left and right panels of \texttt{wcomp} and \texttt{dcomp} are identical. After you modify the program, the two panels will change. Are you sure that you obtained correct results? If yes, explain why?\end{enumerate}When you are done, run \texttt{scons lock} to archive your pictures so they can be included in your answer.Don't forget to uncomment the plots in \texttt{homework1.tex}.%\plot{mcomp}{width=6.0in}{Model}%\plot{wcomp}{width=6.0in}{Wavefield}%\plot{dcomp}{width=6.0in}{Data}% ------------------------------------------------------------\section{Wrap-up}When you are done, rebuild this document and print your answers. Remember to uncomment the plotsso the figures you created are included in the document.This homework is due in class $2$ weeksfrom the day in which it was handed-out.% ------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -