function analysis
import Modelica;
import Modelica_LinearSystems2.StateSpace;
import Modelica_LinearSystems2.TransferFunction;
import Modelica_LinearSystems2.Internal.AnalyseOptions;
import Modelica_LinearSystems2.Internal.AnalyseOptions2;
input TransferFunction tf(uName = "u", yName = "y") "transfer function of a system";
input AnalyseOptions2 analyseOptions2 = AnalyseOptions2(printControllability = false, printObservability = false);
input String fileName = "eigenvalues.html" "Name of html-file that contains eigenvalue table";
input String systemName = "tf" "Name of system (used as heading in html file)";
input String description = "" "Description of system (used in html file)";
encapsulated function printSystem "Print the state space system in html format on file"
import Modelica;
import Modelica.Utilities.Streams.print;
import Modelica_LinearSystems2.TransferFunction;
input TransferFunction tf "transfer function to analyze";
input String fileName = "systemAnalysis.html" "File on which the transfer function is written in html format";
input String systemName = "Transfer Function" "name of the system";
input String description = "" "Description of system (used in html file)";
input String format = ".3g" "Format of numbers (e.g. \"20.8e\")";
protected
String st = String(tf);
algorithm
Modelica.Utilities.Files.removeFile(fileName);
print("<html>\n<body>\n<p><strong>System report</strong></p>", fileName);
print("<p> The system " + systemName + " is defined by</p>", fileName);
print("G(s) = " + st, fileName);
if description == "" then
print("</table> ", fileName);
else
print("</table>", fileName);
print("<p><strong>Description</strong></p>", fileName);
print(description, fileName);
end if;
print("<br></body></html>", fileName);
end printSystem;
end analysis;