Check IN WHICH CASE symbolic logical expression is true

3 ビュー (過去 30 日間)
Hendrik Lorenz
Hendrik Lorenz 2019 年 6 月 27 日
回答済み: Hendrik Lorenz 2019 年 6 月 27 日
Is it possible to get the conditions under which an expression would be true. Example:
syms a b c
assume(a > 0)
c = a+ b
isAlways(c >0 )
Warning: Unable to prove '0 < a + b'.
> In symengine
In sym/isAlways (line 42)
In LiveEditorEvaluationHelperEID289025349 (line 314)
In matlab.internal.editor.evaluateRegions
In matlab.internal.editor.EvaluationOutputsService.evalRegions
Now I would like to receive the information that c > 0 if b >= 0.
That possible?

採用された回答

Hendrik Lorenz
Hendrik Lorenz 2019 年 6 月 27 日
Well what I stated is true: c > 0 if b >= 0 Although it is not true that b >= 0 if c > 0 right. But you got what I meant. Thanks for the answer!

その他の回答 (1 件)

Steven Lord
Steven Lord 2019 年 6 月 27 日
No, that's not possible because as you've stated your solution it's not true. c can be greater than 0 even if b is negative.
a = 1;
b = -0.5;
c = a+b
For c to be greater than 0, b must be greater than -a which does not necessarily require it to be greater than 0.You can ask solve to return conditions.
syms a b c
assume(a > 0)
c = a + b
[S, params, conditions] = solve(c > 0, b, 'ReturnConditions', true)
b can be any value x such that -a < x.

カテゴリ

Help Center および File ExchangeNumber Theory についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by