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

Contact us at files@mathworks.com