Numerical Precision Physics Calculations

조회 수: 2 (최근 30일)
ADSW121365
ADSW121365 2022년 8월 25일
편집: ADSW121365 2022년 8월 25일
I believe I may be encountering issues related to the numerical precision, but my understanding is limited so I wanted to ask the community. Hopefully I'm misunderstanding and someone can clarify!
I have a physics problem where I'm working with weak spatially varying magnetic fields, and calculating their response to conductive materials. For example, one calculation may involve a vector of doubles which range from 3e-7 to 4.9e-12 multiplied by one which has values of 0 or 5.89e7.
eps(5.89e7)
ans = 7.4506e-09
does this mean that all values below that eps value behave as zeros because there isn't sufficient precision for the calculation? Or do calculations work with say 4.9 *5.89 then e-12 *e7 seperately?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2022년 8월 25일
편집: Fangjun Jiang 2022년 8월 25일
eps(5.89e7)
ans = 7.4506e-09
It means that around 5.89e7 (which is a large value), the nearest values that can be represeted by double data type is 5.89e7+7.4506e-09 or 5.89e7-7.4506e-09. So you can see the minimal incremental value of 7.4506e-09 is quite small.
eps('double')
ans = 2.2204e-16
Since you are using the default double data type, there should be no problem representing your multiplication in the range of
5.89e7*4.9e-12
ans = 2.8861e-04
  댓글 수: 1
ADSW121365
ADSW121365 2022년 8월 25일
편집: ADSW121365 2022년 8월 25일
My confusion arose from that first part. If I were to add my vectors, 5.89e7 + 4.9e-12, the calculation would be below the minimal incremental value & therefore the difference between the 5.89e7 and the result would not be represented.
I'm glad to know this doesn't impact multiplications, thank you.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by