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

SOLVED
Regular Member

## Prime 5 issues with indexing

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

1 ACCEPTED SOLUTION

Accepted Solutions

## Re: Prime 5 issues with indexing

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

Tags (1)

## Re: Prime 5 issues with indexing

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)

Got it thanks!

## 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

Regular Member
(in response to Werner_E)

## 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"

Announcements
Check out the latest