- circumferential "increasing pressure"
- circumferential "decreasing pressure"
- axial "increasing pressure"
- axial "decreasing pressure"
Help with Linear Regression & Comparison of 2 Regressions
10 ビュー (過去 30 日間)
古いコメントを表示
I'm working on taking a large amount of data stored in .csv, then performing some operations with it in MATLAB. It's been several years since I've used MATLAB, so I'm a bit rusty at it - luckily I've made some progress thanks for forums and examples.
Right now I've got plots that are being generated and show what I'm looking for, but I'm struggling to get the information off of them that I need. In essence, my test setup is a sealed vessel that I've got strain gauges on. The plots show pressure on the x-axis and strain on the y-axis; what they show is that there is plastic deformation after the maximum pressure, evident by the strain being different as the pressure is released versus that when pressure is raised. This is ASME BPVC.VIII.1-2021 UG-101[n] if anyone is curious.
I'm needing to generate a curve on the line as pressure is applied, then generate a second curve as pressure is released. I'm not really too sure how to approach that one, i.e. generate two curves on the same set of data but separated by a maximum pressure.
After I have the curves, I then need to compare the two curves to see how much variation there is between them in the form of percent change.
Here is the code I've got thus far, which is merely generating the subplot:
% Input table name from Workspace
dataset = SGTestingTrialIndex108100psi1;
% Parse out individual sensor columns to type DOUBLE
axial = table2array(dataset(: , 2));
maxAxial = max(axial);
circumferential = table2array(dataset(: , 4));
maxCircumferential = max(circumferential);
pressure = table2array(dataset(: , 6));
maxPressure = max(pressure);
% Plot axial values
subplot(2,1,1);
plot(pressure,axial);
xline(maxPressure);
yline(maxAxial);
title('Axial Strain Gauge');
xlabel('Pressure (psi_g)');
ylabel('Axial Strain');
hold on;
% Plot circumferential values
subplot(2,1,2);
plot(pressure,circumferential);
xline(maxPressure);
yline(maxCircumferential);
title('Circumferencial Strain Gauge');
xlabel('Pressure (psi_g)');
ylabel('Circumferential Strain');
And here is the plots that is being generated:

Any help or guidance is greatly appreciated!
0 件のコメント
採用された回答
Drew
2023 年 4 月 13 日
You could separate the data into 4 parts:
Then, do regression on each part, and compare them. For the regression analysis, you could use the command line function fitlm, or use the Curve Fitter app, then export the fits to the command line.
2 件のコメント
Drew
2023 年 4 月 13 日
Since this answer helped you, please remember to "accept" the answer. I mention this because it looks like you are new to MATLAB answers.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!