Scilab code and mathematica notebook