From: Sun on 21 Apr 2010 14:50 Basically: The ideal gas law, Pv = RT, describes the behavior of many gases. When solved for v, the equation can be written v=(RT)/P Find the specific volume for air, for temperatures from 100 to 100K and for pressures 100 kPa to 1000 kPa. The value of R for air is 0.2870kJ/(kg K). In this formulation of the ideal gas law, R is different for every gas. There are other formulations in which R is a constant, and the molecular weight of the gas must be included in the calculation. You'll learn more about this equation in chemistry classes and thermodynamics classes. Your answer should be a two-dimensional matrix. So this is what I tried. >>t = 100:1:1000; >>p = 100:1:1000; >>R = 0.2870 >>[T, P] = meshgrid(t,p); >>v= (R.*T)./P but I don't get the two-dimensional matrix? or am I just thinking wrong? did I do it right?
From: Alistair Templeton on 21 Apr 2010 15:37 > >>t = 100:1:1000; > >>p = 100:1:1000; > >>R = 0.2870 > >>[T, P] = meshgrid(t,p); > >>v= (R.*T)./P > > but I don't get the two-dimensional matrix? > or am I just thinking wrong? > did I do it right? if i copy and paste your code i get a 2-D matrix back
|
Pages: 1 Prev: pdepe solver - Time dependent boundary condition Next: Speeding up a simple routine. |