Simplifying a algebraic or numeric expression to lowest possible power

1 回表示 (過去 30 日間)
Saikat Banerjee
Saikat Banerjee 2020 年 8 月 1 日
編集済み: John D'Errico 2020 年 8 月 1 日
Suppose if I write (a^2)^(1/2) then it will remain as that. But I want to simplify to the lowest possible power. How can we do it. Also if there is a combination of x^m*y^n*z^p

採用された回答

John D'Errico
John D'Errico 2020 年 8 月 1 日
編集済み: John D'Errico 2020 年 8 月 1 日
The problem is, there are multiple solutions, because sqrt is not as simple a thing as you like.
syms x
>> y = sqrt(x.^2)
y =
(x^2)^(1/2)
simplify(y)
ans =
(x^2)^(1/2)
The issue is, there are TWO solutions to the problem, thus +/- x. In order to gain the solution you want, you need to tell simplify to ignore those branch cuts.
ysimpl = simplify(y,'IgnoreAnalyticConstraints',true)
ysimpl =
x
From the help for simplify, we see:
simplify(S,'IgnoreAnalyticConstraints',VAL) controls the level of
mathematical rigor to use on the analytical constraints while simplifying
(branch cuts, division by zero, etc). The options for VAL are TRUE or
FALSE. Specify TRUE to relax the level of mathematical rigor
in the rewriting process. The default is FALSE.

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by