Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1.85 KB

README.md

File metadata and controls

46 lines (35 loc) · 1.85 KB

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