CHAPTER 5

image

Optimization Using Symbolic Computation

5.1 Symbolic Equations and Systems of Equations

The following commands can be used for the solution of symbolic equations and systems of equations:

solve(‘equation’, ‘x’)

Solves the equation in the variable x.

syms x; solve(equation,x)

Solves the equation in the variable x.

solve('e1,e2,…,en', 'x1,x2,…,xn')

Solves the system of equations e1,…, en in the variables x1, ... , xn.

syms x1 x2… xn;

solve(e1,e2,…,en, x1,x2,…,xn)

Solve the system of equations e1,…, en in the variables x1, … , xn.

As a first example we solve the equation 3ax − 7x2 + x3 = 0 in terms of x, where a is a parameter.

>> solve('3*a*x-7*x^2+x^3=0','x') ...

Get MATLAB Optimization Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.