assignment-template.git
11 years agoMakefile: Use the cyclic 'hsv' color map for angle-vs-y0-E.png phys305/gaussian-bumps
W. Trevor King [Fri, 22 Feb 2013 18:01:40 +0000 (13:01 -0500)]
Makefile: Use the cyclic 'hsv' color map for angle-vs-y0-E.png

This avoids an artificial discontinuity where the angle wraps around
from -pi to +pi.

11 years agoscatter: fix stupid --vx0-energy minus sign
W. Trevor King [Fri, 22 Feb 2013 17:49:45 +0000 (12:49 -0500)]
scatter: fix stupid --vx0-energy minus sign

11 years agoMakefile: Make Python interpreter configurable
W. Trevor King [Fri, 22 Feb 2013 16:48:35 +0000 (11:48 -0500)]
Makefile: Make Python interpreter configurable

For example, my default Python is 3.2, but I only have Matplotlib
installed for 2.7.  However, the default version of Python on newton
is 2.6.  Now the user can override it at invocation:

  $ make PYTHON=python2.6 all

11 years agoMakefile: stupid fixes
W. Trevor King [Fri, 22 Feb 2013 16:41:41 +0000 (11:41 -0500)]
Makefile: stupid fixes

11 years agoMakefile: Use the more portable printf over `echo -e`
W. Trevor King [Fri, 22 Feb 2013 16:33:10 +0000 (11:33 -0500)]
Makefile: Use the more portable printf over `echo -e`

See POSIX-2008 for details:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html

11 years agoUpdate scatter package for assignment 5
W. Trevor King [Fri, 22 Feb 2013 16:19:51 +0000 (11:19 -0500)]
Update scatter package for assignment 5

11 years agoenergy.gp: Add gnuplot script and rules to build an energy phys305/gaussian-bump
W. Trevor King [Wed, 13 Feb 2013 21:32:12 +0000 (16:32 -0500)]
energy.gp: Add gnuplot script and rules to build an energy

11 years agoK should be 10, not -5
W. Trevor King [Wed, 13 Feb 2013 16:30:42 +0000 (11:30 -0500)]
K should be 10, not -5

The homework calls for an energy barrier of five units.

11 years agophase.gp: Add gnuplot script and rules to build a phase-space plot
W. Trevor King [Wed, 13 Feb 2013 01:47:32 +0000 (20:47 -0500)]
phase.gp: Add gnuplot script and rules to build a phase-space plot

In phase.gp, I use a for loop to iterate over data block (in this
case, each trajectory is in its own block).  This gives you nice
per-block colors, but means you'll have to update the loop if you
change the number of energies you're looping over.

11 years agoerror.gp: Add gnuplot script and rules to build an error-scaling plot
W. Trevor King [Wed, 13 Feb 2013 01:13:15 +0000 (20:13 -0500)]
error.gp: Add gnuplot script and rules to build an error-scaling plot

As requested in the homework.  I didn't bother writing a stand-alone
script for building the data files, although you could split my
error-%.data rule out into its own script if you wish.

11 years agoone_gaussian_bump.c: Add rk4 integrator (4th order Runge-Kutta)
W. Trevor King [Wed, 13 Feb 2013 00:54:33 +0000 (19:54 -0500)]
one_gaussian_bump.c: Add rk4 integrator (4th order Runge-Kutta)

11 years agoone_gaussian_bump.c: Add a midpoint integrator
W. Trevor King [Tue, 12 Feb 2013 22:19:45 +0000 (17:19 -0500)]
one_gaussian_bump.c: Add a midpoint integrator

11 years agoone_gaussian_bump.c: Increase printed precision
W. Trevor King [Tue, 12 Feb 2013 22:19:07 +0000 (17:19 -0500)]
one_gaussian_bump.c: Increase printed precision

11 years agoone_gaussian_bump.c: Prepare for alternative integrators
W. Trevor King [Tue, 12 Feb 2013 22:00:20 +0000 (17:00 -0500)]
one_gaussian_bump.c: Prepare for alternative integrators

11 years agoerror_analysis.c: Implement error analysis
W. Trevor King [Tue, 12 Feb 2013 21:54:47 +0000 (16:54 -0500)]
error_analysis.c: Implement error analysis

Currently it is hard-coded to read column five, but adding a command
line switch to change columns wouldn't be too difficult.

11 years agoone_gaussian_bump.c: Print total energy for error checks
W. Trevor King [Tue, 12 Feb 2013 18:03:27 +0000 (13:03 -0500)]
one_gaussian_bump.c: Print total energy for error checks

11 years agoone_gaussian_bump.c: Incorperate safe-strto-example's parsing
W. Trevor King [Mon, 11 Feb 2013 17:02:40 +0000 (12:02 -0500)]
one_gaussian_bump.c: Incorperate safe-strto-example's parsing

11 years agoMerge branch 'util/safe-strto' into phys305/gaussian-bump
W. Trevor King [Tue, 12 Feb 2013 18:13:53 +0000 (13:13 -0500)]
Merge branch 'util/safe-strto' into phys305/gaussian-bump

Conflicts:
Makefile  (add safe-strto dependencies for one_gaussian_bump)

11 years agoone_gaussian_bump.c: Initial integration implementation
W. Trevor King [Mon, 11 Feb 2013 15:42:51 +0000 (10:42 -0500)]
one_gaussian_bump.c: Initial integration implementation

Currently just uses forward Euler.  Based on oscillator.c from the
phys305/oscillator branch (as of d0ebe65f, oscillator.c: disambiguate
potential state from dynamic state, 2013-01-25).

11 years agosafe-strto-example.c: Add a pared-down argv-parsing example util/safe-strto
W. Trevor King [Mon, 11 Feb 2013 16:07:56 +0000 (11:07 -0500)]
safe-strto-example.c: Add a pared-down argv-parsing example

11 years agosafe-strto.c: Add safe_strtoc() for parsing complex arguments
W. Trevor King [Wed, 23 Jan 2013 20:14:17 +0000 (15:14 -0500)]
safe-strto.c: Add safe_strtoc() for parsing complex arguments

Because people may wish to use safe-strto on systems that don't
support the more recent complex.h (from C99) or may wish to avoid
linking to libm, I've masked code related to safe_strtoc() behind
HAVE_COMPLEX.  If you define this symbol, you get safe_strtoc(), but
have to link against libm.  If you don't define this symbol, you don't
get safe_strtoc().

To turn on the symbol for this project, I've created config.h.
Usually such a config header would be created via the GNU Autotools
suite (e.g. `./configure`).

11 years agosafe-strto.c: Add safe_strtol and generalize the library name
W. Trevor King [Wed, 23 Jan 2013 19:59:03 +0000 (14:59 -0500)]
safe-strto.c: Add safe_strtol and generalize the library name

Also fix masking defines to match the library name's pattern.

11 years agosafe-strtod.c: Split safe_strtod() into a library
W. Trevor King [Mon, 11 Feb 2013 16:30:34 +0000 (11:30 -0500)]
safe-strtod.c: Split safe_strtod() into a library

Cherry pick from my phys305/zeta-and-step solutions.

11 years agoRename C programs and update the Makefile
W. Trevor King [Mon, 11 Feb 2013 15:01:46 +0000 (10:01 -0500)]
Rename C programs and update the Makefile

11 years agoREADME: Specialize for assignment 4
W. Trevor King [Mon, 11 Feb 2013 14:58:35 +0000 (09:58 -0500)]
README: Specialize for assignment 4

11 years agohw4.txt: Add text of the homework assignment
W. Trevor King [Mon, 11 Feb 2013 14:56:47 +0000 (09:56 -0500)]
hw4.txt: Add text of the homework assignment

Converted to UTF-8 text from

http://physics.drexel.edu/~valliere/PHYS305/phys305.w13/assignments/hw4/hw4.pdf

11 years agoMakefile: Drop the 'static pattern rule' buzzwords ;)
W. Trevor King [Thu, 7 Feb 2013 22:07:49 +0000 (17:07 -0500)]
Makefile: Drop the 'static pattern rule' buzzwords ;)

11 years agoMakefile: Strip trailing whitespace after SCRIPT
W. Trevor King [Fri, 25 Jan 2013 19:13:02 +0000 (14:13 -0500)]
Makefile: Strip trailing whitespace after SCRIPT

11 years agoMakefile: Quote all $@ and $< expansion
W. Trevor King [Wed, 23 Jan 2013 18:01:51 +0000 (13:01 -0500)]
Makefile: Quote all $@ and $< expansion

To protect against spaces and special characters in their values.

11 years agoMakefile: Bump copyright year
W. Trevor King [Mon, 21 Jan 2013 14:55:26 +0000 (09:55 -0500)]
Makefile: Bump copyright year

11 years agoMakefile: Document first-rule-target as the default
W. Trevor King [Mon, 21 Jan 2013 14:53:24 +0000 (09:53 -0500)]
Makefile: Document first-rule-target as the default

11 years agoMakefile: Use `a, b, and c` instead of `a, b and c` in comments
W. Trevor King [Mon, 14 Jan 2013 19:26:19 +0000 (14:26 -0500)]
Makefile: Use `a, b, and c` instead of `a, b and c` in comments

11 years agoMakefile: Link to pattern rule documentation
W. Trevor King [Mon, 14 Jan 2013 18:05:28 +0000 (13:05 -0500)]
Makefile: Link to pattern rule documentation

And call them "pattern rules" not "matching rules".

11 years agoMakefile: add SCRIPTS for non-compiled scripts.
W. Trevor King [Fri, 12 Oct 2012 18:44:25 +0000 (14:44 -0400)]
Makefile: add SCRIPTS for non-compiled scripts.

These scripts will be distributed, but not cleaned up.  This is useful
if running your package is too complicated to wedge into the Makefile,
and you want to pull it out into run.sh or whatever.

11 years agoMakefile: add *.cpp and *.h to automatically distributed SOURCE.
W. Trevor King [Thu, 11 Oct 2012 11:03:06 +0000 (07:03 -0400)]
Makefile: add *.cpp and *.h to automatically distributed SOURCE.

11 years agoREADME: mention goodbye_world as a compiled target.
W. Trevor King [Fri, 5 Oct 2012 17:40:01 +0000 (10:40 -0700)]
README: mention goodbye_world as a compiled target.

11 years agoMakefile: $(CC) actually expands to `cc`, not `gcc`.
W. Trevor King [Fri, 5 Oct 2012 17:38:08 +0000 (10:38 -0700)]
Makefile: $(CC) actually expands to `cc`, not `gcc`.

11 years agoRestore C++ example, and expad Makefile to handle multiple programs.
W. Trevor King [Fri, 5 Oct 2012 17:31:49 +0000 (10:31 -0700)]
Restore C++ example, and expad Makefile to handle multiple programs.

11 years agoMakefile: Add print-% and printvars rules for Makefile introspection.
W. Trevor King [Fri, 5 Oct 2012 16:39:38 +0000 (12:39 -0400)]
Makefile: Add print-% and printvars rules for Makefile introspection.

Based on John Graham-Cumming's "Dumping Every Makefile Variable"
  http://www.cmcrossroads.com/ask-mr-make/6521-dumping-every-makefile-variable

11 years agoREADME: fix `make help` -> ``make help`` reStructuredText markup.
W. Trevor King [Fri, 5 Oct 2012 16:33:44 +0000 (12:33 -0400)]
README: fix `make help` -> ``make help`` reStructuredText markup.

11 years agoREADME: generalize 'C++' -> 'C or C++'.
W. Trevor King [Fri, 5 Oct 2012 12:21:40 +0000 (05:21 -0700)]
README: generalize 'C++' -> 'C or C++'.

11 years agoFix generated release comment in the Makefile.
W. Trevor King [Fri, 5 Oct 2012 12:19:11 +0000 (05:19 -0700)]
Fix generated release comment in the Makefile.

11 years agoAdd .gitignore to ignore built files.
W. Trevor King [Fri, 28 Sep 2012 13:15:42 +0000 (06:15 -0700)]
Add .gitignore to ignore built files.

11 years agoConvert package from C++ to C.
W. Trevor King [Fri, 28 Sep 2012 13:15:04 +0000 (06:15 -0700)]
Convert package from C++ to C.

11 years agoBegin versioning project template.
W. Trevor King [Fri, 28 Sep 2012 13:10:05 +0000 (06:10 -0700)]
Begin versioning project template.