Hi,
I started putting together a set of libraries under a github repository(
https://github.com/aryajur/LuaMath) to build a Math package for Lua. I needed something I could use from the standard latest Lua interpreter directly so can be embedded into programs that embed the standard interpreter. I am building it as I need features. For now it has the following:
- Solving single variable equations using Newton Raphson method
An example for plotting a bode plot is this:
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"})
More stuff is welcome.
Regards,
Milind