 In this video we'll talk about how to apply units to our variables and we'll work through our first real example problem which will involve some properties of air inside of a tank. So let's say hypothetically we were trying to figure out the mass of air inside of a tank. Let's say that we knew that the tank was being stored at 25 degrees Celsius. We knew that the tank was pressurized to an absolute pressure of 200 kilopascals and we knew that the internal volume of the tank was what 10 gallons. Let's enter that as our given information. So again I'm going to use a comment to keep my equations window somewhat organized. So I'm going to say given information is that my temperature is what did I say 25 degrees Celsius. My pressure was 200 kilopascals and my volume was 10 gallons. Note that I'm using a subscript 1 here and that's just for my own personal meticulousness. Is that a word? Sure it's a word. I would prefer to refer to these properties as a state point as opposed to just T. Also that makes things a little bit more confusing when you're trying to use built-in functions because you tell it which property you want it to use by using T, P, V, etc. So if I wanted to look up some information at a temperature of 10 I would enter that as T equals 10. And if I wanted to say a temperature of whatever my temperature variable is then I would say T equals T underscore 1. If I said T equals T that gets a little confusing to me at least. So in order to figure out our mass of our air inside of our tank we're going to have to assume that the air is an ideal gas. So our solution is going to involve the ideal gas law which the most convenient form for us here would be that the pressure times the total volume would be equal to the mass of the air inside the tank times the specific gas constant for air and times the temperature. Meaning that we would calculate the mass by taking the pressure times the volume divided by the specific gas constant for air times the temperature. We have temperature pressure and volume so we're going to need to know what the gas constant for air is in order to solve our problem. So at this point probably going to be tempted to pull out your nearest thermo book should always have one nearby right and look up the gas constant for air. Could also use the internet for that or you could just be a big nerd and have it committed to memory. So let's say that we had assumed or looked up the specific gas constant for air and that it was 0.287, 0.287. So the gas constant for air is 0.287. Now if I were to hit solve right now ease would give me an air because I did not refer to my variables consistently. Great PV, have you pressure 1 times volume 1 divided by r times t1. Now when I hit solve there we go. I have a mass and ease tells me that there were no unit problems detected. So I know for a fact that this is not going to be 278.7 kilograms and the reason is that I entered incorrect units in order to get a mass out in kilograms. So this isn't going to be a this isn't going to be kilograms and B this isn't a proper use of the ideal gas law. This would require me to use an absolute temperature and an absolute pressure and I used an absolute pressure but not an absolute temperature. So if you do not use units in your variables you have to rely on your own internal checking mechanism to make sure that the unit that you get out is the is what you would get from actually applying your given units. So here in order to get a mass in kilograms I would have to convert this to Kelvin which I can do by adding 273.15 to it and then I think that I said that I was going to use 10 gallons as my volume here. So at this point I need to get a unit in kilograms so if I took kilopascals times a volume divided by an r value in kilojoules per kilogram Kelvin times Kelvin that would mean I would need cubic meters or 10 gallons would be an internal volume of 0.0378541. So I've had to manually convert from gallons into cubic meters but the advantage is I now have a mass that is going to be in kilograms. An easy way to keep track of that would be to tell ease what my units are. So if I went in I could say well this temperature is in Kelvin, this pressure is in kilopascals, this volume is in you know so on and I do that by one of two ways. I can either go up to options and click on variable info which is where I would enter information about my variables. You'll notice that there's a column here for units so I could tell it hey that mass is in kilograms, that pressure is in kilopascals, that r is in kilojoules per kilogram Kelvin, a temperature is in Kelvin and that volume is now in cubic meters. Now when I solve it says hey your mass is 0.08848 kilograms. Awesome. I could make this a prettier output by right clicking going to highlight and putting a box around it maybe changing the background color to a nice pale yellow. There we go we have a nice beautiful mass of air inside of our tank but we still had to do that unit version conversion manually. There's a better way I could make ease do the conversion for me. Before I get to that though I want to mention that the other way to have entered units would be to use square brackets. So if I put a square bracket after my volume here and said cubic meters this is another way of typing in units for inputted variables but this only works for variables where you're giving it a quantity. This wouldn't work like I couldn't just add square brackets to kilograms at the end here. So it's good practice at least in my opinion to include units when you're typing in quantities so if I wanted to do that here I would have to have parentheses wrapped around my temperature in order to apply Kelvin to both of these quantities otherwise it would be 25 unitless things plus 273.15 Kelvin which wouldn't quite be right. Also note that when we typed in our units here it looks like the way that I typed in my kilojoules per kilogram Kelvin is in kilojoules per kilogram minus Kelvin but despite the fact that this is a dash or hyphen or whatever the name of that symbol is despite the fact that that's a minus sign ease understands that I'm typing in kilojoules divided by the quantity kilograms times Kelvin close quantity. It's just a shorthand way of typing in units. Also note that because ease does not pay any attention to spaces I prefer personally to tab out my units when I'm entering information like this. So if I hit tab between the number and the unit system that puts a nice big space and lines up all the units I think personally that's an easy way to keep track of hey this is in Kelvin this is in cubic meters I also don't have to figure out where the number starts and ends when I'm trying to read off of a number if that makes any sort of sense. So if I were to hit solve now I still get mass and kilograms. Also note that I can get ease to output multiple units so if I wanted to say include a mass in kilograms and a mass in slugs or pound mass I could right click on this and say well output a unit in kilograms also output a unit in pound mass. So now the output in my solutions window is 0.08848 kilograms or 0.1951 pound mass that's just a convenient way of including mixed units in your output. Let's go back let's try to remove this manual unit conversion from that process so let's go back to 10 gallons. Well I can make ease handle the conversion from gallons into cubic meters for me the way that I would do that would be to go not that would be to go up and hit options then this unit conversion info button so I'm going to be converting in volume and I want to know how gallons and cubic meters are related so I would find meters cubed lots of options for different ways of typing meters and gallons so gallons and cubic meters okay gotta click two things John there we go gallons and cubic meters are related like this again one gallon is 0.003758412 so I could look this up and make the conversion myself that just removed the googling portion of that conversion process or I could also use the convert function in ease so the convert function is called by typing out the word convert and it takes two arguments the first argument is the unit from which you want to convert the second argument is the unit to which you want to convert so I want to convert from gallons to cubic meters so I would type gallons and then cubic meters so because I put gallons after my quantity here it will know that once it converts I will have an answer in cubic meters so if I go back to solve I still get the same number despite the fact that I entered 10 and it will output the solution for this variable as being 0.03785 so it handled that conversion for me I could do the same thing for temperature except the function to convert temperature is different that's because it's not quite as neat and orderly I can't what ease is actually doing here is looking up its own internal multiplier which is what I viewed when I was in the constants window and then it's multiplying 10 by that proportion so that doesn't work for temperature so it has a temperature conversion function which I believe is called convert temp so I put convert temp and convert temp takes three arguments the first argument is the unit that you are converting from so this would be Celsius second argument is the unit to which you are converting to be Kelvin the third argument is the number so here I want to convert 25 so yes now because I'm giving it 25 degrees Celsius and it's converting from Celsius into Kelvin it already knows this is going to be in Kelvin the square bracket method of entering units is only for inputted quantities so I cannot have that there now when I solve I have a temperature one at 298.1 it handled that conversion for me great I could also include the units in my third argument there the square bracket just like I did here for volume in gallons so I now have I've taken a problem statement that had mixed units and I've gotten a mass output in mixed units great I still had to assume the ideal gas law and I still had to do a manual lookup of this gas constant for air I could remove that step from my solution by getting eased to look up what the gas constant for air is if I go up into my options again and I click on function info this is where you find all the functions that are built into ease and they're sorted by a couple of different ways first we have this math and string functions so these are functions that it could apply to their mathematical functions or functions for handling strings you've got any programming background you can probably understand what the string functions referring to but the math functions are useful if you wanted to say take an art cosine of some value at some point in your analysis the thermo physical properties are going to be the ones that we're going to be using the most because this is an ease tutorial for thermodynamic purposes and the thermo physical properties is where you will get ease to figure out properties for different substances so once we click on thermo physical properties we have to select what type of material we're looking at so here I have the option of selecting real fluids or ideal gases or a mixture of air and water etc so for the moment I'm going to be looking at properties of ideal gases once I click on that I will have a different list of materials this right window is where I list all the possible materials for which I can look up properties if I want to know more about any of these if I click on fluid info it'll pop up some information about where that information comes from so in the case of c2h4 it's getting this information from a paper called nasagland coefficients for calculating thermodynamic properties of individual species for the moment though let's just take everything that ease has as wrote so I want the ideal gas air which is called air and now I have a list on the left of different properties that ease can figure out for me so if I wanted to you know have ease call the conductivity of air or the density of air etc these two boxes down here are where I enter whatever inputs are needed to find that so it takes two independent intensive properties to fix the state so for most things I'm going to need to give it to independent properties so if I were to scroll down to this list and try to find gas constant I do not have gas constant as one of my options that's something that ease does with its lookup properties it tends to only use a single lookup if that makes any sort of sense if it has anything that's derived from those lookup properties it relies on you to do the derivation yourself derivation derivation whatever so I do not need to actually look up the specific gas constant because I know how the specific gas constant is comes from I know where it comes from and that's from the universal gas constant so I'm going to use the universal gas constant and the molar mass in order to figure out the specific gas constant and those two things are related by specific gas constant is equal to the universal gas constant divided by the molar mass and molar mass I can look up so the molar mass function again hydro gases air the molar mass function is called molar mass and it only needs one argument and that's the name of the substance for which you want the molar mass so you'll notice the down here in the bottom ease gives us an example of how to call that function excuse me so I would call the function called molar mass and that would give me that would return molar mass if I hit paste that'll actually insert the function into my code so the equations window I now have a function which would look up the molar mass for me so if I had the universal gas constant I could calculate the specific gas constant for my substance I could just type out 8.314 but it's better practice to have ease use its built-in constants it has many constants built in of which one is the universal gas constant so if I go up into options and then click on constants I could have these are all the constants that are built into ease there are a variety of different types of constants here for example we've got the color blue and we've also got you know the newton the neutron rest mass and the unified atomic mass unit and the color green and the stephen boltzmann constant etc but if we scroll down here eventually we will come across the universal gas constant if at any point you're like me and cannot scan this list well you can make it sort by different values by clicking on the different columns so I wanted to sort by description now when I scroll down eventually I will come to the gas constant there we go so universal gas constant is denoted as r with a pound sign or for you younger people out there are with a hashtag so our pound sign is how I would refer to the universal gas constant within ease again I can make it paste that value directly into my equation if I wanted to I could also add my own constants if I wanted to so I have looked up the molar mass and I can calculate the specific gas constant by using our pound sign divided by molar mass that would give me the specific gas constant so now I have used a oh right note that I denoted my molar mass with a capital M and then I used the same M to represent my mass ease does not differentiate between the case of characters this is a very common mistake so I have to distinguish one variable from another I could call this the molar mass mm or I could call this molar weight mw but to be consistent with my own state numbering scheme I'm going to call this m1 now when I hit solve ease will give me an answer but note that it gave me a very very incorrect answer ah no it didn't still give me the correct answer but now that I've changed the variable for which I want an output now it still thinks that m is mass so earlier when I told it the mass was going to be in kilograms now everything's nice and screwed up so let's go back to variable info let's change our unit for the variable m from kilograms into what the molar mass actually is which will be kilograms per kilo mole and then mass m1 is now written in kilograms now so that little pop-up is just saying hey you wanted a secondary unit of pound mass that's that's not right dude anyway now that I've corrected that mistake I should be able to hit solve okay fine that's how you want to play the game he's we can play that game now that I have corrected that mistake aha now I have a mass in kilograms but I still have the molar mass highlighted so I could change that back do a normal representation and I could now have it highlight mass great look at that worked perfectly the first time awesome so a nice thing about entering units is that ease can detect when there are internal inconsistencies so if I had actually used incorrect units in my ideal gas law here it would have told me it would have said hey that there is a unit problem here it's it's good practice to at least in my opinion it's good practice to convert all of your given units into the base units for your problem and then use your base units for your problem internally throughout the entire problem that way the whole equations window is internally consistent then at the end convert your units back into whatever output you want so we can define what the base units are for my my problem by going up to options and then unit system so I'm setting the base units here that is sort of like the default units for this problem so I could set hey I want you to use SI units I want you to do default to a temperature of Kelvin default to an energy of kilojoules pressure of kilopascals and a degrees for angles now that I've defined base units that's that's what ease will use when it doesn't know otherwise so I have a mass in kilograms again if I wanted it to output in pound mass I could but I'm still assuming that air is an ideal gas I can actually come up with a better solution by going back to my function info pane here when I was in thermo physical properties I had looked up the molar mass of the ideal gas air I actually have properties for the real substance air which is denoted air ha ease has built-in properties for air just like your steam tables this would be air tables so I could actually look up the specific volume of my air and use that to calculate a mass which would be a much more accurate answer so air ha is called air hot differentiate it from the ideal gas substance which is just called air and here I can look up a lot of things about it including the molar mass again but what I want is the specific volume which is called volume in my little list here and again I need two independent intensive properties to look up the specific volume so I could give it temperature and pressure or I could give it temperature and quality etc so I want it to look up the specific volume for the actual substance air at my temperature and pressure so I would select this function from real gases then I will hit paste to insert that into my equations window so I now have a little v so let's call this little v2 let's say that my specific volume 2 here is going to give me my mass without assuming the ideal gas law then I can compare the two masses so the function for looking up specific volume is called volume and it requires three arguments the first one is the substance air ha second argument is what my first independent intensive property which is temperature so t equals and then I would enter my temperature again I could write 300 Kelvin here if I wanted to or I could just refer it to the variable that I already defined for temperature which was t1 then I could use the second independent intensive property as being pressure so p equals and I could enter a pressure here but I will just refer to my p1 so now air will figure out rather ease will figure out the specific volume for air at that temperature and pressure which is apparently 0.4277 and the units of that would be in volume per specific property which I have selected as mass so this would give me cubic meters per kilogram so I'm going to set that unit here now that I have the specific volume for air at that temperature and pressure I could calculate an alternative mass here let's call it m2 now I'm going to use my volume and my specific volume to calculate a mass so since specific volume is volume per mass that means that I could calculate a mass by taking the volume divided by the specific volume so this would be capital v underscore 1 divided by little v underscore 2 even though little v and capital v are treated the same that'll give me a mass in kilograms so I will enter in my units for mass now ease is calculated the actual mass and what the mass would be if it were treated as an ideal gas so I could make this also show in pound mass I can make this also show as having a box around it with some highlighting if I wanted to demonstrate the differences between the two if that were my intention with this program I might change these to show the same amount of decimal places say make both big make both of them show five decimal places five is the number that comes after four great so they differ slightly I could further I demonstrate these two to bring more attention to these two by calling them key variables so if I select key variables I could enter a description here so this would be the mass of air as an ideal gas and I could select over here mass of air using real gas properties rather real fluid properties now because I've designated both of those as key variables they will appear in a separate tab here called key variables so now I have a nice way of highlighting the important outputs of my program without having them cluttered with all of this extra variable information I could also now probably safely remove the whole box and highlighting thing so I might show the difference between these two with a delta so I could I call a new variable delta M I used uppercase for DELTA again because that's how I differentiate a capital Greek letter delta from a lowercase Greek letter delta and I would say that this is the difference between M2 and M1 I'm going to have to enter that this is in kilograms and now I have delta M is equal to 0.0002983 kilograms so I could designate this as a key variable and call it the difference between ideal gas and real air hooray so that concludes the first example problem here we'll have many more example problems our next video will pick up some steady flow devices so we'll work another example problem with a slightly more complex statement stay tuned