You will write functions that turn a description of voids into a formula. One finds the size of each void. One counts the cations for each anion. One writes the formula in the smallest whole numbers. One checks the charges.
The idea. close packed anions make octahedral and tetrahedral voids. A tetrahedral void takes a sphere of and an octahedral void . Exact fractions keep the formula exact: Python's Fraction(2, 3) is two thirds.
Your tasks.
void_radius(kind, R) for "tet" and "oct".cations_per_anion(tet, oct), where tet and oct are the fractions of the voids that are filled.formula(tet, oct) so that it returns the smallest whole numbers (cations, anions).neutral(cation_charge, anion_charge, tet, oct) so that it returns True when the charges balance.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…