Creates values of Vr from 0.5 to 3 in steps of (3-0.5)/100

Slides:



Advertisements
Similar presentations
Quadratic equations Sudheer Kumar Cranbourne Secondary College.
Advertisements

USING GRAPHICAL ANALYSIS Make sure you have the data ready. Answer these questions: 1) What quantity are you going to plot on the x axis? What are the.
Lecture (4) Plotting & Programming (1) Eng. Osama Talaat 1.
Polynomial Regression and Transformations STA 671 Summer 2008.
ZCE 111 Assignment 2. Q1: Planck’s radiation law Plot Planck’s law of black body radiation for temperatures 1000 K, 2000 K, 3000 K, …, K on the.
Warm UP 1) Name the following parent graph: 2) Where is a point of inflection(s) for the function y=cos(x) on the interval [0 o, 360 o ]? 3) On what subinterval(s)
1. Overview 2. plot in 2D 3. Plot in 3D 4. Other possible charts 5. Engineers: label your plots! 6. Plots & Polynomial Plotting 11.
Polar Coordinates. Butterflies are among the most celebrated of all insects. Their symmetry can be explored with trigonometric functions and a system.
Ch 2.2: Separable Equations In this section we examine a subclass of linear and nonlinear first order equations. Consider the first order equation We can.
Translations and Completing the Square © Christine Crisp.
Most likely macrostate the system will find itself in is the one with the maximum number of microstates. E 1  1 (E 1 ) E 2  2 (E 2 ) E 1  1 (E 1 )
Spreadsheet Problem Solving
Quadratic Theory Introduction This algebraic expression: x 2 + 2x + 1 is a polynomial of degree 2 Expressions like this in which the highest power of x.
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
Real Gases Deviation from ideal gas Law: -Gas particles have volume - Attraction exists between gas particles (liquefication) Ideal gas law applies only.
Copyright © Cengage Learning. All rights reserved. Quadratic Equations, Quadratic Functions, and Complex Numbers 9.
6.2 Graphs of Polynomials. The Degree of Polynomials The degree of a polynomial is the value of the largest exponent. y = 5x 4 + 3x 2 – 7 Degree = 4 y.
Plotting II: By the end of this class you should be able to: Create a properly formatted engineering graph Create graphs of a function Place multiple plots.
5.6.1 Scatter Plots and Equations of Lines. Remember our Stroop test? During the stroop test we used the tool called scatter plot A scatter plot is a.
Solving Quadratic Equations Pulling It All Together.
Algebra 1B Chapter 9 Solving Quadratic Equations By Graphing.
SOLUTION STEP 1 Use intercepts to graph an equation EXAMPLE 2 Graph the equation x + 2y = 4. x + 2y = 4 x =  x- intercept 4 Find the intercepts. x + 2(0)
1 Scatter Plots on the Graphing Calculator. 12/16/ Setting Up Press the Y= key. Be sure there are no equations entered. If there are any equations,
1 Scatter Plots on the Graphing Calculator. 12/16/ Setting Up Press the Y= key. Be sure there are no equations entered. If there are any equations,
Graph Square Root and Cube Root Functions
1-d Arrays & Plotting.
COMPASS Test Model Help What is the sum of the solutions of the equation  A. 8  B.-8  C. 2  D.-2  E. 15 Go on Calculator.
Force between two neutral atoms. Van der Waals equation.
CS100A, Fall 1998, Lecture 191 CS100A, Fall 1998 Lecture 19, Thursday Nov 05 Matlab Concepts: Matlab arrays Matlab subscripting Matlab plotting.
Plotting Data & the Finding Regression Line. Clear Old Data 2 nd MEM 4 ENTER.
By Katie McKnight & Peter Myszka. This is our beginning equation. It is a quadratic function that will give us a good base to examine the equation of.
Equations of Straight Line Graphs. Graphs parallel to the y -axis All graphs of the form x = c, where c is any number, will be parallel to the y -axis.
Graphing Polynomial Functions We will now use the strategies from the previous sections to sketch the graphs of higher order polynomials.
14.0 Math Review 14.1 Using a Calculator Calculator
Solving Radical Equations and Inequalities Objective: Solve radical equations and inequalities.
Chapter 2 Review Chapter 2 has taken a long time… you might want to get out your notes and a book to refer to 
Section 3.2 Polynomial Functions and Their Graphs
LESSON 2–2 Polynomial Functions.
Coefficients a, b, and c are coefficients Examples: Find a, b, and c.
Y-intercept: y-coordinate of the point where the graph intersects the y-axis. The x-coordinate of this point is always 0, i.e., (0, #). x-intercept: x-coordinate.
25 Math Review Part 1 Using a Calculator
Solution of Nonlinear Equations
INTEGRATION APPLICATIONS 1
Smooth, Continuous Graphs
Simplify √128 Simplify 4√45 Rationalise and simplify 2 5√2.
Regression and Residual Plots
Use a graphing calculator to determine the graph of the equation {image} {applet}
Section 3.2 Polynomial Functions and Their Graphs
Using Excel to Make a Graph
Modified by Jed Macosko
Warmup Solve:
1. Use the quadratic formula to find all real zeros of the second-degree polynomial
Scatter Plots on the Graphing Calculator
Maxwell construction B2.
Chapter 4: Rational, Power, and Root Functions
Stat Mech of Non-Ideal Gases: Equations of State
Section 2.3 Polynomial Functions and Their Graphs
Nonlinear equations.
Objectives Use properties of end behavior to analyze, describe, and graph polynomial functions. Identify and use maxima and minima of polynomial functions.
Nonlinear equations.
y x y = x + 2 y = x + 4 y = x – 1 y = -x – 3 y = 2x y = ½x y = 3x + 1
Section 3.2 Polynomial Functions and Their Graphs
Objectives Use properties of end behavior to analyze, describe, and graph polynomial functions. Identify and use maxima and minima of polynomial functions.
Scatter Plots on the Graphing Calculator
Splash Screen.
y x y = x + 2 y = x + 4 y = x – 1 y = 6x – 3 y = 2x y = ½x y = 3x + 1
Warm-Up # 28 Write an equation for the blue line.
The graph below is a transformation of which parent function?
Which of the following expressions is the equation of the function {image} {applet}
Polynomial investigation
Presentation transcript:

Clear command, clears the screen; clears all objects; closes all figures etc. Creates values of Vr from 0.5 to 3 in steps of (3-0.5)/100 Opens a figure window Y axis limits X axis limits Labels x axis Labels y axis Defines the van der Waals equation as a function of Tr and Vr Calculate Pr using the vdW equation Plots Pr vs. Vr clc; clear all; close all Vr = linspace(0.5,3,100); figure(1); ylim([0 2]) xlim([0.25 3]) xlabel('V_r') ylabel('P_r') Tr = 0.9; Prfunc = @(Vr) 8*Tr./(3*Vr - 1) - 3./(Vr.^2); Pr = Prfunc(Vr); plot(Vr,Pr)

if Tr < 1 Pr_b = 1.0; vdW_Pr_b = [1 -1/3*(1+8*Tr/Pr_b) 3/Pr_b -1/Pr_b]; Makes sure the temperature is below critical, Tr = T/Tc Starts with a trial value for Pr at which liquid transform to gas Defines a polynomial function to calculate the values of Vr for the trial value of Pr (Pr_b). ⇒ 8 𝑇 𝑟 3 𝑉 𝑟 −1 − 3 𝑉 𝑟 2 = 𝑃 𝑟𝑏 ⇒ 8 𝑇 𝑟 3 𝑉 𝑟 −1 − 3 𝑉 𝑟 2 − 𝑃 𝑟𝑏 =0 ⇒8 𝑇 𝑟 𝑉 𝑟 2 −3 3 𝑉 𝑟 −1 − 𝑃 𝑟𝑏 3 𝑉 𝑟 −1 𝑉 𝑟 2 =0 ⇒8 𝑇 𝑟 𝑉 𝑟 2 − 9𝑉 𝑟 +3−3 𝑃 𝑟𝑏 𝑉 𝑟 3 + 𝑃 𝑟𝑏 𝑉 𝑟 2 =0 ⇒ 𝑉 𝑟 3 − 1 3 1+ 8 𝑇 𝑟 𝑃 𝑟𝑏 𝑉 𝑟 2 + 3 𝑃 𝑟𝑏 𝑉 𝑟 − 1 𝑃 𝑟𝑏 =0 The terms in the square brackets are the coefficients of the polynomial.

v = sort(roots(vdW_Pr_b)); A1 = (v(2)-v(1))*Pr_b - integral(Prfunc,v(1),v(2)); A2 = integral(Prfunc,v(2),v(3)) - (v(3)-v(2))*Pr_b; Finds the roots of the polynomial and sorts them in increasing order: v(1), v(2), and v(3) Calculates the area enclosed by the line and the vdW curve between v(1) and v(2) and then from v(2) and v(3). (clearer figure later).

Z = abs(A1-A2); while Z > 0.0001 vdW_Pr_b = [1 -1/3*(1+8*Tr/Pr_b) 3/Pr_b -1/Pr_b]; v = sort(roots(vdW_Pr_b)); Prfunc = @(Vr) 8*Tr./(3*Vr - 1) - 3./(Vr.^2); A1 = (v(2)-v(1))*Pr_b - integral(Prfunc,v(1),v(2)); A2 = integral(Prfunc,v(2),v(3)) - (v(3)-v(2))*Pr_b; Z = abs(A1 - A2); Pr_b = Pr_b - 0.00001; figure(1); hold off; plot(Vr,Pr) figure(1); hold on; plot([0.5 3],[Pr_b Pr_b],'k--') hold off; end Calculates the difference between the two areas If z > 0.0001 then this loop starts Defines the polynomial in the loop Calculates and sorts the roots Defines vdW equation in the loop Calculates the areas again Calculates the difference Lowers the test values Pr_b by 0.00001 Chooses figure 1 window; new plot will appear, old graph is removed Plots Pr vs. Vr Chooses figure 1window; new plot will appear keeping the old graph Plots the line for Pr_b vs. Vr in a black dashed line Next time a new graph is plotted the old plots will be removed Starts the loop again and checks if the difference between A1 and A2 (Z) > 0.0001 for the new value of Pr_b. Loop stops if Z < 0.0001 i.e A1  A2

v(1) v(2) v(3) Pr_b (v(2)-v(1))*Pr_b (v(3)-v(2))*Pr_b

v(1) v(2) v(3) Pr_b Calculates the area under the vdW curve from v(1) to v(2) and from v(2) to v(3). integral(Prfunc,v(1),v(2)) integral(Prfunc,v(2),v(3))

v(1) v(2) v(3) Pr_b Calculates the relevant area for the Maxwell constructions (v(2)-v(1))*Pr_b - integral(Prfunc,v(1),v(2)) integral(Prfunc,v(2),v(3)) - (v(3)-v(2))*Pr_b

end A1 A2 Pr_b Ends the if loop Prints A1 and A2 Prints the value of pressure Pr_b which satisfies Maxwell’s condition.