Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Post-Activity Matlab regression Engineering Background: In modeling an oil reservoir in petroleum engineering, it may be necessary to find a relationship between the equilibrium constant
Post-Activity Matlab regression Engineering Background: In modeling an oil reservoir in petroleum engineering, it may be necessary to find a relationship between the equilibrium constant of a reaction and the pressure at a constant temperature. The data shown in the table below relates equilibrium constants K to pressure (measured in 1000 psia) 0.6 1.8 2.2 2.6 3.4 3.8 4.2 4.6 5.4 5.89 4.684.13.45 3.25 2.69 2.25 1.92 1.55 1.45 1.19 0.99 0.84 Theory says that the K-P relationship should be exponential: K = Aexp(BP) You can take the log-transform of both sides to get a linear form that will allow you to use linear regression to find A and B: logK = logA + BP so the slope of the regression is B, and A is equal to the exponential raised to the intercept. You want to compare this linear regression on the transformed data with a polynomial regression on the untransformed data. Specifically, you want to find what order of polynomial regression you need to do to get a better fit in the mean-squared-error sense than the log-transformed linear regression A step-by-step set of instructions on what to do is as follows: 1. Do a linear regression of P vs log(K) using polyfit, 2. Transform the intercept value using the exponential function, and find Kfit - Aexp (BP) where A and B are the regression-estimated parameters Find the MSE for this regression using measured K values and Kfit Now perform a linear regression (polynomial regression of order 1) on the untransformed data using polyfit Using the results of polyfit, find the best fit line, Kfit. It may be easiest to calculate Kfit using palvval 3. 4. 5. 6. Find the MSE for this regression using measured K values and Kfit 7. Increase the order of the polynomial regression by 1 (use a loop), and repeat from step 4. Stop this loop when the MSE you find in step 6 is less than the MSE you found in step 3. This will tell you what order of polynomial regression gives a better fit than log-transformed linear regression Post-Activity Matlab regression Engineering Background: In modeling an oil reservoir in petroleum engineering, it may be necessary to find a relationship between the equilibrium constant of a reaction and the pressure at a constant temperature. The data shown in the table below relates equilibrium constants K to pressure (measured in 1000 psia) 0.6 1.8 2.2 2.6 3.4 3.8 4.2 4.6 5.4 5.89 4.684.13.45 3.25 2.69 2.25 1.92 1.55 1.45 1.19 0.99 0.84 Theory says that the K-P relationship should be exponential: K = Aexp(BP) You can take the log-transform of both sides to get a linear form that will allow you to use linear regression to find A and B: logK = logA + BP so the slope of the regression is B, and A is equal to the exponential raised to the intercept. You want to compare this linear regression on the transformed data with a polynomial regression on the untransformed data. Specifically, you want to find what order of polynomial regression you need to do to get a better fit in the mean-squared-error sense than the log-transformed linear regression A step-by-step set of instructions on what to do is as follows: 1. Do a linear regression of P vs log(K) using polyfit, 2. Transform the intercept value using the exponential function, and find Kfit - Aexp (BP) where A and B are the regression-estimated parameters Find the MSE for this regression using measured K values and Kfit Now perform a linear regression (polynomial regression of order 1) on the untransformed data using polyfit Using the results of polyfit, find the best fit line, Kfit. It may be easiest to calculate Kfit using palvval 3. 4. 5. 6. Find the MSE for this regression using measured K values and Kfit 7. Increase the order of the polynomial regression by 1 (use a loop), and repeat from step 4. Stop this loop when the MSE you find in step 6 is less than the MSE you found in step 3. This will tell you what order of polynomial regression gives a better fit than log-transformed linear regression
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started