simplifying symbolic expressions using assumptions
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Bhupi
le 4 Août 2014
Réponse apportée : Christopher Creutzig
le 29 Août 2014
Hi all,
I have a symbolic equation as follows:
A = X / (XY + 1);
I know that for my specific case XY >> 1
I wish to simplify this equation using this assumption such that the denominator simplifies to 1 + XY ~ XY and A becomes X/XY = 1/Y.
Are there tools/functions in the symbolic math toolbox that allow one to do these user defined simplifications on a symbolic expression?
If not then is there a way I can do this through some code?
Thanks, Bhupi
0 commentaires
Réponse acceptée
Yu Jiang
le 4 Août 2014
I don’t think there is a way to directly approximate a symbolic expression in MATLAB with another symbolic term.
However, here is a workaround for the example you provided. Since x*y >> 1, you may want to consider replace (x*y+1) with x*y by using the function sub (See Documentation) .
For example, the following code can be executed
>> syms x y
>> A = x/(x*y+1);
>> A = subs(A, 'x*y+1', 'x*y');
The result will be A = 1/y.
-Yu
Plus de réponses (1)
Christopher Creutzig
le 29 Août 2014
This approximation can be viewed as a special kind of truncated series:
>> syms X Y
>> A = X/(X*Y + 1);
>> taylor(A, Y, Inf, 'Order', 2)
ans =
1/Y
>> taylor(A, X, Inf, 'Order', 2)
ans =
1/Y - 1/(X*Y^2)
>> taylor(A, X, Inf, 'Order', 1)
ans =
1/Y
0 commentaires
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!