program test_wire_resistivity
    implicit none

    ! Define mathematical and experimental constants
    real, parameter :: pi = 3.14159265359
    real, parameter :: r_standard = 10.0      ! Known standard resistance (ohms)[span_0](start_span)[span_0](end_span)
    real, parameter :: length_wire = 1.00     ! Length of the test wire (m)[span_1](start_span)[span_1](end_span)
    real, parameter :: diameter_wire = 0.5e-3 ! Diameter of the wire in meters (0.5 mm)[span_2](start_span)[span_2](end_span)
    real, parameter :: lx = 0.795             ! Balance length for the test wire (m)[span_3](start_span)[span_3](end_span)
    real, parameter :: l10 = 0.205            ! Balance length for the 10 ohm resistor (m)[span_4](start_span)[span_4](end_span)

    ! Declare variables for calculated results
    real :: area_wire
    real :: r_wire
    real :: resistivity

    ! 1. Calculate cross-sectional area: A = (pi * d^2) / 4[span_5](start_span)[span_5](end_span)
    area_wire = (pi * diameter_wire**2) / 4.0

    ! 2. Calculate wire resistance: R_wire = R_standard * (lx / l10)[span_6](start_span)[span_6](end_span)
    r_wire = r_standard * (lx / l10)

    ! 3. Calculate wire resistivity: rho = R_wire * (A / l)[span_7](start_span)[span_7](end_span)
    resistivity = r_wire * (area_wire / length_wire)

    ! Display the results
    print *, "=============================================="
    print *, " TEST WIRE RESISTANCE & RESISTIVITY RESULTS"
    print *, "=============================================="
    print '(A, ES12.4, A)', " Cross-sectional Area = ", area_wire, " m^2"
    print '(A, F10.2, A)',  " Wire Resistance      = ", r_wire, " ohms"
    print '(A, ES12.4, A)', " Wire Resistivity     = ", resistivity, " Ohm.m"
    print *, "=============================================="

end program test_wire_resistivity

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: