<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Sympy is a Python package used for solving equations using symbolic math. 
Let's solve the following problem with SymPy. 
Given
Step1:  We need to define six different symbols
Step2:  Next we'll create two expressions for our two equations. We can subtract the %crystallinity from the left side of the equation to set the equation to zero. 
$$ \%crystallinity = \frac{ \rho_c(\rho_s - \rho_a)   }{\rho_s(\rho_c - \rho_a)   } \times 100 \% $$
$$ \frac{ \rho_c(\rho_s - \rho_a)   }{\rho_s(\rho_c - \rho_a)   } \times 100 \% - \%crystallinity = 0 $$
Sub in $\rho_s = \rho_1$ and $\rho_s = \rho_2$ to each of the expressions.
Step3:  Now we'll substitue in the values of $\rho_1 = 1.408$ and $c_1 = 0.743$ into our first expression.
Step4:  Now we'll substitue our the values of $\rho_2 = 1.343$ and $c_2 = 0.312$ into our second expression.
Step5:  To solve the two equations for the to unknows $\rho_a$ and $\rho_b$, use SymPy's nonlinsolve() function. Pass in a list of the two expressions and followed by a list of the two variables to solve for.
Step6:  We see that the value of $\rho_a = 1.29957$ and $\rho_c = 1.44984$.
The solution is a SymPy FiniteSet object. To pull the values of $\rho_a$ and $\rho_c$ out of the FiniteSet, use the syntax sol.args[0][&lt;var num&gt;].
<ASSISTANT_TASK:>
Python Code:
from sympy import symbols, nonlinsolve
Explanation: Sympy is a Python package used for solving equations using symbolic math. 
Let's solve the following problem with SymPy. 
Given:
The density of two different polymer samples $\rho_1$ and $\rho_2$ are measured. 
$$ \rho_1 = 1.408 \ g/cm^3 $$
$$ \rho_2 = 1.343 \ g/cm^3 $$
The percent crystalinity of the two samples ($\%c_1 $ and $\%c_2$) is known. 
$$ \%c_1 = 74.3 \% $$
$$ \%c_2 = 31.2 \% $$
The percent crystalinity of a polymer sample is related to the density of 100% amorphus regions ($\rho_a$) and 100% crystaline regions ($\rho_c$) according to:
$$ \%crystallinity = \frac{ \rho_c(\rho_s - \rho_a)   }{\rho_s(\rho_c - \rho_a)   } \times 100 \% $$
Find:
Find the density of 100% amorphus regions ($\rho_a$) and the density of 100% crystaline regions ($\rho_c$) for this polymer.
Solution:
There are a couple functions we need from Sympy. We'll need the symbols function to create our symbolic math variables and we need the nonlinsolve function to solve a system of non-linear equations.
End of explanation
pc, pa, p1, p2, c1, c2 = symbols('pc pa p1 p2 c1 c2')
Explanation: We need to define six different symbols: $$\rho_c, \rho_a, \rho_1, \rho_2, c_1, c_2$$
End of explanation
expr1 = ( (pc*(p1-pa)   ) / (p1*(pc-pa)) - c1)
expr2 = ( (pc*(p2-pa)   ) / (p2*(pc-pa)) - c2)
Explanation: Next we'll create two expressions for our two equations. We can subtract the %crystallinity from the left side of the equation to set the equation to zero. 
$$ \%crystallinity = \frac{ \rho_c(\rho_s - \rho_a)   }{\rho_s(\rho_c - \rho_a)   } \times 100 \% $$
$$ \frac{ \rho_c(\rho_s - \rho_a)   }{\rho_s(\rho_c - \rho_a)   } \times 100 \% - \%crystallinity = 0 $$
Sub in $\rho_s = \rho_1$ and $\rho_s = \rho_2$ to each of the expressions.
End of explanation
expr1 = expr1.subs(p1, 1.408)
expr1 = expr1.subs(c1, 0.743)
expr1
Explanation: Now we'll substitue in the values of $\rho_1 = 1.408$ and $c_1 = 0.743$ into our first expression.
End of explanation
expr2 = expr2.subs(p2, 1.343)
expr2 = expr2.subs(c2, 0.312)
expr2
Explanation: Now we'll substitue our the values of $\rho_2 = 1.343$ and $c_2 = 0.312$ into our second expression.
End of explanation
nonlinsolve([expr1,expr2],[pa,pc])
Explanation: To solve the two equations for the to unknows $\rho_a$ and $\rho_b$, use SymPy's nonlinsolve() function. Pass in a list of the two expressions and followed by a list of the two variables to solve for.
End of explanation
sol = nonlinsolve([expr1,expr2],[pa,pc])
type(sol)
sol.args
sol.args[0]
sol.args[0][0]
pa = sol.args[0][0]
pc = sol.args[0][1]
print(f' Density of 100% amorphous polymer, pa = {round(pa,2)} g/cm3')
print(f' Density of 100% crystaline polymer, pc = {round(pc,2)} g/cm3')
Explanation: We see that the value of $\rho_a = 1.29957$ and $\rho_c = 1.44984$.
The solution is a SymPy FiniteSet object. To pull the values of $\rho_a$ and $\rho_c$ out of the FiniteSet, use the syntax sol.args[0][&lt;var num&gt;].
End of explanation
<END_TASK>