Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
repository:phase_changes [2020/09/15 16:39]
porcaro1 created
repository:phase_changes [2020/09/29 17:10] (current)
porcaro1
Line 31: Line 31:
 Below is a graph showing the heating curve for water. Take a look and use the [[https://​trinket.io/​glowscript/​d406d0473c?​showInstructions=true | code below]] and then answer the following questions that investigate the relationships between kinetic energy level, temperature,​ particle movement, etc. Below is a graph showing the heating curve for water. Take a look and use the [[https://​trinket.io/​glowscript/​d406d0473c?​showInstructions=true | code below]] and then answer the following questions that investigate the relationships between kinetic energy level, temperature,​ particle movement, etc.
  
-  ​- If the particle movement is low, the matter is in the _____ state. +{{:​repository:​water_curve.png?​nolink&​600|}} 
-  - The _____ state is reached as particles exhibit very high energy at a correspondingly _____ temperature. + 
-  - When a gas loses so much energy it turns into a liquid, it undergoes _____. +  ​- If the particle movement is low, the matter is in the %%_____%% state. 
-  - Since particles in a solid are closely packed together, they can only move _____. +  - The %%_____%% state is reached as particles exhibit very high energy at a correspondingly ​%%_____%% temperature. 
-  - Particles exhibit _____ velocities in the highest energy state. +  - When a gas loses so much energy it turns into a liquid, it undergoes ​%%_____%%
-  - Solid particles that absorb so much energy they turn into a gas undergo _____. +  - Since particles in a solid are closely packed together, they can only move %%_____%%
-  - At moderate levels of kinetic energy, the particles can move _____ and the matter exists as a _____.  +  - Particles exhibit ​%%_____%% velocities in the highest energy state. 
-  - Lower energy means _____ particle movement and _____ temperature. +  - Solid particles that absorb so much energy they turn into a gas undergo ​%%_____%%
-  - Theoretically,​ no particle movement occurs at _____ °C (0 K). +  - At moderate levels of kinetic energy, the particles can move %%_____%% and the matter exists as a %%_____%%.  
-  - Solids typically have _____ temperatures than gases. +  - Lower energy means %%_____%% particle movement and %%_____%% temperature. 
-  - If a gas is super heated to thousands of Kelvin, it ionizes and becomes _____. +  - Theoretically,​ no particle movement occurs at %%_____%% °C (0 K). 
-  - Increases in _____ result in greater particle velocity and therefore greater kinetic energy. +  - Solids typically have %%_____%% temperatures than gases. 
-  - The Kinetic Theory of Matter says that for hotter temperatures,​ the _____ of the particles move in matter.+  - If a gas is super heated to thousands of Kelvin, it ionizes and becomes ​%%_____%%
 +  - Increases in %%_____%% result in greater particle velocity and therefore greater kinetic energy. 
 +  - The Kinetic Theory of Matter says that for hotter temperatures,​ the %%_____%% of the particles move in matter.
  
 ==Pre-Coding Questions Part 2== ==Pre-Coding Questions Part 2==
Line 58: Line 60:
  
 ==Post-Coding Questions== ==Post-Coding Questions==
 +
 +{{ :​repository:​boiling.png?​nolink&​600|}}
  
 Now that you understand how the program works to show the relationship between kinetic energy, particle movement, and temperature,​ it is time to apply your knowledge to improving and extending the power of the program. Develop answers to the following questions by modifying and improving the [[https://​trinket.io/​glowscript/​d406d0473c?​showInstructions=true | existing code]]. Now that you understand how the program works to show the relationship between kinetic energy, particle movement, and temperature,​ it is time to apply your knowledge to improving and extending the power of the program. Develop answers to the following questions by modifying and improving the [[https://​trinket.io/​glowscript/​d406d0473c?​showInstructions=true | existing code]].
  
   - Do you think the movement of all particles is the same for all substances given the same energy? For example, should a particle of hydrogen (mass = 1.01 amu) move at the same velocity as a particle of nitrogen (mass = 14.01 amu) for a given temperature?​   - Do you think the movement of all particles is the same for all substances given the same energy? For example, should a particle of hydrogen (mass = 1.01 amu) move at the same velocity as a particle of nitrogen (mass = 14.01 amu) for a given temperature?​
-  - What are some of the key equations you would need model the movement of the particles?+  - What are some of the key equations you would need to model the movement of the particles?
   - Which variables are constants and which can change? ​   - Which variables are constants and which can change? ​
   - How could we show different movement for different types of substances?   - How could we show different movement for different types of substances?
Line 178: Line 182:
 ====Answer Key==== ====Answer Key====
 ===Handout=== ===Handout===
 +==Pre-Coding Questions Part 1==
 + If the particle movement is low, the matter is in the __**solid**__ state.
 +  - The __**gas**__ state is reached as particles exhibit very high energy at a correspondingly __**high**__ temperature.
 +  - When a gas loses so much energy it turns into a liquid, it undergoes __**condensation**__.
 +  - Since particles in a solid are closely packed together, they can only move __**vibrationally**__ .
 +  - Particles exhibit __**high**__ velocities in the highest energy state.
 +  - Solid particles that absorb so much energy they turn into a gas undergo __**sublimation**__.
 +  - At moderate levels of kinetic energy, the particles can move __**freely**__ and the matter exists as a __**liquid**__. ​
 +  - Lower energy means __**slower**__ particle movement and __**lower**__ temperature.
 +  - Theoretically,​ no particle movement occurs at __**-273.15**__ °C (0 K).
 +  - Solids typically have __**lower**__ temperatures than gases.
 +  - If a gas is super heated to thousands of Kelvin, it ionizes and becomes __**plasma**__.
 +  - Increases in __**temperature**__ result in greater particle velocity and therefore greater kinetic energy.
 +  - The Kinetic Theory of Matter says that for hotter temperatures,​ the __**more**__ of the particles move in matter.
 +
 +==Pre-Coding Questions Part 2==
 +  - {{:​repository:​heating_curve.jpg?​nolink&​600|}}
 +  - The first plateau is where the matter melts (goes from solid to liquid) or freezes (goes from liquid to solid). Likewise, the second plateau is where the matter boils/​vaporizes (goes from liquid to gas) or condenses (goes from gas to liquid)
 +  - See graph and previous answer
 +  - 273.1 K (0 °C)
 +  - 373.1 K (100 °C)
 +  - The graph accurately models the changes between the solid, liquid, and gas phases of water, but does not include the process of ionization
 +  - The first plateau is longer than the second. This indicates that the heat capacity of liquid water is higher than the heat capacity of steam. This means that water is more efficient and carrying heat; it requires more energy to change its temperature in the liquid phase versus the gaseous phase
 +
 +==Post-Coding Questions==
 +  - No. We know kinetic energy is equal to $\dfrac{1}{2}mv^2$. Rearranging for velocity, we find $v=\sqrt{\dfrac{2KE}{m}}$. Therefore, for the same energy level, more mass results in less velocity. ​
 +  - $Q=mc\Delta T$ and $Q=mL$
 +  - The mass, specific heat capacities, latent heat of fusion, latent heat of vaporization will not change. Energy input is an independent variable and temperature of the substance is a dependent variable.
 +  - We can show different heating curves for different substances by changing the parameters defined in lines 56-62 (specific heat capacities, latent heat of fusion, melting point, etc.)
 +  - Here are some examples:​{{:​repository:​heating_curves.jpg?​nolink&​600|}}
 +  - If the model occurred at 2 atmospheres of pressure, the melting/​freezing point would lower and the boiling/​condensing point would increase. We can look at a [[https://​chem.libretexts.org/​Bookshelves/​Physical_and_Theoretical_Chemistry_Textbook_Maps/​Supplemental_Modules_(Physical_and_Theoretical_Chemistry)/​Physical_Properties_of_Matter/​States_of_Matter/​Phase_Transitions/​Phase_Diagrams#:​~:​text=Phase%20diagram%20is%20a%20graphical,​diagram%2C%20a%20phase%20change%20occurs. | phase diagram]] to see how pressure affects change of state for different substances. One equation that relates pressure, temperature,​ and volume is the ideal gas law: $PV=nRT$ (note that this only applies to gases)
 ===Code=== ===Code===
-<code Python [enable_line_numbers="​true",​ highlight_lines_extra=""​]>​ +[[https://​trinket.io/​glowscript/​2f3f50f661?​showInstructions=true | Link]] 
-</​code>​+<code Python [enable_line_numbers="​true",​ highlight_lines_extra="​65,​66,​67,​68,​79,​89,​100"​]>​ 
 +GlowScript 2.7 VPython 
 +#COLLAPSE LINES 3, 8, 11, AND 16! These are special bundles of code, called subroutines,​ which help simplify the coding later in the program. 
 +def ShrinkSolidGrowLiquid():#​This subroutine changes the sizes of the solid and liquid phases during melting 
 +    solid.pos=solid.pos+vec(0,​-(L_box/​(2*ceil(m*Hfus/​dE))),​0) #​SizeIncrement1=L_box/​(2*ceil(m*Hfus/​dE)) 
 +    solid.radius=solid.radius-(L_box/​(2*ceil(m*Hfus/​dE))) 
 +    liquid.pos=liquid.pos+vec(0,​0.5*(L_box/​(2*ceil(m*Hfus/​dE))),​0) 
 +    liquid.size=liquid.size+vec(0,​(L_box/​(2*ceil(m*Hfus/​dE))),​0) 
 +def ShrinkLiquid():#​This subroutine changes the size of the liquid phase during vaporization 
 +    liquid.pos=liquid.pos+vec(0,​-0.5*L_box/​(2*ceil(m*Hvap/​dE)),​0) #​SizeIncrement2=L_box/​(2*ceil(m*Hvap/​dE)) 
 +    liquid.size=liquid.size+vec(0,​-L_box/​(2*ceil(m*Hvap/​dE)),​0) 
 +def MakeNewParticle():#​This subroutine creates a new gas particle and adds it to a list of particles 
 +    newparticle = sphere(pos=vector(L_box*(random()-0.5),​(L_box-liquid.size.y)*(random()-0.5)+liquid.size.y/​2,​L_box*(random()-0.5)),​radius=0.05,​ color=color.cyan) 
 +    newparticle.mass = 1 
 +    newparticle.velocity = vector(random()-0.5,​random()-0.5,​random()-0.5)*2 #the coefficient of 2 is a scaling factor for visual effect 
 +    listOfParticles.append(newparticle) 
 +def ParticleMovementAndCollisions():​ #This subroutine moves gas particles and handles particle-wall and particle-particle collisions 
 +    for particle in listOfParticles:​ 
 +        if Etotal > Eboil: #If all the liquid has evaporated, start increasing the velocity of the gas particles 
 +            particle.velocity=particle.velocity+sqrt(2*dE/​particle.mass)*(particle.velocity/​mag(particle.velocity))*2E-4 #Increase velocity with increasing energy. The coefficient of 2E-4 is a scaling factor for visual effect 
 +        particle.pos = particle.pos + particle.velocity*0.1 #Update particle position, assume dt=0.1 
 +        if abs(particle.pos.x) >= container.length/​2:#​Particle-wall collision in x 
 +            particle.velocity.x = - particle.velocity.x 
 +        if abs(particle.pos.y) >= container.height/​2 or particle.pos.y <= (liquid.size.y-L_box/​2):#​Particle-wall collision in y 
 +            particle.velocity.y = - particle.velocity.y 
 +        if abs(particle.pos.z) >= container.width/​2:#​Particle-wall collision in z 
 +            particle.velocity.z = - particle.velocity.z 
 +    for i in range(0,​len(listOfParticles)):#​Particle-particle collisions, loop through every particle 
 +        for j in range(i+1,​len(listOfParticles)):#​loop through every OTHER particle 
 +            diff = listOfParticles[j].pos - listOfParticles[i].pos #​displacement vector between two particles 
 +            distance = mag(diff) #magnitude of displacement is distance 
 +            if distance <= listOfParticles[i].radius + listOfParticles[j].radius:​ #if particles will collide, check their next positions 
 +                nextpos1 = listOfParticles[i].pos + listOfParticles[i].velocity*0.1 #assume dt=0.1 
 +                nextpos2 = listOfParticles[j].pos + listOfParticles[j].velocity*0.1 #assume dt=0.1 
 +                if mag(nextpos2 - nextpos1) < distance: #if they collide with each other, transfer momentum 
 +                    rhat = norm(diff) #unit vector of displacement 
 +                    mv1 = listOfParticles[i].mass*listOfParticles[i].velocity #momentum of first particle 
 +                    mv2 = listOfParticles[j].mass*listOfParticles[j].velocity #momentum of second particle 
 +                    transfer = 2.*dot(listOfParticles[i].mass*mv2-listOfParticles[j].mass*mv1,​rhat)/​(listOfParticles[i].mass+listOfParticles[j].mass)*rhat #momentum transferred 
 +                    listOfParticles[i].velocity = (mv1 + transfer)/​listOfParticles[i].mass 
 +                    listOfParticles[j].velocity = (mv2 - transfer)/​listOfParticles[j].mass 
 + 
 +#Define initial parameters: mass of system, inital temperature of system, initial energy of system, and length of container 
 +m = 100 #mass (g) 
 +T = 0 #Initial Temp (K) 
 +Etotal = 0 #Inital total energy input 
 +dE = 1000 #​incremental energy change (J), how much energy is added to our system for each step of the program. You are advised NOT to change dE. 
 +L_box = 6 # Define the length of our container 
 + 
 +#Create our objects: container, sphere for solid phase, blue box for liquid phase, and empty list for gas particles 
 +container = box(pos=vec(0,​0,​0),​ size=vec(L_box,​L_box,​L_box),​ color=color.white,​ opacity=0.1) # Creates a box of length L_box 
 +solid = sphere(pos=vec(0,​0,​0),​ radius=L_box/​2,​ color=color.white) #Creates a sphere for the solid phase 
 +liquid = box(pos=vector(0,​-L_box/​2,​0),​ size=vector(L_box,​0,​L_box),​ color=color.blue,​ opacity=0.75,​ visible=False) #Creates a box for the liquid phase 
 +listOfParticles = [] #Creates an empty list of gas particles for the gas phase 
 + 
 +#Define properties of our material: heat capacities, latent heats, and transition temperatures 
 +c_s=2.108 #solid heat capacity (J/gK) 
 +Hfus=335.5 #Latent heat of fusion (J/g) 
 +c_l=4.186 #liquid heat capacity (J/gK) 
 +Hvap=2260 #Latent heat of vaporization (J/g) 
 +c_g=1.996 #gas heat capacity (J/gK) 
 +Tm=273 #Melting point (K) 
 +Tb=373 #Boiling point (K) 
 + 
 +#Calculate total energy values at different points (J) 
 +Esol=m*c_s*(Tm-T) #Energy to raise temp to melting point, i.e. max energy a solid can have 
 +Emelt=Esol+m*Hfus #Energy to raise temp AND melt all of the solid 
 +Eliq=Emelt+m*c_l*(Tb-Tm) #Energy to raise temp, AND melt, AND reach boiling point, i.e. max energy a liquid can have 
 +Eboil=Eliq+m*Hvap #Energy to reach melting point, melt, reach boiling point, and boil all the liquid 
 + 
 +#Initialize Graph 
 +Grph1 = graph(title='​Temperature vs Energy',​ xtitle='​Energy Input to System (J)', ytitle='​Temperature (K)', fast=False, ymin=0, ymax=1000) #initialize our graph axes, titles, and boundaries 
 +HeatingCurve = gcurve(color=color.red,​ label='​Heating Curve'​) #Prepare a data series to be plotted 
 + 
 +Efinal = 1.25*Eboil #Set the final energy to stop the program at 
 +while Etotal < Efinal: #Run loop until Energy is larger than Efinal 
 +    rate(25) #Change this to make your program run faster or slower. 10-100 is recommended. 
 +     
 +    if Etotal < Esol: #If statement for changing temp within solid phase 
 +        T=T+dE/​(m*c_s) #Calculate temperature (K) from q=mc(Delta_T) equation 
 +        HeatingCurve.plot(Etotal,​ T) #Plot T(K) vs E in J 
 +     
 +    elif Etotal < Emelt: #If statement for changing from solid to liquid 
 +        liquid.visible=True #make sure the liquid phase is visible 
 +        ShrinkSolidGrowLiquid() #Change sizes of solid and liquid phases 
 +        HeatingCurve.plot(Etotal,​ T) #Plot T(K) vs E in J 
 +     
 +    elif Etotal < Eliq: #If statement for changing temp within liquid phase 
 +        solid.visible=False #make sure the solid phase is invisible 
 +        T=T+dE/​(m*c_l) #Calculate temperature (K) from q=mc(Delta_T) equation 
 +        HeatingCurve.plot(Etotal,​ T) #Plot T(K) vs E in J 
 +     
 +    elif Etotal < Eboil: #If statement for changing from liquid to gas 
 +        ShrinkLiquid() #Change size of liquid phase 
 +        MakeNewParticle() #Add a gas atom to the container 
 +        ParticleMovementAndCollisions() #Make the gas particles move and collide 
 +        HeatingCurve.plot(Etotal,​ T) #Plot T(K) vs E in J 
 +     
 +    else: #Changing temperature within gas phase 
 +        liquid.visible=False #make sure the liquid phase is invisible 
 +        T=T+dE/​(m*c_g) #Calculate temperature (K) from q=mc(Delta_T) equation 
 +        ParticleMovementAndCollisions() #Make the gas particles move and collide 
 +        HeatingCurve.plot(Etotal,​ T) #Plot T(K) vs E in J 
 +     
 +    Etotal = Etotal + dE # Increase the total energy by dE</​code>​
  
 ---- ----
  • repository/phase_changes.1600187944.txt.gz
  • Last modified: 2020/09/15 16:39
  • by porcaro1