cancel
Showing results for
Search instead for
Did you mean:
cancel
Showing results for
Search instead for
Did you mean:

## Iterate Simultaneous Equations

I'm trying to solve a system of simultaneous equations with a given value that changes. I attached a simplified worksheet to illustrate this. I used the variable 'I' to represent the position in the input matrix. I would like Mathcad to return the values of x0,y0, x1,y1, and x3,yall at one time for each value of Theta. I really don't know where to start on this. Any help would be appreciated.

Thanks

15 REPLIES 15

## Re: Iterate Simultaneous Equations

You may consider turning the solve block into a function dependent on theta: ## Re: Iterate Simultaneous Equations

turn the solve block into a function.  (And be careful not to reassign variables!)

## Re: Iterate Simultaneous Equations

Like this? Success!
Luc

## Re: Iterate Simultaneous Equations

Thanks everyone for your responses. I thought that they were exactly what I needed, however when I went to apply the methods in my actual calculations of 11 equations, it will not solve. It will solve when the input angle is a given number (say 0 and 10 degrees), but fails when it is a vector consisting of the same angles. I attached a file illustrating this. Any idea why this is happening would be greatly appreciated.

## Re: Iterate Simultaneous Equations

You can't continue naming different things the same.

## Re: Iterate Simultaneous Equations

Sorry, I should've been more clear on what I was doing. I put both angles in there so one could be dragged before or after the other to illustrate the problem I'm having. Ideally, I would only have the vector definition, but in the end I only have one definition of the angle. I need ThetaLT to be a vector that is used in the equations. I noticed the way you redefined it, ThetaLT is used but ThetaLTg is not used in the equations.

## Re: Iterate Simultaneous Equations

theta.LT should not be defined before the solve block at all!

The solve block is set up for a theta.LT being a single scalar provides as argument of the solve block function.

The problem is that you calculate in front d.LT, F.UL, theta.lift and theta.link

You have to turn all of them into functions of theta.LT and use those functions in your solve block!

## Re: Iterate Simultaneous Equations When you turn a solve block into a function (which you did) It works like any other Mathcad Function.  The definition has a dummy variable in it: And when you evaluate the function, the value in the parenthesis is substituted for the dummy: When I looked in your solve block I saw theta.LT (the dummy variable) in a lot of places.  Rather than try to alter all of those, I renamed the vector of angles you wanted to evaluate, then typed that name into the function to get the solution vectors: So I'm lazy!

## Re: Iterate Simultaneous Equations

Looking at your sheet, there are other problems. You define things above the solve block in terms of the solve block dummy variable.  These will not change in the solve block when the variable changes.  They need to be functions of the variable.