Daily Download 22: Splines and Curves

Since it was first published in 2009 my CSpline function has been the most popular download from this site.  CSpline (and various associated functions) is used to fit a series of cubic curves through specified points, allowing interpolation along a smooth curve.

The latest version of the spreadsheet is:
http://www.interactiveds.com.au/software/CSpline2.zip

The original function is described at Cubic Splines.  This was further developed in response to a reader query at Using Cubic Splines in Practice and Cubic Hermitic and Cardinal Splines, and most recently Spline Interpolation Alternatives provided some “on-sheet” methods with similar functionality.

Related spreadsheets were described in Daily Download 13: The ALGLIB maths library and Excel (covering the ALGLIB spline functions) and Daily Download 4: Continuous Beam Analysis (covering the use of cubic splines to model continuous beams, and the SplineBeam function).

The remaining curve generating spreadsheet is:
http://interactiveds.com.au/software/Catenary.zip

This includes a function to generate the coordinates of any specified catenary curve, with an option to find the tension force at any point.  For more details see A catenary function.

Fitting a cubic spline to five data points

Cubic Spline and alternative Hermite Splines

Interpolated and fitted curves with spikey data

Catenary UDF

Posted in AlgLib, Beam Bending, Charts, Charts, Coordinate Geometry, Excel, Newton, Numerical integration, UDFs, VBA | Tagged , , , , , , , , | 7 Comments

Daily Download 21: Assorted Solvers

Today’s download starts with some simple linear interpolation methods used to solve polynomial equations, leading on to more sophisticated methods using quadratic or inverse quadratic interpolation. Also included is a solver for differential equations using the Cash-Karp Method, which is a refinement of the Runge-Kutta Method.

The current download files are:

Newton’s method:
http://interactiveds.com.au/software/Newtons%20Method.zip
Quadratic and Inverse Quadratic interpolation:
http://interactiveds.com.au/software/ItSolve%20Functions.xls
Brent’s Method
http://www.interactiveds.com.au/software/ItSolve.zip
Ordinary differential equation solver (Cash-Karp Method)
http://interactiveds.com.au/software/ODESolver.zip

More details are given in the following posts:

Approximate Solutions of Polynomial Equations
Function roots with the Inverse Quadratic Method
The Inverse Quadratic Method – 2
The Inverse Quadratic Method 3 – Brent’s Method
Using the AlgLib ODE (Runge-Kutta) Solver with Excel

Basis of the Newton-Raphson Method

Inverse Quadratic Method

Muller’s Method and Brent’s Method functions

Damped Vibration System differential equations

Damped vibration system solution

Buckling load of a column using ODE solver function

Posted in AlgLib, Beam Bending, Differential Equations, Excel, Maths, Newton, UDFs, VBA | Tagged , , , , , , , , , , | Leave a comment

Daily Download 20: Section Properties

The download spreadsheets today provide functions to find section properties of shapes either defined by coordinates or selected from a list of shape types.  The section properties found are: area, first and second moments of area about the X and Y axes and about axes through the centroid (parallel to X and Y and principal axes), Ixyc and angle of the principal axes, position of the centroid, and in some cases the torsional constant.

The download files are:
Section properties function and in-cell charting: http://interactiveds.com.au/software/SecProps-array.zip

Section properties of defined shapes:
http://interactiveds.com.au/software/Section%20Properties03.zip
http://interactiveds.com.au/software/Section%20Properties07.zip

Section properties without VBA:
http://www.interactiveds.com.au/software/On-sheet%20SecProp.xls

Section Properties from vectors:
http://www.interactiveds.com.au/software/SecPropV.xlsb

Posts describing the functions in more detail are:

Section Properties from Coordinates
Section Properties UDF and UDF charting
Section Properties from Layers
Section Properties of Defined Shapes – Spreadsheet
Section Properties from Coordinates Without VBA
Area from Vectors
Section properties for groups of defined shapes

Section properties from coordianates and in-cell charting

Section properties without VBA

Section Properties from Vectors

Posted in Charts, Coordinate Geometry, Drawing, Excel, Maths, Newton, UDFs, VBA | Tagged , , , , | Leave a comment

Daily Download 19: Solving polynomials

Today’s download provides analytic solutions to polynomial equations up to fourth order (that is quadratic, cubic and quartic equations) and an iterative method to solve equations of higher order.  All these functions are found in the download file:
http://interactiveds.com.au/software/Polynomial.zip

The links below describe these functions in more detail.  Several of the earlier links refer to other download files, but all of the functions are now included in the Polynomial.xlsb spreadsheet.

Solving cubic and quartic equations with Excel
Evaluating Polynomial Functions
Complex Numbers and Solving Quartic Polynomial Equations
Solving higher order polynomials
Evaluating higher order polynomials …
Polynomial Update

EvalPoly Function

Quadratic, Cubic, CubicC and Quartic functions

RPolyJT function used to solve a 60th order polynomial

Bottom of the input and output for the same function

Posted in Excel, Maths, Newton, UDFs, VBA | Tagged , , , , , , , , | 1 Comment

Daily Download 18: Simultaneous Equations and Matrix Arithmetic Functions

Today’s downloads collect several spreadsheets related to solution of simultaneous equations and matrix arithmetic, some of which were presented previously as part of the ALGLIB library (Daily Download 13).

Solving simultaneous equations described how to solve simultaneous equations using the Excel MInverse and MMult functions, and provided two VBA functions for solution of simultaneous equations.

In Solving simultaneous equations – Fortran dll the VBA function was converted to a compiled Fortran dll, offering much better performance, but see Distributing Silverfrost Fortran Applications for details of installation of the necessary run-time library, and note that this function may not work on Windows 7 systems*.
Download file: http://interactiveds.com.au/software/Simultaneous.zip

* Edit 8th Oct 2012 – “Windows Vista” changed to “Windows 7”; see also comment from cjberg at https://newtonexcelbach.wordpress.com/2008/12/01/linking-excel-to-fortran/#comment-4622

ALGLIB VBA matrix arithmetic functions were described in Installing AlgLib with Excel VBA, and c++ compiled versions in Compiled AlgLib Matrix Functions for Excel.  The functionality was further improved with a C# compiled version of the latest version of the library, including support for sparse matrices; see Compiled Matrix Functions for Excel.
Download files: http://interactiveds.com.au/software/AL-Matrix-xlsb.zip
http://interactiveds.com.au/software/AL-Matrix-xls.zip
http://interactiveds.com.au/software/AL-Matrixdll2.zip
http://www.interactiveds.com.au/software/Matrixdll-c%23.zip (latest version)
See also http://interactiveds.com.au/software/AL-Spline-Matrix03.zip and
http://interactiveds.com.au/software/AL-Spline-Matrix07.zip which also include the VBA matrix functions.

Solution of linear equations with compiled ALGLIB function

Posted in AlgLib, Excel, Link to dll, Maths, Newton, UDFs, VBA | Tagged , , , , , , , | Leave a comment