# Solve Linear Equations

Verb: `solveLE`

Available from: <Enterprise>

This command is used for solving linear equations systems.

## Syntax

`solveLE --equations(String) --overwriteinputvariables(Boolean) (Boolean)=value `

## Inputs

Script Designer Required AcceptedTypes Description
--equations Equations Required Text Equations that make up the linear system to be solved.
--overwriteinputvariables Override Variables Required Boolean When enabled, sets the unknown values to the input variables.

## Outputs

Script Designer AcceptedTypes Description
value Success Boolean Returns True if the system was resolved without errors. Otherwise returns False.

## Example

The following system of linear equations is used:

2x+y=1

x-y=2

With the Override Variables parameter checked, the system of equations is solved and the results are returned overwritting the input variables. Log Message displays the contents of x and y in the IBM RPA Studio console.

``````defVar --name x --type Numeric
defVar --name y --type Numeric
defVar --name success --type Boolean
solveLE --equations "2*\${x}+\${y} = 1\r\n\${x}-\${y} = 2" --overwriteinputvariables  success=value
logMessage --message "\r\nx = \${x}\r\ny = \${y}" --type "Info"
//Result: x = 1
// y = -1
``````

## Remarks

In Equations, the entry must conform to the system recognized format: "\${var1} + \${var2} = 4 ou \${x} + \${y} = \${z}".

Input Example:

2x+y=1

x-y=2

Format for this entry:

2*\${x}+\${y}=1

\${x}-\${y}=2