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
- :
- Prime 5 issues with indexing

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- 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
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-25-2021
07:46 PM

02-25-2021
07:46 PM

Hi all,

I was writing a solution guide for my engineering students and keep getting errors in my Solve Block. I have removed all the unnecessary bits, and boiled it down to just the issues I am having in my sheet. I'm trying to get the solve block to provide multiple solutions based on different conditions of the constraint equation. In my document I was able to get it to work in the first solve block (off to the side in the work space I have my initial solve block where I hardcoded the equations just as a double check) however in my solve block on the second page "determination of beam base needed to provide eq stiff..." I'm not able to condense the 6 constraint equations like I was before. I tried indexing 1-6 and kept getting errors in my "find" statement and my output was a [6x1] nested matrix of [6x1] matrices.

TLDR: trying to index a solve block instead of hardwriting eqtns

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

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

02-25-2021
11:18 PM

02-25-2021
11:18 PM

Are you teaching engineering or Mathcad?

If you're teaching Mathcad, then you need to answer the problem in the solve block, and the answer is that you have two vectors in this equation, E and b, so you need to "vectorize" the constraint so it gets multiplied element by element rather than a dot product (note the arrow above the RHS:

If you're teaching engineering, then you need to save the solve blocks for when you really need them and remind the class about high school algebra. (See attached)

5 REPLIES 5

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

02-25-2021
08:37 PM

02-25-2021
08:37 PM

Re: Prime 5 issues with indexing

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

02-25-2021
11:18 PM

02-25-2021
11:18 PM

Are you teaching engineering or Mathcad?

If you're teaching Mathcad, then you need to answer the problem in the solve block, and the answer is that you have two vectors in this equation, E and b, so you need to "vectorize" the constraint so it gets multiplied element by element rather than a dot product (note the arrow above the RHS:

If you're teaching engineering, then you need to save the solve blocks for when you really need them and remind the class about high school algebra. (See attached)

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

02-26-2021
11:01 AM

02-26-2021
11:01 AM

Re: Prime 5 issues with indexing

Got it thanks!

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

02-26-2021
05:22 AM

02-26-2021
05:22 AM

Re: Prime 5 issues with indexing

Fred had already shown that the key to success is vectorization and I fully agree with him that in that case a solve block (or a symbolic solve as shown by ttokoro) is overkill and not necessary.

For more complicated formulas a solve block might be appropriate and I always would suggest to set up the calculations not for vectors but just so that they work for single scalars, turn the calculations into functions dependent on the input variables and only at last call them vectorized with vector arguments. You gain much more versatility and IMHO its less failure prone.

In case of your second solve block this would look like this:

You may also consider making EI.st and h additional arguments of the function. That way you could put the function on top of the sheet and define your variables later and call the function multiple times with different variable sets for comparison.

Of course with this simple formula you would actually just use something like

instead of a solve block.

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

02-26-2021
11:09 AM

02-26-2021
11:09 AM

Re: Prime 5 issues with indexing

Got it thank you! I'll practice those two methods because I think they'll come in handy..looking back at my approach I definitely agree that a simple symbolic solve would have been better..My end goal here was actually to make some of the calculations "future-proof"