function analysis
import Modelica;
import Modelica_LinearSystems2.StateSpace;
import Modelica_LinearSystems2.ZerosAndPoles;
import Modelica_LinearSystems2.Internal.AnalyseOptions;
import Modelica_LinearSystems2.Internal.AnalyseOptions2;
input ZerosAndPoles zp(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 = "" "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.ZerosAndPoles;
input ZerosAndPoles zp "transfer function to analyze";
input String fileName = "systemAnalysis.html" "File on which the zeros-and-poles transfer function is written in html format";
input String systemName = "ZerosAndPoles 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(zp);
algorithm
Modelica.Utilities.Files.removeFile(fileName);
print("<html><body><br><br><p>\n<strong>System report</strong>\n</p>", fileName);
print("<body><p><br> The system <strong>" + systemName + "</strong> is defined by</p>", fileName);
print("G(p) = " + st, fileName);
if description == "" then
print("</table>", fileName);
else
print("</table>", fileName);
print("<body><p><strong>Description</strong></p>", fileName);
print(description, fileName);
end if;
end printSystem;
end analysis;