def __add__(self, other):
<EOL>if type(other) is MaterialPackage:<EOL><INDENT>solid_mass = self.get_solid_mass()<EOL>other_solid_mass = other.get_solid_mass()<EOL>solid_density = (solid_mass + other_solid_mass) /(solid_mass / self.solid_density +<EOL>other_solid_mass / other.solid_density)<EOL>H2O_mass = self.H2O_mass + other.H2O_mass<EOL>if self.material == other.material:<EOL><INDENT>result = MaterialPackage(<EOL>self.material,<EOL>solid_density,<EOL>H2O_mass,<EOL>self.size_class_masses + other.size_class_masses)<EOL>return result<EOL><DEDENT>else:  <EOL><INDENT>result = self.clone()<EOL>result.solid_density = solid_density<EOL>result.H2O_mass = H2O_mass<EOL>for size_class in other.material.size_classes:<EOL><INDENT>if size_class not in self.material.size_classes:<EOL><INDENT>raise Exception(<EOL>"<STR_LIT>" + other.material.name +<EOL>"<STR_LIT>" +<EOL>self.material.name + "<STR_LIT>" +<EOL>size_class + "<STR_LIT>" +<EOL>self.material.name + "<STR_LIT>")<EOL><DEDENT>result = result + (<EOL>size_class, other.get_size_class_mass(size_class))<EOL><DEDENT>return result<EOL><DEDENT><DEDENT>elif self._is_H2O_mass_tuple(other):<EOL><INDENT>mass = other[<NUM_LIT:1>]<EOL>result = self.clone()<EOL>result.H2O_mass += mass<EOL>return result<EOL><DEDENT>elif self._is_size_class_mass_tuple(other):<EOL><INDENT>size_class = other[<NUM_LIT:0>]<EOL>compound_index = self.material.get_size_class_index(size_class)<EOL>mass = other[<NUM_LIT:1>]<EOL>result = self.clone()<EOL>result.size_class_masses[compound_index] =result.size_class_masses[compound_index] + mass<EOL>return result<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>
Addition operator (+).
Add self and 'other' together, return the result as a new package,
and leave self unchanged.

:param other: Can can be one of the following:
  1. MaterialPackage: 'other' is added to self to create a new package.
  2. tuple: (size class, mass) The specified mass of the specified size
  class is added to self.

:returns: A new Material package that is the sum of self and 'other'.