Creating a Template for Circular Tank in Physical Modeler

Hi,

I'm creating a template for a circular tank for a project. I got stuck in XML code for the trapezoidal load application of surcharge and earth pressure. Can you kindly share the XML code for applying Earth pressure and surcharge loads only to the wall and toe. I'm relatively new to XML please guide me and it will be really helpful if you respond quickly.

I have attached the template I have created in notepad, please have a look and review it.

Awaiting your quick response.

<Template Name="Jesa Tank Template Circular">
	<Variables>
		<Group Name="Geometry" >
			<Input Name="n" Description="Number of facets" Type="Int" Minimum="3" Default="36" />
			<Input Name="d" Description="Diameter" Type="Quantity" DataType="Length" Minimum="0 m" Default="8m" />
			<Input Name="h" Description="Height of walls" Type="Quantity" DataType="Length" Minimum="0 m" Default="4.5 m" />
			<Input Name="bt" Description="Base thickness" Type="Quantity" DataType="SectionDimension" Minimum="0 mm" Default="400 mm" />
			<Input Name="wt" Description="Walls thickness" Type="Quantity" DataType="SectionDimension" Minimum="0 mm" Default="300 mm" />
            <Input Name="toe" Description="Toe to edge of walls" Type="Quantity" DataType="Length" Minimum="0 mm" Default="250 mm|10 in" />
            <Input Name="includeRoofSlab" Description="Include roof slab" Type="Bool" Default="False" />
			<Input Name="st" Description="Slab thickness" Type="Quantity" DataType="SectionDimension" Minimum="0 mm" Default="300 mm|12 in" IsVisible="includeRoofSlab" />
			<Input Name="simplySupported" Description="Simply supported slab" Type="bool" Default="False" IsVisible="includeRoofSlab" />
			<Input Name="Material" Description="Material" Type="Material" />
		</Group>
		<Group Name="Supports" >
			<Input Name="allowTensile" Description="Allow tensile forces" Type="Bool" Default="false" />
			<Input Name="soilMod" Description="Soil modulus" Type="Quantity" DataType="SubgradeModulus" Minimum="0 kN/m2/m" Default="80000 kN/m2/m" />
		</Group>
		<Group Name="Loading" Description="Loading">
			<Input Name="loadType" Description="Load condition type" Type="Combo(LoadGroup, LoadCase)" TypeDescription="Load Group, Load Case" Default="LoadCase" />
			<Input Name="fluidUW" Description="Fluid density" Type="Quantity" DataType="Density" Minimum="0 kg/m3" Default="1000 kg/m3" />
			<Input Name="compFluidH" Description="Compartment fluid height" Type="Quantity" DataType="Length" Default="3.75 m" />
			<Input Name="selfWeight" Description="Include self weight" Type="Bool" Default="true" />
			<Input Name="roofLoad" Description="Roof surcharge" Type="Quantity" DataType="Pressure" Minimum="0 kN/m2" Default="4 kN/m2|80 lb/ft2" IsVisible="includeRoofSlab" />
			<Input Name="roofLoadLive" Description="Roof Live" Type="Quantity" DataType="Pressure" Minimum="0 kN/m2" Default="5 kN/m2|100 lb/ft2" IsVisible="includeRoofSlab" />
			<Input Name="soilLvl" Description="Soil level below top of tank walls" Type="Quantity" DataType="Length" Default="0 mm"/>
			<Input Name="soilUW" Description="Dry soil unit weight" Type="Quantity" DataType="Density" Minimum="0 kN/m3" Default="100 lb/ft3|15 kN/m3" />
			<Input Name="soilFA" Description="Soil internal friction angle" Type="Quantity" DataType="Angle" Minimum="0 deg" Default="30 deg" />
			<Input Name="deltaDeg" Description="Friction angle between soil and wall" Type="Quantity" DataType="Angle" Minimum="0 deg" Default="20 deg" />
            <Input Name="deadSurcharge" Description="Dead surcharge pressure" Type="Quantity" DataType="Pressure" Minimum="0 kN/m2" Default="0 kN/m2" />
			<Input Name="liveSurcharge" Description="Live surcharge pressure" Type="Quantity" DataType="Pressure" Minimum="0 kN/m2" Default="0 kN/m2" />
			<Input Name="hasSoildWL" Description="Consider water table" Type="Bool" Default="true" />
			<Input Name="waterUW" Description="Unit weight of water" Type="Quantity" DataType="Density" Minimum="0 kg/m3" Default="62.43 lb/ft3|1000 kg/m3" IsVisible="False" />
			<Input Name="soilUWsat" Description="Saturated soil unit weight" Type="Quantity" DataType="Density" Minimum="0 kN/m3" Default="115 lb/ft3|18 kN/m3" IsVisible="hasSoildWL"/>
			<Input Name="soilWL" Description="Water table depth below soil surface" Type="Quantity" DataType="Length" Default="1000 mm|40 in" IsVisible="hasSoildWL" />
		</Group>
	</Variables>
	<Model>

		<!-- Nodes -->
            <If Condition="toe='0'">
                <Then>
                     <Loop Variable="i" Start="0" End="n-1">
                        <Node ID="1+3*i" X="d/2*Cos(Radians(360/n*i))" Z="d/2*Sin(Radians(360/n*i))" />
	        	        <Node ID="2+3*i" X="d/2*Cos(Radians(360/n*i))" Y="h" Z="d/2*Sin(Radians(360/n*i))" />
                        <Node ID="3+3*i" X="d/2*Cos(Radians(360/n*i))" Y="h+st/2" Z="d/2*Sin(Radians(360/n*i))" />
                     </Loop>
                
                 <!-- Base -->
	    	<Surface ID="1" Thickness="bt" Material="Material" Attribute="SLAB_TANK" Alignment="Bottom">
		    	<Loop Variable="i" Start="0" End="n-1">
				    <Node ID="1+3*i" />
			    </Loop>
		    </Surface>
            <!-- Roof Slab -->
		<If Condition="includeRoofSlab">
			<Then>
				<Surface ID="2" Thickness="st" Material="Material" Attribute="SLAB_TANK" Alignment="Bottom">
		    	    <Loop Variable="i" Start="0" End="n-1">
				        <Node ID="3+3*i" />
			        </Loop>
                </Surface>
					<If Condition="simplySupported">
						<Then>
							<Property Element="Surface" ID="2" Name="EdgeRestraints" Value="fixed, Fixed, fixed, Fixed" />
						</Then>
					</If>
					<UniformPressure Surface="2" Magnitude="-roofLoad" Direction="Local3" LoadConditionID="1" />
					<UniformPressure Surface="2" Magnitude="-roofLoadLive" Direction="Local3" LoadConditionID="2" />
			</Then>
		</If> 
      
		       <!-- Walls -->
		    <Loop Variable="i" Start="0" End="n-1">
			    <Surface ID="i+3" Thickness="wt" Material="Material" Attribute="WALL_TANK">
			    	<Node ID="1+3*i" />
				    <Node ID="2+3*i" />
			    	<Node ID="2+3*((i+1)%n)" />
				    <Node ID="1+3*((i+1)%n)" />
			    </Surface>
              </Loop>
             </Then>
            <!-- Base Slab Toe Regions -->
            </If>
            <If Condition="toe>0">
                <Then>
                     <Loop Variable="i" Start="0" End="n-1">
                        <Node ID="1+4*i" X="(d+2*toe+wt)/2*Cos(Radians(360/n*i))" Z="(d+2*toe+wt)/2*Sin(Radians(360/n*i))" />
                        <Node ID="2+4*i" X="d/2*Cos(Radians(360/n*i))" Z="d/2*Sin(Radians(360/n*i))" /> 
                        <Node ID="3+4*i" X="d/2*Cos(Radians(360/n*i))" Y="h" Z="d/2*Sin(Radians(360/n*i))" />
                        <Node ID="4+4*i" X="(d)/2*Cos(Radians(360/n*i))" Y="h+st/2" Z="(d)/2*Sin(Radians(360/n*i))" />
                        
                     </Loop>
                   <!-- Base -->
		<Surface ID="1" Thickness="bt" Material="Material" Attribute="SLAB_TANK" Alignment="Bottom">
			<Loop Variable="i" Start="0" End="n-1">
				<Node ID="1+4*i" />
			</Loop>
		</Surface>
         <!-- Roof Slab -->
		    <If Condition="includeRoofSlab">
			    <Then>
			    	<Surface ID="2" Thickness="st" Material="Material" Attribute="SLAB_TANK" Alignment="Bottom">
		    	        <Loop Variable="i" Start="0" End="n-1">
				            <Node ID="4+4*i" />
			            </Loop>
                    </Surface>
				    	<If Condition="simplySupported">
					    	<Then>
							    <Property Element="Surface" ID="2" Name="EdgeRestraints" Value="Pinned, Fixed, Pinned, Fixed" />
						    </Then>
					    </If>
					    <UniformPressure Surface="2" Magnitude="roofLoad" Direction="Local3" LoadConditionID="1" />
					    <UniformPressure Surface="2" Magnitude="roofLoadLive" Direction="Local3" LoadConditionID="2" />
			    </Then>
		    </If> 
      
		          <!-- Walls -->
		<Loop Variable="i" Start="0" End="n-1">
			<Surface ID="i+3" Thickness="wt" Material="Material" Attribute="WALL_TANK">
				<Node ID="2+4*i" />
				<Node ID="3+4*i" />
				<Node ID="3+4*((i+1)%n)" />
				<Node ID="2+4*((i+1)%n)" />
			</Surface>
			</Loop>
                 </Then>
            </If>
          		

		<!-- Base Support -->
		<Property Element="Surface" ID="1" Name="SupportDirection" Value="Y" />
		<Property Element="Surface" ID="1" Name="MatSubgradeModulus" Value="soilMod" />
		<If Condition="Not allowTensile">
			<Then>
				<Property Element="Surface" ID="1" Name="MatAxialBehaviour" Value="CompressionOnly" />
			</Then>
		</If>

		<!-- Load Groups or Load Cases -->
		<Variable Name="hasDeadSurcharge" Value="deadSurcharge&gt;0" Type="Bool"/>
		<Variable Name="hasLiveSurcharge" Value="liveSurcharge&gt;0" Type="Bool"/>
		<If Condition="loadType=LoadGroup">
			<Then>
				<LoadGroup ID="1" Name="Dead" Description="Dead Load" Type="Staad_Dead" />
				<If Condition="includeRoofSlab">
					<Then>
						<LoadGroup ID="2" Name="Roof" Description="Roof Load" Type="Staad_RoofLive" />
					</Then>
				</If>
				<LoadGroup ID="3" Name="Dry Soil" Description="Soil pressure dry conditions" Type="Staad_Soil" />
				<If Condition="hasSoildWL">
					<Then>
						<LoadGroup ID="4" Name="Saturated Soil" Description="Soil pressure saturated conditions" Type="Staad_Soil" />
						<LoadGroup ID="5" Name="Water Table" Description="Water Table" Type="Staad_Fluids" />
					</Then>
				</If>
				<If Condition="hasDeadSurcharge">
					<Then>
						<LoadGroup ID="6" Name="Dead Surcharge" Description="Dead Surcharge" Type="Staad_Dead" />
					</Then>
				</If>
				<If Condition="hasLiveSurcharge">
					<Then>
						<LoadGroup ID="7" Name="Live Surcharge" Description="Live Surcharge" Type="Staad_Live" />
					</Then>
                 </If>
				<If Condition="selfWeight">
					<Then>
						<Property Element="LoadGroup" ID="1" Name="SelfWeightMultiplierY" Value="-1.0" />
					</Then>
				</If>
			</Then>
		</If>
		<If Condition="loadType=LoadCase">
			<Then>
				<LoadCase ID="1" Name="Dead" Description="Dead Load" Type="Staad_Dead" />
				<If Condition="includeRoofSlab">
					<Then>
						<LoadCase ID="2" Name="Roof" Description="Roof Load" Type="Staad_RoofLive" />
					</Then>
				</If>
				<LoadCase ID="3" Name="Dry Soil" Description="Soil pressure dry conditions" Type="Staad_Soil" />
				<If Condition="hasSoildWL">
					<Then>
						<LoadCase ID="4" Name="Saturated Soil" Description="Soil pressure saturated conditions" Type="Staad_Soil" />
						<LoadCase ID="5" Name="Water Table" Description="Water Table" Type="Staad_Fluids" />
					</Then>
				</If>
				<If Condition="hasDeadSurcharge">
					<Then>
						<LoadCase ID="6" Name="Dead Surcharge" Description="Dead Surcharge" Type="Staad_Dead" />
					</Then>
				</If>
				<If Condition="hasLiveSurcharge">
					<Then>
						<LoadCase ID="7" Name="Live Surcharge" Description="Live Surcharge" Type="Staad_Live" />
					</Then>
                </If>
				<If Condition="selfWeight">
					<Then>
						<Property Element="LoadCase" ID="1" Name="SelfWeightMultiplierY" Value="-1.0" />
					</Then>
				</If>
			</Then>
		</If>

		<!-- Hydrostatic Load -->
		<Hydrostatic Y="compFluidH" Density="fluidUW" LoadConditionID="1">
			<Polygon>
				<Loop Variable="i" Start="0" End="n-1">
					<Point X="d/2*Cos(Radians(360/n*i))" Z="d/2*Sin(Radians(360/n*i))" />
				</Loop>
			</Polygon>
			<Surface ID="1" />
			<Loop Variable="i" Start="0" End="n-1">
				<Surface ID="i+2" />
			</Loop>
		</Hydrostatic>
        
    <Variable Name="phiS" Value="Radians(soilFA)" Type="Float" />
	<Variable Name="delta" Value="Radians(deltaDeg)" Type="Float" />
	<Variable Name="sinPhi" Value="Sin(Radians(soilFA))" Type="Float" />
	<Variable Name="Ka" Value="(1-sinPhi)/(1+sinPhi)" Type="Float" />
	<Variable Name="soilH" Value="h-soilLvl" Type="Float" />
    
    <!-- Dead Load Surcharge -->
		<If Condition="hasDeadSurcharge">
			<Then>
         <LateralPressure Y0="soilH" Surcharge="Ka*deadSurcharge" LoadConditionID="6" Color="#B64D4D" >
				<Loop Variable="i" Start="0" End="n-1">
					<Surface ID="1+2*i" />
                    <Surface ID="2+2*i" />
                </Loop>		
		 </LateralPressure>   	
            </Then>
		</If>

	</Model>
</Template>