How to interpolate 3 matrices?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello everybody,
I have acquired data from testing an electric motor on a test bench. The data is organized in 3 matrices, one matrix for rpm, one for motor torque and one for efficiency. The motor was controlled by arduino and the test consisted on forcing an acceleration ramp at different slopes. The matrices have a size of 5326X15 where each column correspond to a ramp. I am seeking a way to create a grid of rpm and torque and interpolate the efficiency values at those grid points.
댓글 수: 0
채택된 답변
Mathieu NOE
2021년 12월 2일
hello Federico
this is my suggestion : I give a given RPM target value and serach for all points in the 2D array that are close to this value (with a given tolerance); then I can plot the same coordinate points from the torque and efficiency curves
the second figure I added a bit of smoothing
example for RPM = 3000
rpm_tol = 1;
rpm_target = 3000;
[row, column] = find(abs(rpm-rpm_target) < rpm_tol);
rpm_values = rpm(sub2ind(size(rpm), row, column));
C_mot_values = C_mot(sub2ind(size(C_mot), row, column));
eta_mech_values = eta_mech(sub2ind(size(eta_mech), row, column));
figure,
subplot(311),plot(rpm_values);
ylabel('RPM');
subplot(312),plot(C_mot_values);
ylabel('Torque');
subplot(313),plot(eta_mech_values);
ylabel('Efficiency');
figure,
meth = 'gaussian';
N = 10;
subplot(311),plot(smoothdata(rpm_values,meth,N));
ylabel('RPM');
subplot(312),plot(smoothdata(C_mot_values,meth,N));
ylabel('Torque');
subplot(313),plot(smoothdata(eta_mech_values,meth,N));
ylabel('Efficiency');
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Motor Drives에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!