How can I form equation from my data?
조회 수: 2 (최근 30일)
이전 댓글 표시
I'm doing analysis of water gas shift reactor. In that I want to find out rate of reaction equation in terms of mole fraction of species. If i use curve fitting or surface fitting i can generate function in terms of only one or two species at once. how can i generate function in terms of all four species. I've 4 species which i have to include to form equation of rate of reaction.
댓글 수: 2
Yu Jiang
2014년 8월 6일
Do you want to perform linear regress or nonlinear regression on your data set? If nonlinear, do you have a specific type of function in mind? Can you share part of your data?
채택된 답변
ameen
2014년 8월 6일
You should think about regression to get a relation between these 4 variables and the rate of reaction. If you don't know about regression please don't waste your time learning it on Matlab. Read about the basics of regression or watch videos on youtube.
댓글 수: 0
추가 답변 (1개)
Yu Jiang
2014년 8월 8일
편집: Yu Jiang
2014년 8월 9일
Hi Shashank
I understand that you would like to perform regression on your data set using MATLAB. In particular, you would like to obtain a function in the following form
Rate = F(CO, CO2, H2, H2O)
where it is not clear what is the best type of functions that should be used here.
A linear model for this problem looks like
Rate = b(1) * CO + b(2) * CO2 + b(3) *H2 + b(4) *H2O +b(5)
where b is a constant vector of 5 elements. To fit this model in MATLAB, you may try the following steps:
1) Create a matrix X, which is an n-by-5 matrix. The first 4 columns contain the observation from the four species. The fifth column is a column of ones. 2) Create an n-by-1 matrix y, which contains the rate from n different observations.
3) In the MATLAB Command window, try executing the following
>> [b,bint,r] = regress(y,X)
Then, b is the vector of coefficients for the linear model. bint returns the related confidence interval, and r gives the residuals based on which you can see if the fitting is acceptable. To see the difference between the actual data and the data generated by the model, you can simply try
>> n = length(y)
>> plot(1:n, y, ‘o’,1:n, X*b )
In which ‘o’ denotes the actual data, and X*b gives you the predicted results. If you would like to perform nonlinear regression, you may want to use the function fitnlm (Documentation) . However, it is necessary that you know the nonlinear structure of the function and can parameterize it with a vector b. I would like to suggest you read related literature and see if some particular structure of nonlinear functions has been used by other people.
-Yu
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!