# Software Listing of Author : "Dmitry Savransky"

**animEuler**- License: Shareware
- Price:

[coordSys,as] = animEuler(h,rotSet,angs) animates the rotation of a dextral coordinate system using three arbitrary Euler angles (angs) about three axes (rotSet) in figure (h). rotSet is an array of 3 numbers in the range of [1, 3] representing the three body axes, so that rotSet = [3,1,3] is a body 3-1-3 rotation (z-x-z convention). Angles are assumed to be in degrees. In addition to animating the rotations, this function plots the intermediate reference frames. The function returns the matrix coordSys, representing the direction cosine matrix of the Euler angle set, and the array (as), containing the handles of the three surfact objects representing the axes. Note: If called with no arguments, this function will animate a 3-1-3 rotation using angles 45,30,60 in figure 1. These defaults will also be used in the place of null...

**Publisher:**Dmitry Savransky**Date Released:**05-04-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**Conversion between Equatorial and Ecliptic Coordinates**- License: Shareware
- Price:

[alpha,delta] = eclip2equat(lambda,beta) returns the right ascension and declination in the equatorial coordinate system corresponding to the longitudinal and latitudinal coordinates in the ecliptic coordinate system (lambda and beta). [lambda,beta] = equat2eclip(alpha,delta) returns the longitudinal and latitudinal coordinates in the ecliptic coordinate system corresponding to coordinates of right ascension and declination (alpha and delta) in the equatorial coordinate system. All inputs and outputs are in units of radians. longitudinal coordinates will be in the range of [-pi,pi] while latitudinal coordinates will be in the range [-pi/2, pi/2]. Inputs may be vectors but must be of equal size;

**Publisher:**Dmitry Savransky**Date Released:**19-01-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**Find Euler Angles**- License: Shareware
- Price:

findEulerAngs generates Euler angle sets and animates rotations in response to user manipulation of a 3D rigid body (a box). Use the mouse to change the orientation of the box. A wireframe of the original box position will appear. The 'Euler Axis' button animates the rotation about the Euler Axis between the original and new box positions. The 'Rotate' button calculates a set of Euler angles for the rotation type currently selected ('Body' or 'Space') and the axis set selected in the dropdown menu to orient the axes to the new box position. 'Derotate' reverses this process and brings the axes back to their previous position. Once the axes have been rotated, subsequent rotations are calculated from this new orientation. This means that Space rotations use the coordinate system associated with the previous cube orientation (i.e. the...

**Publisher:**Dmitry Savransky**Date Released:**09-01-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**Keplerian State Transition Matrix**- License: Freeware
- Price: 0.00

Phi = keplerSTM(x0,dt,mu) will return the state transition matrix Phi for a set of objects described by initial positions and velocities (x0) with gravitational parameters mu, propogated along Keplerian orbits for time dt. The positions and velocities at time dt is then given by Phi*x0. x0 must be a row vector of length 6n where n is the number of planets. For each planet, x0 must include the 3 position and 3 velocity values in the order [r1,r2,r3,v1,v2,v3].' These positions and velocities are measured in a cartesian coordinate system with the central object (i.e. star) at the origin. For multiple planets, simply stack several of these vectors on top of each other. mu must contain n values equal to G(m+ms) where G is the gravitational constant, m is the mass of the orbiting object, and ms is the mass of the central object....

**Publisher:**Dmitry Savransky**Date Released:**14-03-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**Orbital Elements from Position/Velocity Vectors**- License: Shareware
- Price:

vec2orbElem(rs,vs,mus) converts positions (rs) and velocities (vs) of bodies with gravitational parameters (mus) to Keplerian orbital elements. INPUTS: rs: 3n x 1 stacked initial position vectors: [r1(1);r1(2);r1(3);r2(1);r2(2)r2(3);...;rn(1);rn(2);rn(3)] or 3 x n matrix of position vectors. vs: 3n x 1 stacked initial velocity vectors or 3 x n matrix mus: gravitational parameters (G*m_i) where G is the gravitational constant and m_i is the mass of the ith body. if all vectors represent the same body, mus may be a scalar. OUTPUTS: a: semi-major axes e: eccentricities E: eccentric anomalies I: inclinations omega: arguments of pericenter Omega: longitudes of ascending nodes P: orbital periods tau: time of periapsis crossing A, B: orientation matrices (see Vinti, 1998) All units must be complementary, i.e., if...

**Publisher:**Dmitry Savransky**Date Released:**26-01-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**Pendulum on Circular Track**- License: Shareware
- Price:

For an idealized pendulum with massless arm of length L, traveling along a vertical circular track of radius R with constant angular velocity W, this program will integrate the equations of motion given the above parameters and initial conditions, and will then animate the system, tracing the pendulum's path. Good demo for introductory dynamics or numerical integration.

**Publisher:**Dmitry Savransky**Date Released:**11-04-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**robotArm**- License: Freeware
- Price: 0.00

This simulation finds the angular velocity time histories required to raise a glass from ground level to table height in a straight 45 degree trajectory. Build Robot constructs the robot from inputs, and Go! starts the simulation. Editable fields are: d_1 - Base of initial triangle formed by first arm d_2 - Base of initial triangle formed by second arm h - height of initial triangle formed by two arms table_height - height of table where glass is placed Time - Amount of time motion should take. d_1, d_2 and h determine the lengths of the two arms, and Time determines the initial angular velocities. The plot menu allows you to generate plots of the angle and angular velocity time histories for the two arms. The angles are measured from inertial horizontal (i.e., the bottom two angles of the initial triangle) and the angular...

**Publisher:**Dmitry Savransky**Date Released:**04-02-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**Simple Rejection Sampling**- License: Shareware
- Price:

SAMPLEDIST Sample from an arbitrary distribution sampleDist(f,M,N,b) retruns an array of size X of random values sampled from the distribution defined by the probability density function referred to by handle f, over the range b = [min, max]. M is the threshold value for the proposal distribution, such that f(x) < M for all x in b. sampleDist(...,true) also generates a histogram of the results with an overlay of the true pdf. Examples: %Sample from a step function over [0,1]: X = sampleDist(@(x)1.3*(x>=0&x<0.7)+0.3*(x>=0.7&x<=1),... 1.3,1e6,[0,1],true); %Sample from a normal distribution over [-5,5]: X = sampleDist(@(x) 1/sqrt(2*pi) *exp(-x.^2/2),... 1/sqrt(2*pi),1e6,[-5,5],true);

**Publisher:**Dmitry Savransky**Date Released:**20-02-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**UDFactor**- License: Shareware
- Price:

[U D] = UDFactor(P) returns matrices U and D such that U.'*D*U = P [U D] = UDFactor(P,uflag) returns matrices U and D such that U*D*U.' = P when uflag is set to TRUE. Setting uflag to FALSE is equivalent to running UDFactor with only one argument. The alogrithm of UDFactor is similar to the Cholesky decomposition except that the matrix is factored into a unitary upper triangular matrix (U) and diagonal matrix (D) such that P = U*D*U.' (or U.'*D*U). Note that while this is equivalent to P = (U*D^0.5)*(U*D^0.5).' = S*S.' where S is the upper triangular square root of P, no square roots are taken in the calculations of U and D. This makes this factorization ideal for a square-root implementation of a Kalman filter (a U-D filter). For more details, see Bierman, G. J., Factorization methods for discrete sequential estimation, 1977. Note:...

**Publisher:**Dmitry Savransky**Date Released:**07-04-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**Vectorized N-Body Equation**- License: Freeware
- Price: 0.00

NBODYVECT - Fully vectorized n-body equation nbodyVect(x0,dx0,mus,t) integrates the n-body equations of motion using either a symplectic second order integrator, or any of the standard built-in or user supplied first order integrators. x0 - 3n x 1 stacked initial position vectors: [r1(1);r1(2);r1(3);r2(1);r2(2)r2(3);...;rn(1);rn(2);rn(3)] dx0 - 3n x 1 stacked initial velocity vectors mus - gravitational parameters (G*m_i) where G is the gravitational constant and m_i is the mass of the ith body. t - time span: either a 2 element array of initial and final time, or array of all time steps to output. All units must be complementary, i.e., if positions are in AUs, and time is in days, dx0 must be in AU/day and mus must be in AU^3/day^2 (these are the units in solarSystemData.mat). This data was downloaded from JPL's System Web...

**Publisher:**Dmitry Savransky**Date Released:**03-04-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts

**Watt Linkage Animation**- License: Shareware
- Price:

[t,z,r_PO] = wattLinkage(n,npathpoints,lengths,omega) integrates the equations of motion for a 3 bar Watt linkage and animates the motion of the system over n cycles (one cycle is defined as a full sweep top to bottom). npathpoints determines the number of trajectory points to plot (Inf by default, for all). lengths is an optional 3 element array of linkage lengths ([3,1,3] by default). omega is the angular rate in radians per second (0.5 by default). The returned values are the integrator outputs (t and z) and the position of the center of the intermediate bar. % Example % % animate system over 10 cycles % wattLinkage(10); % %animate asymmetric linkage % [t,z,r_PO] = wattLinkage(5,[],[5 1 2]);

**Publisher:**Dmitry Savransky**Date Released:**23-05-2013**Download Size:**10 KB**Download**

**Platform:**Matlab, Scripts