To describe a program that simulates a computed tomographic scan with the polychromatic aspect of the output of the x-ray tube implemented. This program can be used in the study of the attenuation of different solutions/solutes. These results can subsequently guide the radiologist to obtain a satisfying contrast enhancement at lower tube voltages and eventually lower contrast volumes. A Matlab program was written to simulate a computed tomographic scan. The spectrum of the x-ray tube at different kilovoltages was generated with another program (XOP) and used as input. Beam-hardening correction and zero padding were added. The results were validated with attenuation measurements of a corresponding potassium iodide solution in water. There was a good agreement between the calculated and measured attenuations; the calculated results matched with the measured values and fell within a 5% deviation. It is possible to simulate correctly the attenuation of a potassium iodide in water solution in silico. This can be helpful to determine kilovoltages, administered contrast medium volumes and concentrations to reduce the irradiation of the patients, and obtain equally good contrast enhancement on a basis other than empirical.