Mr.CAS - A Minimalistic (pure) Ruby CAS for Fast Prototyping and Code Generation
There are complete Computer Algebra System (CAS) systems on the marketm with complete solutions for analysis of analytical models. But exporting a model, for optimization or any other research activity, requires a lot of work, even with a good software.
This work presents a Ruby library that exposes minimalistic CAS capabilities - i.e. simplifications, substitutions, evaluations, etc. Library aims at rapid prototyping of numerical interfaces and code generation for different target languages, separating mathematical expression from exportation rules - e.g. models from numerical conditioning best practices.
The library is implemented in pure Ruby language and compatible with all Ruby interpreter flavours.
This Gist repository contains a working version of the scripts presented in the different listings of the paper. Due to restriction on number of words, some obvious part were omitted. All the scripts complete are presented here, numbered as in the paper.
Expected outputs in console are highlighted with
There is a
Rakefile that runs the scripts. For installing dependencies:
License for Gist Repository
Copyright (c) 2016 Matteo Ragni
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This license covers all the file included in this repository