Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mauve diprotodon #15

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
*.mat
# dropbox
*.dropbox
# winows files
# windows files
*.ini
# windows thumb
*.db
# Sandboxing
/scratch
/scratch
/logs
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@
[submodule "bin/ciecam02"]
path = bin/ciecam02
url = https://github.com/brycehenson/CIECAM02.git
[submodule "bin/MBeautifier"]
path = bin/MBeautifier
url = https://github.com/davidvarga/MBeautifier.git
[submodule "bin/dependency_matlab-master/dependency_matlab"]
path = bin/dependency_matlab-master/dependency_matlab
url = https://github.com/dohyun-cse/dependency_matlab
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Core_BEC_Analysis
**Bryce M. Henson, [Jacob A. Ross](https://github.com/GroundhogState)**
A reasonably comprehensive library analysis of data generated in the He* BEC group.
**Bryce M. Henson, [Jacob A. Ross](https://github.com/GroundhogState),[Kieran F. Thomas](https://github.com/KF-Thomas),[David Shin](https://github.com/spicydonkey)**
A reasonably comprehensive toolset for analysis of data generated in the He* BEC group.
**Status:** This Code is **ready for use in other projects**. Unit Testing is implemented for **most** functions. Integration/system testing is **not** implemented.

## Install
## Install

As a submodule (most common usage)
```
git submodule add -b dev https://github.com/brycehenson/Core_BEC_Analysis.git lib/Core_BEC_Analysis
```

Solo (not recomended)
```
git clone --recursive https://github.com/brycehenson/Core_BEC_Analysis.git
```
then to update

to update and initalize all the sub-sub-modules
```
git submodule update --init --recursive --remote --merge
```
Expand Down
38 changes: 38 additions & 0 deletions bin/DERIVESTsuite/ReadMe.rtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
\margl1440\margr1440\vieww9000\viewh9000\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural

\f0\fs24 \cf2 Numerical differentiation \
\
\pard\pardeftab720\ql\qnatural
\cf2 Author: John D'Errico\
e-mail: [email protected]\
Release: 1.0\
Release date: 3/7/2007\
\
This is a suite of tools to solve automatic numerical differentiation problems in one or more variables. All of these methods also produce error estimates on the result.\
A pdf file is also provided to explain the theory behind these tools.\
\
\
DERIVEST.m\
A flexible tool for the computation of derivatives of order 1 through 4 on any scalar function. Finite differences are used in an adaptive manner, coupled with a Romberg extrapolation methodology to provide a maximally accurate result. The user can configure many of the options, changing the order of the method or the extrapolation, even allowing the user to specify whether central, forward or backward differences are used.\
\
GRADEST.m\
Computes the gradient vector of a scalar function of one or more variables at any location.\
\
JACOBIANEST.m\
Computes the Jacobian matrix of a vector (or array) valued function of one or more variables.\
\
DIRECTIONALDIFF.m\
Computes the directional derivative (along some line) of a scalar function of one or more variables.\
\
HESSIAN.m\
Computes the Hessian matrix of all 2nd partial derivatives of a scalar function of one or more variables.\
\
HESSDIAG.m\
The diagonal elements of the Hessian matrix are the pure second order partial derivatives. This function is called by HESSIAN.m, but since some users may need only the diagonal elements, I've provided HESSDIAG.\
\
\
}
95 changes: 95 additions & 0 deletions bin/DERIVESTsuite/demo/derivest_demo.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
% DERIVEST demo script

% This script file is designed to be used in cell mode
% from the matlab editor, or best of all, use the publish
% to HTML feature from the matlab editor. Older versions
% of matlab can copy and paste entire blocks of code into
% the Matlab command window.

% DERIVEST is property/value is driven for its arguments.
% Properties can be shortened to the

%% derivative of exp(x), at x == 0
[deriv,err] = derivest(@(x) exp(x),0)

%% DERIVEST can also use an inline function
[deriv,err] = derivest(inline('exp(x)'),0)

%% Higher order derivatives (second derivative)
% Truth: 0
[deriv,err] = derivest(@(x) sin(x),pi,'deriv',2)

%% Higher order derivatives (third derivative)
% Truth: 1
[deriv,err] = derivest(@(x) cos(x),pi/2,'der',3)

%% Higher order derivatives (up to the fourth derivative)
% Truth: sqrt(2)/2 = 0.707106781186548
[deriv,err] = derivest(@(x) sin(x),pi/4,'d',4)

%% Evaluate the indicated (default = first) derivative at multiple points
[deriv,err] = derivest(@(x) sin(x),linspace(0,2*pi,13))

%% Specify the step size (default stepsize = 0.1)
deriv = derivest(@(x) polyval(1:5,x),1,'deriv',4,'FixedStep',1)

%% Provide other parameters via an anonymous function
% At a minimizer of a function, its derivative should be
% essentially zero. So, first, find a local minima of a
% first kind bessel function of order nu.
nu = 0;
fun = @(t) besselj(nu,t);
fplot(fun,[0,10])
x0 = fminbnd(fun,0,10,optimset('TolX',1.e-15))
hold on
plot(x0,fun(x0),'ro')
hold off

deriv = derivest(fun,x0,'d',1)

%% The second derivative should be positive at a minimizer.
deriv = derivest(fun,x0,'d',2)

%% Compute the numerical gradient vector of a 2-d function
% Note: the gradient at this point should be [4 6]
fun = @(x,y) x.^2 + y.^2;
xy = [2 3];
gradvec = [derivest(@(x) fun(x,xy(2)),xy(1),'d',1), ...
derivest(@(y) fun(xy(1),y),xy(2),'d',1)]

%% Compute the numerical Laplacian function of a 2-d function
% Note: The Laplacian of this function should be everywhere == 4
fun = @(x,y) x.^2 + y.^2;
xy = [2 3];
lapval = derivest(@(x) fun(x,xy(2)),xy(1),'d',2) + ...
derivest(@(y) fun(xy(1),y),xy(2),'d',2)

%% Compute the derivative of a function using a central difference scheme
% Sometimes you may not want your function to be evaluated
% above or below a given point. A 'central' difference scheme will
% look in both directions equally.
[deriv,err] = derivest(@(x) sinh(x),0,'Style','central')

%% Compute the derivative of a function using a forward difference scheme
% But a forward scheme will only look above x0.
[deriv,err] = derivest(@(x) sinh(x),0,'Style','forward')

%% Compute the derivative of a function using a backward difference scheme
% And a backward scheme will only look below x0.
[deriv,err] = derivest(@(x) sinh(x),0,'Style','backward')

%% Although a central rule may put some samples in the wrong places, it may still succeed
[d,e,del]=derivest(@(x) log(x),.001,'style','central')

%% But forcing the use of a one-sided rule may be smart anyway
[d,e,del]=derivest(@(x) log(x),.001,'style','forward')

%% Control the behavior of DERIVEST - forward 2nd order method, with only 1 Romberg term
% Compute the first derivative, also return the final stepsize chosen
[deriv,err,fdelta] = derivest(@(x) tan(x),pi,'deriv',1,'Style','for','MethodOrder',2,'RombergTerms',1)

%% Functions should be vectorized for speed, but its not always easy to do.
[deriv,err] = derivest(@(x) x.^2,0:5,'deriv',1)
[deriv,err] = derivest(@(x) x^2,0:5,'deriv',1,'vectorized','no')


Loading