# 组件数组¶

  HTC.HeatCapacitor capacitance[n](each final C=C/n, each T(start=T0, fixed=true))
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
origin={-30,20})));
HTC.ThermalConductor wall[n](each final G=G_wall/n)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=90, origin={-30,-20})));
HTC.ThermalConductor rod_conduction[n-1](each final G=G_rod)
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));


record Point
Real x;
Real y;
Real z;
end Point;


record Vector3D
Real x[3];
end Vector3D;

model ArrayExample
Point p[2];
Point q[2,3];
Vector3D v[4];
equation
p.x = {1, 2}; // p[1].x = 1, p[2].x = 2
q[:,3].y = {4, 5}; // q[1,3].y = 4, q[2, 3].y = 5;
q.x = [1, 2, 3; 4, 5, 6] // q[1,1].x = 1,
// q[1,2].x = 2,
// q[2,3].x = 6
v.x[1] = {1, 2, 3, 4}; // v[1].x[1] = 1, v[2].x[1] = 2,
// v[3].x[1] = 3, v[4].x[1] = 4
v[:].x[1] = {1, 2, 3, 4}; // v[1].x[1] = 1, v[2].x[1] = 2,
// v[3].x[1] = 3, v[4].x[1] = 4
v[2:3].x[1] = {2, 3}; // v[2].x[1] = 2, v[3].x[1] = 3
v[1].x = {1, 2, 3};   // v[1].x[1] = 1, v[1].x[2] = 2,
// v[1].x[3] = 3
end ArrayExample;