发布于: 2024-4-9最后更新: 2024-4-10字数 00 分钟

type
status
date
slug
summary
tags
category
icon
password
Property
Apr 10, 2024 09:45 AM
URL

问题

今天我在帮忙别人求解一个问题的时候,在他的表达式中有 Abs 这个函数,在后续的处理过程中需要对 Abs 这个函数进行求导,然后绘图,原图是一个曲线,但是绘制的图像是一个间断的直线,很显然这个结果是不对的,于是我开始一步一步检查我的代码,最后落脚点我发现出现在了 Abs 这个函数的导数上
在这里我使用了函数 N ,也没有得到数值解,然后在下面的建议栏部分 Mathematica 提示我使用 FunctionExpand ,我尝试使用这个函数,确实可以,
notion image
不知道为什么会这样,希望有人可以帮我解答一下
英文提问版
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 $$
notion image
I'm not sure why this is the case and I'm hoping someone can help explain it to me.
 
问题解决:
根据别人的说法可能是这样的:

解答:

notion image
为了避免这种情况,可以使用 RealAbs 会更好
notion image
 
或者使 FullSimplify 这个函数

  • Waline
示例文章

示例文章

这是示例的文章摘要,摘要内容可被用做搜索,预览。文章列表默认展示概要;若要在列表直接展示文章内容,可在blog.config.js中配置。


公告
公告
博客重大更新,更换为matery主题,阅读体验更加好了。
和博主联系
notion image