comp-phys

module
v0.0.0-...-325efec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2019 License: MIT

README

Code for Computational Physics at Imperial (fall of 2019)

Build instructions

To build and run the project, use make or make run (faster, no test). To only build the project binary, use make project.

To build and run all assignment code with default data and generate the assignment report a simple make assignment should suffice.

To generate the submitted report run make pdf and to generate the submitted ZIP archive run make zip.

PNG and other Graph Formats

There have been complaints about the graphs being generated as .pdf files. When running make pdf, the graphs are generated in .pdf format to produce a high-quality report document. If the marker wishes to inspect the graphs in some other format (e.g. .png), they are free to run ./main -graph, in the /project directory. (Run ./main to see available options and make sure to build the project first!)

Heavy Calculation

There is the option to run a time-intensive calculation. Use the -heavy flag when running the project binary (i.e. ./main -heavy). Running this may take some time.

For markers inclined to save time, here is the output of this command:

Running heavy calculation. This may take a while ...
INFO: 20000000000 steps max at 1e-06 target accuracy
Result: P = 0.4976607485895988
Statistics:
&{19999997952 1.9059153608037185e-06 integral did not converge}
Time elapsed: 11m44.577711857s (35.22888920028826 nanosecond/sample)

Running Tests

To run tests, use make test. (To see a code coverage breakdown, use make cover.)

Build prerequisites

This project uses Go. To build the go source, multiple open source compilers are available. See the Go website for more information on how to obtain a compiler for your operating system and architecture.

Installation example macOS

If you are using homebrew on macOs, the installation should be as simple as:

brew install golang
Installation example Ubuntu

If you are using Ubuntu, you might want to install Go using snap:

sudo snap install --classic go
Notes on removing the Go installation

Any files generated by Go when building this project will either be located in this folder, or in $HOME/go (unless you manually changed your GOPATH, run go help gopath for more information).

To remove everything, deinstall Go using your package manager, then delete $HOME/go.

Contained folders

  • /assignment --- answers to assignment problems
  • /pdf ---------- LaTeX code for submission PDFs
  • /pkg ---------- reusable packages
  • /problems ----- answers to problem sheets
  • /project ------ project binary code

License

Unless explicitly stated otherwise, the code in this repository is authored by Tilman Roeder and licensed under the MIT license (seen LICENSE).

Directories

Path Synopsis
assignment
comply
Package comply provides routines that do not make sense to be written from scratch/ provided in pkg, or have other design constrains that are imposed for the sake of complying with the problem statements in the assignment.
Package comply provides routines that do not make sense to be written from scratch/ provided in pkg, or have other design constrains that are imposed for the sake of complying with the problem statements in the assignment.
q-1 command
q-2 command
q-3 command
q-4 command
q-5 command
pkg
casino
Package casino implements Monte-Carlo algorithms.
Package casino implements Monte-Carlo algorithms.
interpolate
Package interpolate provides interpolation types that wrap a set of data-points.
Package interpolate provides interpolation types that wrap a set of data-points.
quad
Package quad implements numerical integration techniques.
Package quad implements numerical integration techniques.
signal
Package signal implements signal processing routines.
Package signal implements signal processing routines.
problems
ps-3 command
ps-4 command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL