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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Iterating with Solver again

hw
1-Newbie
1-Newbie

Iterating with Solver again

Greetings,

I have read over the previous topics involving iterations using the solver and none seem to shed any light.
I do know how to both define the solver block as a function and how to do a parametric analysis using a matrix of input which yields nested arrays. This is a start however I am specifically trying to use the results from the solver block to redefine the initial values.
I thought I could accomplish this with a loop that redefines the initial values but no luck.

Any advice? Is this even possible using MC 14?
best
hw
16 REPLIES 16
ptc-1368288
1-Newbie
(To:hw)

On 1/20/2010 10:12:04 PM, hw wrote:

" ... topics involving iterations using the solver and none seem to shed any light."

==> The collab search engine is dead and you may have found little.
==> Please, don't stick with "know how" just in case it is erroneous.

>however I am specifically trying to use the results from the solver block to redefine the initial values.
I thought I could accomplish this with a loop that redefines the initial values but no luck.

Any advice? Is this even possible using MC 14?
best
hw <<br>
____________________

"Save as" version 11, attach. So that 14 & 11 users can try.
Given/Find" in general is a linear programming module, it does seed itself unless some numerical subfunctions have to restart from the base, like the integrator. For the root( , , , ), the seeded root solver work fine like a bomb.

jmG

Erratum: Given/Find does not seed itself.

Sorry ! jmG
TomGutman
1-Newbie
(To:hw)

You cannot loop at the worksheet level, only within a single program structure. So if the guess values for find are to vary, you must pass them as parameters to the function defined using find.
__________________
� � � � Tom Gutman

On 1/21/2010 2:03:30 AM, Tom_Gutman wrote:
>You cannot loop at the
>worksheet level, only within a
>single program structure. So
>if the guess values for find
>are to vary, you must pass
>them as parameters to the
>function defined using find.
>__________________
>� � � � Tom Gutman
_____________________________

Yes, you can at the work sheet level outside of the programme structure in the example supplied. No guesses are needed.

jmG
RichardJ
19-Tanzanite
(To:hw)

On 1/20/2010 10:12:04 PM, hw wrote:

>Any advice?

You can do what you want if you pass the guess values as parameters.

It might be possible to give a better answer if you post the worksheet.

>Is this even
>possible using MC 14?

Yes.

Richard


hw
1-Newbie
1-Newbie
(To:hw)

Thank you all for you initial comments. I have attached a MCD v11 file of the problem I am dealing will.



I have the solution block function running with both a MathCAD range variable and as a loop. Both provide the same solution for a parametric analysis. My goal however, as I tried to state before, is to redefine for each iteration of the parameters to also redefine the initial values.

Read comments at the end of the worksheet for specifics.



Also, I did not post the attempts to define the solver block function in terms of the initial values because I could not get it to work and perhaps may confuse what I am trying to accomplish.



I look forward to your comments.

hw
RichardJ
19-Tanzanite
(To:hw)

Like this.

Richard
RichardJ
19-Tanzanite
(To:RichardJ)

Oops. There's a definition for a variable called T1a_to_T10a in there. It's just a useless leftover I forgot to delete.

Richard
hw
1-Newbie
1-Newbie
(To:RichardJ)

Fantastic! I thought I tried that way but could not get it to work, nice to know I was at least looking down the right path.
I appreciate your help.
hw
ptc-1368288
1-Newbie
(To:hw)

On 1/21/2010 2:08:39 PM, hw wrote:
>Fantastic! I thought I tried
>that way but could not get it
>to work, nice to know I was at
>least looking down the right
>path.
>I appreciate your help.
>hw
_______________________________

Before "looking down the right path",
you missed the fact that for mutlisolutions, like you have 0 ... 8, Mathcad nests the solutions. This is the basis of the Mathcad solver structure. Then you just need to Unstack(N).

The matrix approach leaves the solutions in a row-vector of nests and the project is incomplete in the sense of a data table.

jmG
hw
1-Newbie
1-Newbie
(To:ptc-1368288)

jmg,
You are one step ahead, that was my next endeavor "how do I get usuable data from the nested arrays"
Thanks!
hw
RichardJ
19-Tanzanite
(To:hw)

Since you created a nested array, I assumed that's what you wanted. If you don't want that then the best solution is to not create it in the first place.

Richard
hw
1-Newbie
1-Newbie
(To:RichardJ)

Even easier. Learning a lot about the nested array and how the solver block actually works.
thanks again,
hw
ptc-1368288
1-Newbie
(To:hw)

On 1/21/2010 7:31:14 PM, hw wrote:
>Even easier. Learning a lot
>about the nested array and how
>the solver block actually
>works.
>thanks again,
>hw
_______________________________

There are many ways of structuring "projects"
The Unstack(N) is for the more modular ways.
It leaves the project more visible, my way.
Often, Unstack(N) is an "incontournable".
Modularity reduces the time spent to design.
Modularity helps new Mathcaders.

jmG






hw
1-Newbie
1-Newbie
(To:ptc-1368288)

Yep, I see the benefits of both "ways". A real help for this new mathcad-er.
hw
ptc-1368288
1-Newbie
(To:hw)

On 1/21/2010 12:00:51 PM, hw wrote:
>Thank you all for you initial
>comments. I have attached a
>MCD v11 file of the problem I
>am dealing will.

...
>I look forward to your comments.
hw
________________________

Simpler and direct [Yellow, Cyan],
because this solver nests the solutions.
The conversion from 13 to 11 scraped it.
Plug the yellow Unstack(N) at the top of the sheet.

jmG



Announcements

Top Tags