# Is there any discrete mathematics solver for symbolic equations ?

5 views (last 30 days)

Show older comments

Tamura Kentai
on 6 Jul 2020

Commented: Walter Roberson
on 9 Jul 2020

Hi, :

Excuse me, I have surveyed some, but no similar solution. So that may I ask some opinions from you.

That's if it's possible to solve the symbolic equations (simplify), which similar to the 'solve()', in continuous time questions.

For example:

(1). w[n] = x[n] + a*w[n-1]

(2). y[n] = w[n] + b*w[n-1]

The above (1), (2), equations represent a signal flow, the w[n] is intermediate node, what the users would want is y[n] = expressions in {x , y}.

From the handwrote deriven , the final is (3)

(3). y[n] = x[n] +b*x[n-1] + a*y[n-1]

is derived from,

from (1),

w[n] = x[n] +a*z^-1*w[n], such that, w[n] = x[n]*( 1 - a*z^-1 )^-1 --------(1-1)

from (2),

y[n] = w[n] + b*z^-1*w[n], such that, y[n] = w[n]*( 1 + b*z^-1 ) ---------(2-1)

from (1-1), (2-1),

y[n] = x[n]* ( 1 + b*z^-1) / ( 1 - a*z^-1)

then , y[n]*( 1 - a*z^-1 ) = x[n]*( 1 + b*z^-1 )

then , y[n] - a*y[n -1] = x[n] + b*x[n-1]

finally, y[n] = x[n] + b*x[n-1] + a*y[n-1] ------------(3)

Like the above, is there any method in Matlab to derive the (1), (2) to (3)

Thank you fro any ideas.

Best regards.

##### 0 Comments

### Accepted Answer

Walter Roberson
on 6 Jul 2020

##### 4 Comments

Walter Roberson
on 9 Jul 2020

https://www.mathworks.com/help/symbolic/feval.html documents feval(symengine)

The short summary is that feval(symengine, 'SomeFunction', arg1, arg2, arg3, ...) evaluates arg1, arg2, arg3 using the usual MATLAB evaluation rules. It then takes the results and constructs a MuPAD call with SomeFunction as the name of the function to call, and the results of evaluating arg1, arg2, arg3 as the arguments. The call that is constructed is a character vector, and the character vector is

The effect is similar to evalin(symengine, 'SomeCommand') except that using feval(symengine) constructs arguments with variable names properly.

The programming language is MuPAD.

MuPAD is barely documented starting with R2020a, so you would need to look at a previous release for documentation.

The basic syntax is rec() with first parameter being an equation in = form (not == form) that sets out a recursion, and the second parameter indicates which expression you would want it to be solved for. The third parameter, not shown, is a set of initial conditions in the form of indexed_expression = value, such as {y(0)=1 y(1) = 7} . It takes a bit of extra work to construct a set at the MATLAB level: MATLAB's {} for cell arrays is not the same.

### More Answers (1)

madhan ravi
on 6 Jul 2020

You may have a look into collect(), isolate() which may be of use for you to obtain those results.

doc collect

doc isolate

### See Also

### Categories

### Products

### Community Treasure Hunt

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

Start Hunting!