How can I calculate SAE J1269 least squre method in matlab? (multiple variable function)
2 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Varun
on 20 Dec 2023
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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!