The most common reason for getting unexpected results when using an embedded Mathcad document is due to input/output mismatch caused by incorrect numbering.
When you are entering an expression or equation in an embedded Mathcad document, it is important to remember that the input and output keywords begin with the index of 0, and not 1. In other words, the first (that is, top) input connector on the embedded Mathcad document is represented in the Mathcad expressions by the keyword in0; the second input by the keyword in1, and so on. Similarly, on the output side, the first (that is, top) output of the embedded Mathcad document takes the value defined by the keyword out0; the second output takes the value of out1, and so on.