Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HELP ASAP MATLAB Post-Activity Matlab regression Engineering Background: In modeling an oil reservoir in petroleum engineering, it may be necessary to find a relationship between

HELP ASAP MATLAB image text in transcribed
image text in transcribed
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 1.4 1.8 2.2 2.6 3 3.4 3.8 4.2 4.6 5 5.4 5.89 4.68 4.1 3.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 u need to do et 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 = A exp (BP) where A and are the regression-estimated parameters. Find the MSE for this regression using measured K values and Kfit using polyfit. polyyal 3. 4. Now perform a linear regression (polynomial regression of order 1) on the untransformed data s. Using the results of polyfit, find the best fit line, Kfit. It may be easiest to calculate Kfit using 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

What are the other economic side effects of accidents?

Answered: 1 week ago