Matlab_Programming_Example2

Matlab_Programming_Example2 - Chemical Engineering...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
University of Florida ECH 4123 Prof. Oscar D. Crisalle Phase and Chemical Equilibria Class Project MATLAB PROGRAMING EXAMPLE 2 CUBIC FORM OF THE VAN DER WAALS EQUATION OF STATE—M-FUNCTION AND M-FILE DRIVER Appendix: MATLAB Programming Examples Appendix A.1. Example of a MATLAB M-function developed for the cubic form of the van der Waals equation This Appendix contains an example of a MATLAB M-FUNCTION that calculates the roots of the cubic form of the van der Waals equation. The code shown below must be saved in a file with the following name: VdWEOS_ZV.m The first line of the file should start with the word function . function [Z1, Z2, Z3, V1, V2, V3 ] = VdWEOS_ZV(P, T, VdWpars) % On-line help for function VdWEOS_ZV % % Syntax: [Z1, Z2, Z3, V1, V2, V3 ] = VdWEOS_ZV(P, T, VdWpars) % % Description: % This function finds the three compressibility % factors that are the roots of the cubic van der % Waals equation of state, and converts these roots % to three specific volumes. % No attempt is made to discard complex roots.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Matlab_Programming_Example2 - Chemical Engineering...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online