Please visit W&M IT software support page and download Matlab from appropriate "Math & Statistics Software" section. They have several available versions. Either one is fine. Since we are learning Matlab, we will not have time to go to fancy toolboxes which Matlab provides/removes with new releases.

Gleb Romanov gromanov86@gmail.com

Grades are posted into the web grades book. Make sure that posted grades coincide with their paper one.

For the first time login use your WM official email as "login" and hit the reset password button. You will get a password shortly via email.

If you have any suggestions or comments, please, let me know.

See assignment in the following file hw01.pdf (source latex file hw01.tex)

- Class goals and structure
- Computers introduction
- Programming languages overview
- Discretization - the main weakness of computers
- Binary representation

presentation and handouts

- Matlab as a fancy calculator
- Efficient editing
- Help related commands
- Operator precedence
- Matrices
- Colon (:) operator
- Plotting
- Special array arithmetic operators

presentation and handouts

- Boolean algebra
- Comparison operators
- Conditional statements
- Loops
- Series

presentation and handouts

See assignment in the following file hw02.pdf (source latex file hw02.tex). Due date Friday 1pm.

- Scripts
- Functions
- Saving and loading variables

presentation and handouts

- hypotenuse.m, myfactorial.m, quad_eq_solver.m, batch_quad_eq_solver.m, data_for_quadratic_eq_solver.dat

- Root finding problem
- Bisection method
- False position method
- Solution convergence

presentation and handouts

See assignment in the following file hw03.pdf (source latex file hw03.tex). Due date Friday 1pm.

- Secant method
- Newton-Raphson method
- Numerical derivative of a function
- Ridders method
- Root finding algorithms gotchas
- Root finding algorithms summary

presentation and handouts

- Bubble sort method
- Quick sort method

presentation and handouts

See what senator (at that time) Obama has to say about the bubble sort method. Skip to the 34rd second.

See assignment in the following file hw04.pdf (source latex file hw04.tex). Due date Friday 1pm.

- Heap
- Heap sorting method
- Vector heap representation
- Matlab built in 'issorted'

presentation and handouts

- Integration problem statement
- The Rectangle method
- Trapezoidal method
- Simpson method

presentation and handouts

See the project assignment

Due date: Friday October 7th of 2011 at 1pm.

See assignment in the following file hw05.pdf (source latex file hw05.tex). Due date Friday 1pm.

- Monte Carlo Integration
- Numerical Integration methods error estimates

presentation and handouts

- Statistic and probability intro
- Random number generators

presentation and handouts

- Coin flipping bets
- Anonymous function and their use
- The Monty Hall Paradox
- Disease spread

presentation and handouts

- bet_outcome.m,
- gain_vs_bet_fraction.m,
- doors_game.m,
- doors_game_check.m,
- disease_outcome.m,
- colony_life.m.

- Introduction to optimization
- Matlab built in 1D minimization - fminbnd
- 1D optimization - golden section search

presentation and handouts

- calculation of black body radiation black_body_radiation.m

- acceleration function accel_midt1.m
- trapezoid integration function int_trapezoid.m
- a company profit vs money distribution profit.m

- Multi-D optimization
- Matlab built in Multi-D minimization - fminsearch
- Sample problems

presentation and handouts

- Simple function which makes a 3D plot of a function of 2 variables plot3dForXY.m
- Usage example plot_sinc_3d.m of above function which plots a sample function z=-sinc(r) where r=sqrt(x*x+y*y) fsample_sinc.m.
- Merit function for the suspended weights problem EconstrainedSuspendedWeights.m
- Merit function for the potential well problem merit_psi.m
- Complete example of the potential well problem potential_well_example.m

See the project assignment

Due date: Friday October 28th of 2011 at 1pm.

See assignment in the following file hw06.pdf (source latex file hw06.tex). Due date Friday 1pm.

- data file hw_fit_cos_problem.dat

- Goodness of the fit
- Parameter uncertainty estimations
- Homemade implementation of the fitter
- Matlab built-ins

presentation and handouts

- Fitter function fitter.m
- Fitter check function fit_check.m
- Fitter function usage example fitter_usage_example.m
- Data file for the above example data_to_fit.dat

presentation and handouts

- The main analysis script day_temp_analysis_session.m
- To execute it in step wise fashion use: echodemo day_temp_analysis_session

- Outside temperature data yearly_outside_temperatures.dat
- fitter.m
- plot_weather_data_and_fit.m
- reduce_with_average.m
- temp_vs_day_simple.m
- temp_vs_day_time.m

- Introduction to the combinatorial problem
- Backpack problem - brute force approach
- Traveling salesman problem
- Permutation generating algorithm

presentation and handouts

- Simulated annealing/Metropolis algorithm
- Genetic algorithm

presentation and handouts

See the project assignment

Due date: Monday November 21th of 2011 at 1pm.

- data file solar_system_data.mat

See assignment in the following file hw07.pdf (source latex file hw07.tex). Due date Friday 1pm.

- ODE - ordinary differential equations
- Cauchy boundary conditions
- Euler's method

presentation and handouts

- Euler's method ODE solver odeeuler.m
- Example of the free fall numerical solution with Euler's method ode_free_fall_example.m
- free fall forces calculation code free_fall_forces.m

- Example of stability issues in the ODE solvers ode_unstable_example.m
- forces calculation code ode_unstable_forces.m

- The second-order Runge-Kutta method (RK2)
- The forth-order Runge-Kutta method (RK4)
- Matlab functions for ODEs

presentation and handouts

- Lorenz attractor model ode_lorenz_attractor.m
- parachute jumper model (time dependent force) ode_parachute_jump_model.m
- projectile motion with air drag ode_projectile_with_air_drag_model.m
- predator and prey model shows oscillations ode_predator_prey_model.m

See assignment in the following file hw08.pdf (source latex file hw08.tex). Due date Monday 1pm.

- Matlab solvers

presentation and handouts

- the mobile problem mobile.m
- the Wheatstone bridge problem wheatstone_bridge.m

- Nearest neighbor interpolation
- Linear interpolation
- Polynomial fit
- Cubic spline interpolation
- Matlab built in interpolation
- Extrapolation

presentation and handouts

- x,y data to interpolate data_for_interpolation1.m
- x,y parametric points for a circle data_for_interpolation2.m
- nearest neighbor interpolation interp_nearest.m
- linear interpolation interp_linear.m
- sample code comparing results of different interpolation algorithm sample_plots_for_inerpolation.m. Note some advance plotting commands.

- Fourier series
- Discrete Fourier transform (DFT)
- Matlab implementation

presentation and handouts

- Fourier series for |t| fourier_abs.m
- Fourier series for step function fourier_step.m

- Discrete Fourier transform
- Nyquist criteria
- DFT filters

presentation and handouts

- filtersdemo.m
- fourier_frequencies.m
- freq_space_low_pass_filter.m
- voice_record.wav
- enlarge font size for plots niceplotset.m

See **optional** assignment in the following file hw09.pdf (source latex file hw09.tex). Due date Monday 1pm.

See assignment in the following file hw10.pdf (source latex file hw10.tex). Due date Monday 1pm.

- Limits to computing
- Parallel computing
- Matlab parallel tools

presentation and handouts

- for loop example for_script.m
- parfor loop example parfor_script.m

- Speed of FFT
- Low-pass filter
- High-pass filter
- Band-pass filter
- Band-stop filter
- Brick wall filters artifacts
- Windowing
- Other DFT applications

presentation and handouts

Voice filtering demo

- voice record with monochromatic noise voice_record_l27.wav
- voice filtering demo filter_voice_demo_l27.m
- fourier_frequencies.m
- filter application help function filter_application.m
- enlarge font size for plots niceplotset.m

Weather data analysis

- analysis demo weather_analysis_demo.m
- outside temperature data yearly_outside_temperatures.dat
- reduce_with_average.m

- Scientist toolbox
- Free software
- Version control software
- Final remarks

presentation and handouts

See the final exam project assignment

Report should be **no more than 10 pages long**, excluding appendixes with
listings. I will literally strip material exceeding 10 pages and throw it
to a trash basket. This what funding agencies do to all proposals. You
still have to follow the guideline about the font size to be no less than
12 pt.

Due date for electronic submission: Tuesday December 13th of 2011 at **12pm**.
The competition and final presentations will take place at the same day at 2pm.

- function template best_rocket.m

Problem file final_exam_problem1.mat. A typical 2 litters soda bottle at the Earth with choice of 3 liquids to fill: water, ethanol, and glucose; also with 3 choices of gases: He, air, and carbon dioxide.

- script created this data file save_final_exam_problem.m

Voice messages for problem 5. Each group must decode only the one assigned to them.

- noisy_msg1.wav for Tim, Tom, Joe
- noisy_msg2.wav for William and Pavel
- noisy_msg3.wav for Ben and Arlo, Sara and Emma
- noisy_msg4.wav for Anne and Matt, Harrison, Daniel, and Andrew
- noisy_msg5.wav for Rachel and Elana