Doing Math with Lua. This package aims to collect all general purpose packages that can run from standard latest Lua distribution to use as a powerful math package.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
clibs/mapm
notes
src
test
.gitmodules
README.md

README.md

LuaMath

Introduction

This is a package to collect, maintain and create functionality to allow the standard latest Lua interpreter and other software that embed Lua to be used as a Mathematical package. It is not limited to just numerical manipulations but also symbolic equation manipulations, plots and anything related.

Pre-requisites

Usage

All code file to use Lua Math should be placed in the root directory and should require LuaMath file which adds the proper path and cpath to the lua interpreter paths to find the required modules

Bode Plot example

require("LuaMath")
local plot = require "lua-plot" 

function func(s)
	return 1000/((1+s)*(1+s/100))
end

local bp = plot.bodePlot{
	func = func,
	ini = 0.01,
	finfreq = 1000,
	steps = 20
}

bp.mag:Show({title="Magnitude Plot",size="HALFxHALF"})
bp.phase:Show({title="Phase Plot",size="HALFxHALF"})

References