568 Views 2 Replies Latest reply: Mar 18, 2004 12:00 AM by ptc-2179264
9 posts since
Oct 18, 2008
Currently Being Moderated

## Solve Block Fails with Integral of Vector-Matrix

The attached file shows a simple solve block with an integral constraint. I'm attempting solve a state-space differential equation by direct integration. An attempt at symbolic solution failed, so I'm attempting to solve the problem at particular values of time t. In the example, t is set to 4. Guesses are made for xp1 and xp2. Mathcad should iterate on solutions of the integral until both the right- and left-hand side of the equation matches. Can somebody get this to work?

• 10,537 posts since
Oct 22, 2006
Currently Being Moderated
Mar 18, 2004 12:00 AM (in response to ptc-2179264)
Solve Block Fails with Integral of Vector-Matrix
t is not defined. A constraint is not a definition.

Your other problem is that Mathcad does not do the sort of matrix calculations that you are asking for. The exp function cannot be applied to a matrix. And in your actual sheet, you are not even attempting to do so -- if you look at the actual expression you will find that you have an implicit multiplication there, so you are multiplying exp by a matrix. That doesn't work as functions cannot be used arithmetically. The parenthesis that are used to denote arrays cannot also denote function application. You need separate parentheses for that. Not that it matters in this case, as the exponential of a matrix is not built into Mathcad, and you would have to define it separately (I've posted a worksheet that shows how to do that at http://collab.mathsoft.com/read?40727,11
).

However, even that will not solve your problems, as Mathcad does not integrate vectors. Only scalars. You must either reduce the problem to a set of scalar integrals or write your own integration routines.

Before you use an expression in a constraint in a solve block, you should make sure that it evaluates properly outside the solve block.

Tom Gutman

#### More Like This

• Retrieving data ...