function TestBend
input Real angle;
input Real radius;
output Real coefficient_a;
output Real coefficient_b;
Modelica.Blocks.Tables.CombiTable2D A_Coefficient(fileName = "C:\Users\AWH7RNG\Desktop\a_data.txt", smoothness = Modelica.Blocks.Types.Smoothness.ContinuousDerivative, tableName = "A'_Coefficient", tableOnFile = true) annotation(
Placement(visible = true, transformation(origin = {-10, 54}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.RealExpression Radius_A(y = radius) annotation(
Placement(visible = true, transformation(origin = {-62, 64}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.RealExpression Angle_A(y = angle) annotation(
Placement(visible = true, transformation(origin = {-62, 32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Tables.CombiTable2D B_Coefficient(fileName = "C:\Users\AWH7RNG\Desktop\b_data.txt", tableName = "B_Coefficient") annotation(
Placement(visible = true, transformation(origin = {4, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.RealExpression Radius_B(y = radius) annotation(
Placement(visible = true, transformation(origin = {-56, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.RealExpression Angle_B(y = angle) annotation(
Placement(visible = true, transformation(origin = {-56, -32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
algorithm
radius := Radius_B.y;
angle := Angle_A.y ;
angle := Angle_B.y;
radius := Radius_A.y;
coefficient_a := A_Coefficient.y;
coefficient_b := B_Coefficient.y;
equation
connect(Angle_B.y, B_Coefficient.u2) annotation(
Line(points = {{-44, -32}, {-24, -32}, {-24, -26}, {-8, -26}, {-8, -26}}, color = {0, 0, 127}));
connect(Radius_B.y, B_Coefficient.u1) annotation(
Line(points = {{-44, -8}, {-22, -8}, {-22, -14}, {-8, -14}, {-8, -14}}, color = {0, 0, 127}));
connect(Angle_A.y, A_Coefficient.u2) annotation(
Line(points = {{-51, 32}, {-37, 32}, {-37, 48}, {-21, 48}, {-21, 48}, {-23, 48}, {-23, 48}}, color = {0, 0, 127}));
connect(Radius_A.y, A_Coefficient.u1) annotation(
Line(points = {{-51, 64}, {-35, 64}, {-35, 60}, {-21, 60}, {-21, 60}, {-23, 60}, {-23, 60}}, color = {0, 0, 127}));
annotation(
uses(Modelica(version = "3.2.3")));
end TestBend;