Replace a multiple of two symbolic numbers
Show older comments
Hi,
I'm attempting to replace (to linearise my equation) the multiple of two very small values dx and dy.
I attempted to use subs but it doesn't seem to work.
Code: PO=subs(PO,[(dx*dy),(dy*dx)],[0,0]);
PO is my symbolic vector. There is no error message but it just doesn't pick up the combination. Any Ideas?
Thanks!
Matlab Version: 2012a
Accepted Answer
More Answers (1)
Walter Roberson
on 18 Oct 2012
0 votes
In the Symbolic Toolbox, the order of operands is treated algebraically, so any subexpression might get rewritten to an equivalent subexpression. For example, x*2*x would get rewritten to 2*x^2. When you replace dx*dy with dy*dx the order might get rewritten arbitrarily.
I do not know the order used by the Symbolic Toolbox. In another package I am familiar with, the order used is the order the operands were first encountered in (or so it used to be; the package added new controls around this in later releases.)
Categories
Find more on Utilities for the Solver in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!