Octave
Octave is software intended for performing numerical computations, such as solving linear and nonlinear problems, using a language that is mostly compatible with Matlab.
NEW! Create your own free Octave scripting workbook!
Click the button to run the script. Click the icon with arrows to toggle between the script and output panels. Click the red x icon to clear the active panel.
Reference documents
- GNU Octave reference manual
- Frequently asked questions about GNU Octave
- GNU Octave reference card
- octave-help mailing list archives: Dec 2011 (Nov, Oct, Sep, Aug, Jul, Jun, May, Apr, Mar, Feb, Jan)
Share your Octave script!
Finding roots of polynomial functions
A common task in many business and computing subjects is the calculation of minima and maxima values. This task requires finding the roots of first and second order derivatives, which can be done conveniently using Maxima or Octave scripts. For example, consider this function:
- y = 3x2 - 3x - 6
Polynomial functions are expressed quite literally in Maxima scripts. They use the realroots() command to calculate real valued roots.
>> Read more
Plotting polynomial functions
Octave uses a vector of the coefficients in descending order to represent a polynomial function. For example, consider this function:
- y = 3x2 - 3x - 6
Polynomial functions can be plotted in an Octave script by using the polyval and plot commands.
>> Read more
Evaluating polynomial functions for specific variables
Octave scripts use a vector of the coefficients in descending order to represent a polynomial function. Afterwards, the command polyval() can be used to evaluate the function for specific variables. For example, consider this function:
- y = 3x2 - 3x - 6
>> Read more
Linear programming
Linear programming is a technique to identify maximum and minimum solutions for problems, often referred to as optimization. It is a common technique because a surprising number of real world problems can be described or estimated using linear equations. For example, in manufacturing:
- Programming is a synonym for planning, or more specifically, planning of manufacturing activities, resources and products
- The linear objective function describes the potential amount of profit, loss, revenue or cost
- Variables are the resources (input) and/or products (output) related to the manufacturing activities
- Linear equality and inequality constraints describe requirements or restrictions caused by manufacturing activities
- Maximization is concerned with profit, revenue or output quantities
- Minimization is concerned with loss, costs or input quantities
A standard form of a linear programming problem is to find values of x1, x2, ... , xn so as to
Subject to
(note 1)
maximize z = c1x1 + c2x2 + ... + cnxn
Subject to
(note 2)
a11x1 + a12x2 + ... + a1nxn ≤ b1
a21x1 + a22x2 + ... + a2nxn ≤ b2
...
am1x1 + am2x2 + ... + amnxn ≤ bm
anda21x1 + a22x2 + ... + a2nxn ≤ b2
...
am1x1 + am2x2 + ... + amnxn ≤ bm
(note 3)
x1 ≥ 0, x2 ≥ 0, ... , xn ≥ 0
Notes:
(1) Objective function could also be expressed as minimizing z
(2) Functional constraints could also be expressed with ≥ or =
(3) This requirement is also known as the nonnegativity constraint
(1) Objective function could also be expressed as minimizing z
(2) Functional constraints could also be expressed with ≥ or =
(3) This requirement is also known as the nonnegativity constraint
>> Read more
http://hughesbennett.co.uk/Octave