type
status
date
slug
summary
tags
category
icon
password
Property
Apr 10, 2024 09:45 AM
URL
问题
今天我在帮忙别人求解一个问题的时候,在他的表达式中有
Abs
这个函数,在后续的处理过程中需要对 Abs
这个函数进行求导,然后绘图,原图是一个曲线,但是绘制的图像是一个间断的直线,很显然这个结果是不对的,于是我开始一步一步检查我的代码,最后落脚点我发现出现在了 Abs 这个函数的导数上在这里我使用了函数 N ,也没有得到数值解,然后在下面的建议栏部分 Mathematica 提示我使用
FunctionExpand
,我尝试使用这个函数,确实可以, 不知道为什么会这样,希望有人可以帮我解答一下
英文提问版
Today, while helping someone solve a problem, I encountered an issue with the
Abs
function in their expression. I needed to derive the Abs
function and then plot it. The original image was a curve, but the plot ended up as a discontinuous straight line, which is obviously wrong. So, I started to check my code step by step and found the problem lies with the derivative of the Abs
function.$$
\text{Abs}'(0.951057)
$$
Here I used the N function, but I didn't get a numerical solution. Then, in the suggestion bar below, Mathematica suggested I use
FunctionExpand
. I tried this function, and it indeed worked.$$
1
$$
I'm not sure why this is the case and I'm hoping someone can help explain it to me.
问题解决:
根据别人的说法可能是这样的:
解答:
为了避免这种情况,可以使用 RealAbs 会更好
或者使
FullSimplify
这个函数- 作者:我心永恒
- 链接:https://wxyhgk.com/article/mma-FunctionExpand
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。