Iterating final temperature minus initial temperature in density calculation
Show older comments
Hello all, Basically i have a matrix of temperatures, ranging from 223.15K to 3273.15K, and i am trying to calculate the final density of air. The formula i have for the change in density is: ρ1 = ρ0 / (1 + β (t1 - t0)) where ρ1 = final density (kg/m3) ρ0 = initial density (kg/m3) β = volumetric temperature expansion coefficient (m3/m3 K) t1 = final temperature t0 = initial temperature
So what i want to do is input the second element for my temperature matrix into t1, and the first element into t0. Then the next calculation i want to use the third element minus the second element and so on until the last element. Also, use the final density from the first calculation and input it into the initial density into the second equation and so on. Ive been trying to set it up with for and while loops and have gotten nowhere. Any help with the code would greatly be appreciated.
2 Comments
John D'Errico
on 26 Mar 2016
Be clear in your question. Is ρ0 the density at temperature t0? Then ρ1 is the density at temperature t1?
Doug
on 26 Mar 2016
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!