How can I calculate SAE J1269 least squre method in matlab? (multiple variable function)
조회 수: 1 (최근 30일)
이전 댓글 표시
the equation of RR in J1269 is below,
RR = A0 + (A1 * Load) + (A2 / Infl) + (A3 * (Load / Infl)) + (A4 * (Load / (Infl * Infl))))
and I have 6 test result. for load/infl/RR
in SAE J 1269, the variable (A0~4) should be performed by least square method,
(I dont' know why i have to use least square method becaue the polynomial is 6, and variable is 5 (A0~4)
please let me know the code to calculate least square method for this issue
(in matlab document, there can't make the formula like above.)
댓글 수: 0
채택된 답변
Varun
2023년 12월 20일
Hi,
While I am unsure what kind of data you are working with, I assume that you have 6 values each for the variables “Load”, “Infl”, and “RR” and need help with framing a matrix equation for the equation you have mentioned.
| Load (N) | Infl (psi) | RR (N) |
|----------|------------|--------|
| 3000 | 35 | 10.5 |
| 3200 | 33 | 10.8 |
| 3100 | 30 | 11.0 |
| 3300 | 32 | 11.2 |
| 3400 | 34 | 11.5 |
| 3500 | 36 | 11.7 |
You can use these variables to frame the required equation as follows:
% Test data
Load = [3000, 3200, 3100, 3300, 3400, 3500]; % Load in Newtons
Infl = [35, 33, 30, 32, 34, 36]; % Inflation in psi
RR = [10.5, 10.8, 11.0, 11.2, 11.5, 11.7]; % Rolling Resistance in Newtons
% Construct the design matrix for the least squares method
X = [ones(size(Load)), ...% Column for A0
Load, ... % Column for A1
1 ./ Infl, ... % Column for A2
Load ./ Infl, ... % Column for A3
Load ./ (Infl .* Infl)]; % Column for A4
After this, you can all the least squares method using the function “lsqr” as seen in the following documentation: https://www.mathworks.com/help/matlab/ref/lsqr.html. I'd be able to help more if I had more idea about the kind of data you were working with, but hope this helps!
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!