Dealing with very small or very large numbers

10 ビュー (過去 30 日間)
Anthony Gurunian
Anthony Gurunian 2021 年 4 月 10 日
コメント済み: Anthony Gurunian 2021 年 4 月 10 日
I have a physical problem with length scales on the order of nanometers. After some calculations, I have to calculate things like exp(-1e15) which is 0 according to MATLAB, but in reality it is nonzero. For context exp(-700) is already 9.8e-305 which is close to the smallest number in MATLAB 2.2251e-308. Is there a known workaround for things like his?

採用された回答

James Tursa
James Tursa 2021 年 4 月 10 日
I guess the obvious suggestion is to work in units of nanometers or maybe picometers instead of meters. Can you do that?
  2 件のコメント
Anthony Gurunian
Anthony Gurunian 2021 年 4 月 10 日
That creates a new problem of having to convert back. Let's say I need a quantity f(x) = e^-x. If x is in meters f(1000) = 5.07e-435. if x is in kilometers, f(1) = 0.36. There is no simple way to convert.
Anthony Gurunian
Anthony Gurunian 2021 年 4 月 10 日
Never mind, the quantity x is untiless in my case so it doesn't matter.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by