Thread Subject: symbolic equation simplification

Subject: symbolic equation simplification

From: David Doria

Date: 1 Mar, 2008 14:19:01

Message: 1 of 2

Say I have something like this

syms a b
LHS=2*a +b;
RHS=3*a + 4*b;

which represents the equation:
2*a + b = 3*a + 4*b

I would like to get back:
a+3*b = 0

or something like that, where all the cancellations that
were possible were performed. Is there a function that does
this?

Thanks,

Dave

Subject: symbolic equation simplification

From: Vincent Morio

Date: 9 Mar, 2008 00:27:03

Message: 2 of 2

Hi David,

Yes, I have a solution to your problem. You can use via the
Matlab symbolic toolbox some Maple functions. For instance,
you can recover the equation a+3*b = 0 by using the rhs and
lhs Maple commands:
maple('rhs(2*a+b=3*a+4*b)-lhs(2*a+b=3*a+4*b)')

Regards,
V. Morio
University Bordeaux 1/IMS lab. /Automatic Control Group


"David Doria" <daviddoria@gmail.com> wrote in message
<fqbokl$9i8$1@fred.mathworks.com>...
> Say I have something like this
>
> syms a b
> LHS=2*a +b;
> RHS=3*a + 4*b;
>
> which represents the equation:
> 2*a + b = 3*a + 4*b
>
> I would like to get back:
> a+3*b = 0
>
> or something like that, where all the cancellations that
> were possible were performed. Is there a function that does
> this?
>
> Thanks,
>
> Dave

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com