This paper presents an evolutionary based method to obtain the un-stressed lattice spacing, d0, required to calculate the residual stress profile across a weld of an age-hardenable aluminum alloy, AA2024. Due to the age-hardening nature of this alloy, the d0 value depends on the heat treatment. In the case of welds, the heat treatment imposed by the welding operation differs significantly depending on the distance to the center of the joint. This implies that a variation of d0 across the weld is expected, a circumstances which limits the possibilities of conventional analytical methods to determine the required d0 profile. The interest of the paper is, therefore, two-fold: First, to demonstrate that the application of an evolutionary algorithm solves a problem not addressed in the literature such as the determination of the required data to calculate the residual stress state across a weld. Second, to show the robustness of the approximation used, which allows obtaining solutions for different constraints of the problem. Our results confirm the capacity of evolutionary computation to reach realistic solutions under three different scenarios of the initial conditions and the available experimental data.