Get Help

Turn on suggestions

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
- :
- Undefined Variable Help

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

12-16-2014
09:50 AM

12-16-2014
09:50 AM

I've just started using MathCad, and I do not know why the Resultants1 variable is undefined (its probably some silly error, but its been frustrating me for a while now).

Any help would be immensly appreciated.

Thanks in advance all!

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

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

12-16-2014
10:32 AM

12-16-2014
10:32 AM

Calculations in a Mathcad worksheet are carried out from top left to bottom right, in the same way you would read a page of text. Your use of lsolve is above the definition of Resultants, so it sees the variable as undefined. Move it down, and the error goes away. You do then get another error, because you have 15 rows in Resultants, but only 14 rows in Coefficients. If you delete one row from Resultants it works.

3 REPLIES 3

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

12-16-2014
10:32 AM

12-16-2014
10:32 AM

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

12-16-2014
10:36 AM

12-16-2014
10:36 AM

Re: Undefined Variable Help

Two problems.

1. Mathcad evaluates a worksheet from left-to-right and then top-to-bottom. Normally, all variables must be defined before they are used (symbolic processing is a different matter). So you need to define the lsolve equation after defining Resultants (ie, either to the right and/or below Resultants).

2. lsolve solves the equation M*x=v. Hence M and v must have the same number of rows. Coefficients (M) has 14 rows whereas Resultants (v) has 15. You need to correct your equation (I've demonstrated this by taking the transpose of Coefficients in the attached worksheet).

Mathcad error messages can be particularly unhelpful and sometimes need a bit of interpretation.

Stuart

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

12-16-2014
10:46 AM

12-16-2014
10:46 AM

Re: Undefined Variable Help

Great! That solved my problems. Thanks a lot everyone!

Top Tags