588 Views 11 Replies Latest reply: Jan 7, 2014 10:43 AM by WE
52 posts since
Jan 6, 2012
Currently Being Moderated

## Possible to create iterative solve blocks?

In the attached MathCAD 14 worksheet I am attempting to solve for the embedment length for multiple sets of variables ( concrete dimensions a,b,ma,mb) using the Given command/block. Is it possible to pass multiple groups of variables in these three equations and solve for the single variable E using the Given block?

For each set of variables only one equation is solvable for E while the other two will not be solveable. The solvable equation changes as the dimensions changes. If the equation is not solvable, is it possible to for MathCAD to return a zero or unsolveable response instead of turning red?

Attachments:
• 4,914 posts since
Nov 3, 2009
Currently Being Moderated
Jun 6, 2013 5:00 PM (in response to ptc-4397077)
Re: Possible to create iterative solve blocks?

Not sure what kind of iteration you are talking about in the subject.

But if you get riod of the range variable and the elementwise (subscribted/indexed) notation using it, make E a 3x1 vector and, again, use vectorize, you get a solution.

Not sure about what you mean with only one equ would give a solution?

Concerning error catching you could turn the solve block into a parameterized function (whatever the input parameters would be) and create a new function using the "on error" statement to return NaN if the solve block function fails. See attached

But in your case it failed always because of kind bad syntax.

Attachments:
• 290 posts since
Feb 14, 2008
Currently Being Moderated
Jun 7, 2013 7:25 AM (in response to ptc-4397077)
Re: Possible to create iterative solve blocks?

If you make the solve blocks as parameterized functions you can calculate the 3 results.

if some of them don't converge to a solution there was a function "ReDefine" posted on this forum which takes a text string parameter.

if there is a variable of that name it returns the value, if not it returns  "Undefined" & this can be used in subsequent calculations.

Hope this is what you want

regards

Andy

Attachments:

#### More Like This

• Retrieving data ...

#### Legend

• Correct Answers - 3 points