Tutorial 1 - Using the materials library

This tutorial demonstrates how to manage material properties for power cable modeling using the package LineCableModels.jl. Accurate knowledge of electromagnetic properties is essential for reliable cable design and analysis.

Beyond showcasing the API, this guide serves as a practical reference by providing standard property values from recognized industry sources like CIGRE TB-531 [8] and IEC 60287 [9] that can be stored and consistently applied across multiple design iterations and simulation studies.

Tutorial outline

Getting started

Load the package:

using LineCableModels
using DataFrames

The MaterialsLibrary is a container for storing electromagnetic properties of different materials used in power cables. By default, it initializes with several common materials with their standard properties.

Initialize a MaterialsLibrary with default values:

materials = MaterialsLibrary()
MaterialsLibrary with 12 materials:
├─ pe
├─ copper
├─ pec
├─ polyacrylate
└─ semicon1
└─ ... and 7 more

Inspect the contents of the materials library:

materials_df = DataFrame(materials)
12×6 DataFrame
Rownamerhoeps_rmu_rT0alpha
StringFloat64Float64Float64Float64Float64
1pe1.97e142.31.020.00.0
2copper1.7241e-81.00.99999420.00.00393
3pec2.22045e-161.01.020.00.0
4polyacrylate5300.032.31.020.00.0
5semicon11000.01000.01.020.00.0
6xlpe1.97e142.51.020.00.0
7semicon2500.01000.01.020.00.0
8aluminum2.8264e-81.01.0000220.00.00429
9lead2.14e-71.00.99998320.00.004
10airInf1.01.020.00.0
11pp1.0e152.81.020.00.0
12steel1.38e-71.0300.020.00.0045

The function DataFrame returns a DataFrame with all materials and their properties, namely: electrical resistivity, relative permittivity, relative permeability, reference temperature, and temperature coefficient.

Adding new materials

Note

New materials can be added to the library using the Material constructor followed by add!.

It might be useful to add other conductor materials with corrected properties based on recognized standards [8] [9].

copper_corrected = Material(1.835e-8, 1.0, 0.999994, 20.0, 0.00393) # Copper with corrected resistivity from IEC 60287-3-2
add!(materials, "copper_corrected", copper_corrected)
aluminum_corrected = Material(3.03e-8, 1.0, 0.999994, 20.0, 0.00403) # Aluminum with corrected resistivity from IEC 60287-3-2
add!(materials, "aluminum_corrected", aluminum_corrected)
MaterialsLibrary with 14 materials:
├─ pe
├─ aluminum_corrected
├─ copper
├─ pec
└─ polyacrylate
└─ ... and 9 more

lead = Material(21.4e-8, 1.0, 0.999983, 20.0, 0.00400) # Lead or lead alloy add!(materials, "lead", lead) steel = Material(13.8e-8, 1.0, 300.0, 20.0, 0.00450) # Steel add!(materials, "steel", steel) bronze = Material(3.5e-8, 1.0, 1.0, 20.0, 0.00300) # Bronze add!(materials, "bronze", bronze)

stainless_steel = Material(70.0e-8, 1.0, 500.0, 20.0, 0.0) # Stainless steel
add!(materials, "stainless_steel", stainless_steel)
MaterialsLibrary with 15 materials:
├─ pe
├─ aluminum_corrected
├─ copper
├─ pec
└─ polyacrylate
└─ ... and 10 more

When modeling cables for EMT analysis, one might be concerned with the impact of insulators and semiconductive layers on cable constants. Common insulation materials and semicons with different dielectric properties are reported in Table 6 of [8]. Let us include some of these materials in the MaterialsLibrary to help our future selves.

epr = Material(1e15, 3.0, 1.0, 20.0, 0.005) # EPR (ethylene propylene rubber)
add!(materials, "epr", epr)
pvc = Material(1e15, 8.0, 1.0, 20.0, 0.1) # PVC (polyvinyl chloride)
add!(materials, "pvc", pvc)
laminated_paper = Material(1e15, 2.8, 1.0, 20.0, 0.0) # Laminated paper propylene
add!(materials, "laminated_paper", laminated_paper)
carbon_pe = Material(0.06, 1e3, 1.0, 20.0, 0.0) # Carbon-polyethylene compound (semicon)
add!(materials, "carbon_pe", carbon_pe)
conductive_paper = Material(18.5, 8.6, 1.0, 20.0, 0.0) # Conductive paper layer (semicon)
add!(materials, "conductive_paper", conductive_paper)
MaterialsLibrary with 20 materials:
├─ pe
├─ aluminum_corrected
├─ copper
├─ pec
└─ conductive_paper
└─ ... and 15 more

Removing materials

Note

Materials can be removed from the library with the delete! function.

Add a duplicate material by accident:

add!(materials, "epr_dupe", epr)
MaterialsLibrary with 21 materials:
├─ pe
├─ aluminum_corrected
├─ copper
├─ pec
└─ conductive_paper
└─ ... and 16 more

And now remove it using the delete! function:

delete!(materials, "epr_dupe")
[ Info: Material 'epr_dupe' removed from the library.

Examine the updated library after removing the duplicate:

println("Material properties compiled from CIGRE TB-531 and IEC 60287:")
materials_df = DataFrame(materials)
20×6 DataFrame
Rownamerhoeps_rmu_rT0alpha
StringFloat64Float64Float64Float64Float64
1pe1.97e142.31.020.00.0
2aluminum_corrected3.03e-81.00.99999420.00.00403
3copper1.7241e-81.00.99999420.00.00393
4pec2.22045e-161.01.020.00.0
5conductive_paper18.58.61.020.00.0
6laminated_paper1.0e152.81.020.00.0
7polyacrylate5300.032.31.020.00.0
8semicon11000.01000.01.020.00.0
9xlpe1.97e142.51.020.00.0
10semicon2500.01000.01.020.00.0
11aluminum2.8264e-81.01.0000220.00.00429
12carbon_pe0.061000.01.020.00.0
13lead2.14e-71.00.99998320.00.004
14copper_corrected1.835e-81.00.99999420.00.00393
15airInf1.01.020.00.0
16epr1.0e153.01.020.00.005
17pvc1.0e158.01.020.00.1
18pp1.0e152.81.020.00.0
19stainless_steel7.0e-71.0500.020.00.0
20steel1.38e-71.0300.020.00.0045

Saving the materials library to JSON

output_file = fullfile("materials_library.json")
save(materials, file_name = output_file);
[ Info: Materials library saved to: materials_library.json

Retrieving materials for use

Note

To load from an existing JSON file, instantiate a new MaterialsLibrary followed by a call to the load! method. Materials can be retrieved from the library using the get function.

Initialize a new MaterialsLibrary and load from the JSON file:

materials_from_json = MaterialsLibrary()
load!(materials_from_json, file_name = output_file)
MaterialsLibrary with 20 materials:
├─ pe
├─ aluminum_corrected
├─ copper
├─ pec
└─ conductive_paper
└─ ... and 15 more

Retrieve a material and display the object:

copper = get(materials_from_json, "copper_corrected")
Material with properties: [rho=1.835e-8, eps_r=1.0, mu_r=1.0, T0=20.0, alpha=0.00393]

Access the material properties:

println("Retrieved copper_corrected material properties:")
println("Resistivity: $(copper.rho) Ω·m")
println("Relative permittivity: $(copper.eps_r)")
println("Relative permeability: $(copper.mu_r)")
println("Reference temperature: $(copper.T0) °C")
println("Temperature coefficient: $(copper.alpha) 1/°C")
Retrieved copper_corrected material properties:
Resistivity: 1.835e-8 Ω·m
Relative permittivity: 1.0
Relative permeability: 0.999994
Reference temperature: 20.0 °C
Temperature coefficient: 0.00393 1/°C

Conclusion

This tutorial has demonstrated how to:

  1. Initialize a MaterialsLibrary with default Material objects.
  2. Add new materials with specific properties.
  3. Remove duplicate materials.
  4. Save the library to a file for future use.
  5. Retrieve materials for use in cable modeling.

The MaterialsLibrary provides a flexible and traceable framework to manage material properties for accurate power cable modeling. Custom Material objects can be defined and used to match specific manufacturer data or standards requirements.


🏠 Back to Tutorials