Symbolic toolbox not simplifying adequately

I'm using MATLAB Live Editor along with the symbolic toolbox. The following expression is not getting simplified. Any fixes?
I've tried using simplify to no avail.
Thanks,
Mohit.

 Réponse acceptée

madhan ravi
madhan ravi le 12 Juin 2020
syms alpha F R
simplify((3*F*R^2*alpha)/64 - 3*R*sqrt(F^2*R^2*alpha^2)/64,...
'IgnoreAnalyticConstraints', true)

6 commentaires

Walter Roberson
Walter Roberson le 12 Juin 2020
Right. The two parts are not the same if some of the values are negative.
Mohit Kumar
Mohit Kumar le 12 Juin 2020
Ah of course! MATLAB doesn't recognise that the values are purely real. Thanks!
madhan ravi
madhan ravi le 12 Juin 2020
MATLAB doesn’t have “Mind Reading Toolbox” ;)
real is not enough: consider negative real numbers.
You can add assumptions to symbols such as
syms alpha positive
syms R
assume(R>=0)
Mohit Kumar
Mohit Kumar le 13 Juin 2020
Right, understood. Thanks guys!
Great, thanks!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange

Produits

Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by