필터 지우기
필터 지우기

The calculation result of the Matlab function is incorrect.

조회 수: 1 (최근 30일)
hard study
hard study 2023년 12월 18일
이동: Stephen23 2023년 12월 19일
When I was conducting Simulink simulation, I encountered the following issues:
At the same time, the reference value is fixed and different id_p are entered has different calculation results Te_ P. The error is equal to the square of (Te_p-Reference).The key issue is that the calculated value in scenario 2 is closer to the reference value, but the calculated error result is larger, which is contradictory. Please refer to the picture.
  댓글 수: 2
madhan ravi
madhan ravi 2023년 12월 18일
편집: madhan ravi 2023년 12월 18일
Can you perhaps try it with fixed point data instead? Uint64 with minute slope, 1e-8 for example?
hard study
hard study 2023년 12월 19일
Thank you for your reply. This is just my mistake, due to the issue of data latency.

댓글을 달려면 로그인하십시오.

채택된 답변

Ganesh
Ganesh 2023년 12월 19일
From the values, I can see that the error value is being computed wrongly for every value of "Te_up". However, the value of "Te_ref_up" being used for error calculation is consistent, with the value being 0.6113857267404.
Here are the possible resolutions for the issue you are facing:
  1. Clear all the variables in Model Workspace and start fresh.
  2. Use a higher precision data structure for storing the reference value.
  3. Ensure that "Te_ref_Up" is not changing during the simulation.
  4. Check the value of the signal that is being connected to the function block to know what value is being passed.
Please refer to the following documentation on defining variables inside a MATLAB Function Block :
Hope that helps!
If the issue persists, kindly reach out to MathWorks Technical Support
Thanks,
Ganesh S
  댓글 수: 1
hard study
hard study 2023년 12월 19일
이동: Stephen23 2023년 12월 19일
Thank you for your reply. This is just my mistake, due to the issue of data latency.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by