You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MATLAB中cosh/sinh大值计算NaN问题及弹性恢复系数积分求助

Alright, let's walk through the hurdles you're hitting with your MATLAB calculations and the temporary fix you've landed on:

MATLAB Numerical Issues & Workaround for Radius Integration
  • Hyperbolic Function Overflow:When x falls between 700 and 1000, calculating cosh(x) and sinh(x) throws back NaN because the values blow past MATLAB's numerical limits. This is the main reason your integration over the radius range is stuck.
  • Elastic Restor Coeff Anomaly:Your elastic_restor_coeff variable shoots up when the radius drops below 5e-9. Since you need to integrate across radii from 1e-9 to 100e-9, this unexpected spike adds extra instability to your computations.
  • Temporary Stopgap Fix:To keep progress moving, you're approximating the real part of chi_para with a step function once threshold2 reaches a specific value. This bypasses the NaN-induced calculation halt, though it's just a short-term workaround for now.

If you're aiming for a more robust long-term solution, consider exploring two avenues:

  1. Rewrite the hyperbolic function calculations using logarithmic transformations (since cosh(x) and sinh(x) can be expressed via exponentials, which are easier to handle with logs for large x values)
  2. Use MATLAB's vpa (Variable-Precision Arithmetic) tool to handle the large numerical ranges without hitting overflow limits

内容的提问来源于stack exchange,提问作者Nabs

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:38:14