Get Help

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Iterate Simultaneous Equations

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-22-2018
01:37 PM

08-22-2018
01:37 PM

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,y3 all at one time for each value of Theta. I really don't know where to start on this. Any help would be appreciated.

Thanks

Labels:

15 REPLIES 15

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-22-2018
01:50 PM

08-22-2018
01:50 PM

Re: Iterate Simultaneous Equations

You may consider turning the solve block into a function dependent on theta:

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-22-2018
01:52 PM

08-22-2018
01:52 PM

Re: Iterate Simultaneous Equations

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-22-2018
04:01 PM

08-22-2018
04:01 PM

Re: Iterate Simultaneous Equations

Like this?

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-23-2018
08:05 AM

08-23-2018
08:05 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-23-2018
08:20 AM

08-23-2018
08:20 AM

Re: Iterate Simultaneous Equations

You can't continue naming different things the same.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-23-2018
08:32 AM

08-23-2018
08:32 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-23-2018
08:49 AM

08-23-2018
08:49 AM

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!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-23-2018
11:34 AM

08-23-2018
11:34 AM

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!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-23-2018
11:56 AM

08-23-2018
11:56 AM

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.

Top Tags