Find value of large number

조회 수: 3 (최근 30일)
Fatima Majeed
Fatima Majeed 2024년 6월 17일
답변: Steven Lord 2024년 6월 17일
\begin{align*}
B_2 &= 0.18525 \\
z &= 2.8 \times 10^{10} \\
H &= 3000175332800 \\
R &= \frac{z^{3/5}}{(\log(z))^{1/5}} \\
\\
\text{Substitute } z \text{ with } 2.8 \times 10^{10} \\
\\
R &= \left. \frac{z^{3/5}}{(\log(z))^{1/5}} \right|_{z = 2.8 \times 10^{10}} \\
\\
b &= \cdot (\exp(z_{\text{value}} \cdot -0.5) - 1) \cdot z^{\frac{6D - 15}{5}} \cdot \exp\left( \frac{B_2 (8D - 5) R}{3} \right)
\end{align*}
Could you fix this code, or do you have any ideas before I try it in MATLAB?
% Define the constants
B_2 = 0.18525;
H = 3000175332800;
D = 0.9999932;
z = 2.8 * 10^10;
% Define the expression for R
R = (log(z))^(3/5) / (log(log(z)))^(1/5);
% Display R
disp('R:');
disp(R);
RR = double(R);
disp('RR:');
disp(RR);
% Define the expression for b
b = (log(H/(2*pi)))^2 * (exp(-0.5 * z) - 1) * z^((6 * D - 15) / 5) * exp(B_2 * (8 * D - 5) * R / 3);
% Evaluate b
bb = double(b);
% Display b
disp('b:');
disp(b);
disp('bb:');
disp(bb);

채택된 답변

Steven Lord
Steven Lord 2024년 6월 17일
Use Symbolic Math Toolbox. Define your constants symbolically.
% Define the constants
B_2 = sym(0.18525);
H = sym('3000175332800');
D = sym(0.9999932);
z = sym(2.8) * 10^10;
I made no modifications below this line besides removing the blank line at the end of the code block.
% Define the expression for R
R = (log(z))^(3/5) / (log(log(z)))^(1/5);
% Display R
disp('R:');
R:
disp(R);
RR = double(R);
disp('RR:');
RR:
disp(RR);
5.3485
% Define the expression for b
b = (log(H/(2*pi)))^2 * (exp(-0.5 * z) - 1) * z^((6 * D - 15) / 5) * exp(B_2 * (8 * D - 5) * R / 3);
% Evaluate b
bb = double(b);
% Display b
disp('b:');
b:
disp(b);
disp('bb:');
bb:
disp(bb);
-3.0519e-16

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Biotech and Pharmaceutical에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by