Standard boilerplate imports.
import numpy as np
Let's save the molar masses.
MFe = 55.845 # g/mol
MCu = 63.546
Now let's save the theoretical yield.
The reactions are:
yld = np.asarray([1.00, 1.50]) # 100% and 150% for Fe2 and Fe3
yld
array([ 1. , 1.5])
The masses of iron added and copper observed.
mFe = 0.78 # g
mCu_obs = 0.78 # g
Expected mass of copper for both reactions:
mCu = mFe / MFe * yld * MCu
mCu
array([ 0.88756164, 1.33134247])
Error calculation:
err = np.abs(mCu_obs - mCu) / mCu
err * 100 # now in %
array([ 12.1187801 , 41.41252006])