how to make a sum of squares symbollically known to MATLAB for use in simplification

8 ビュー (過去 30 日間)
Michael Levy
Michael Levy 2022 年 10 月 26 日
回答済み: Paul 2022 年 10 月 27 日
I have a complex symbolic expression like
f = (a) * (b) * (c) * (1- x^2 - y^2 - z^2) * (d)
I would likt to try to tell matlab that (1- x^2 - y^2 - z^2) = 0
so that when I execute simpify(f) or eval(f) I would get f=0
I try
assume((1- x^2 - y^2 - z^2) == 0).
That does not work
I try
z = sqrt(1 - x^2 - y^2)
That does not work
How can I do this?

回答 (1 件)

Paul
Paul 2022 年 10 月 27 日
Hi Michael,
simplify works for this case:
syms a b c d x y z
f = (a) * (b) * (c) * (1- x^2 - y^2 - z^2) * (d)
f = 
assume(1 - x^2 - y^2 - z^2 == 0)
simplify(f)
ans = 
0

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by