<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RE: Following/Develop a Matrix Through Nested Loops in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104843#M41316</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Richard, First thanks for replying, I was hoping you would respond. I will try to better explain what I am attempting to do, but let me address a couple of things. 1) It is good to know that you can not go back and forth between a NESTED loop and a main loop, it is a path I have been trying to go down for a while(no pun intended) with no success. I will make the loops parallel. 2) As far as the equations matching the unknowns, while it may not be very clear, I do only have 5 unknowns for each function as for function #1 lambda is const and â€œaâ€� is just a counter, and function #2 mlt is const, and again â€œaâ€� is the counter. â€œaâ€� is included in the solver function to load the matrix vector as each iteration is carried out, there is probably another way to do this but this seemed to be the easiest way. Loop Description: What you typed is essentially what I am trying to do. Although I would add that the values of K1 through K5 and lambda all need to be â€œrecordedâ€� in a matrix as it goes back and forth between Function1 and 2. Example: When Function1 is done solving, given a set of conditions, x number of vectors that are input into Matrix1, the last vector calculated acts as the initial vector to Function2 but ALSO all those values from the Function1 iteration are recorded in the same matrix as all the vectors calculated with Function2. The final output will be a matrix that has values that are a combo of values from function1 and 2. For instance â€œaâ€� represents the counter and vector(each vector is the 7 values I want to see as in work sheet) position in the matrix, so say for â€œaâ€� 1-250 you have Function1 values and for â€œaâ€� 251-389 you have function2 values, then 390-520 function1, 521-590 function2, so on and so forth until counter reaches limit. Your questions: repeat the loop until some condition is met? &lt;STRONG&gt;Yes until the counter is finished: â€œaâ€� reaches say 1440&lt;/STRONG&gt; Or are you just trying to loop through the values of Ks? &lt;STRONG&gt;No, Ks could be constant, but it is just a variable I control to manipulate the behavior of the solver functions. The number of Ks is definitely related to the total number of iterations I want the two Functions to go through, but is not controlling the loop start and stop.&lt;/STRONG&gt; Does all this make sense? I can try to clarify more, and again any help is appreciated. Best, HW&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Mar 2010 15:31:07 GMT</pubDate>
    <dc:creator>hw</dc:creator>
    <dc:date>2010-03-17T15:31:07Z</dc:date>
    <item>
      <title>Following/Develop a Matrix Through Nested Loops</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104841#M41314</link>
      <description>Greetings, I am trying to go back and forth between two loops that utilize two different solver functions, each of which, develop a matrix. My goal is to keep track of the data in one main matrix that is developed in each loop while also using the data from the final iteration of</description>
      <pubDate>Thu, 03 May 2018 19:39:38 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104841#M41314</guid>
      <dc:creator>hw</dc:creator>
      <dc:date>2018-05-03T19:39:38Z</dc:date>
    </item>
    <item>
      <title>RE: Following/Develop a Matrix Through Nested Loops</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104842#M41315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm sure that what you want to do is possible, but it's not clear to me what you want to do. You talk about going backward and forward between two loops, but also about nested loops. If they are nested you can't go backward and forward between them. Could you write out the sequence of what you want to happen. For example: Solve Function1 to get the parameters Start loop If some condition Use the parameters as input to Function2 Solve to get new parameters If some condition Use the parameters as input to Function1 Solve to get new parameters End Loop repeat the loop until some condition is met? Or are you just trying to loop through the values of Ks? Apart from not understanding what you want to do with the loop, there is a more serious problem. Your solve blocks have only 5 equations but you are trying to find 7 unknowns. The number of equations must match the number of unknowns. Richard&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 14:14:05 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104842#M41315</guid>
      <dc:creator>RichardJ</dc:creator>
      <dc:date>2010-03-17T14:14:05Z</dc:date>
    </item>
    <item>
      <title>RE: Following/Develop a Matrix Through Nested Loops</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104843#M41316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Richard, First thanks for replying, I was hoping you would respond. I will try to better explain what I am attempting to do, but let me address a couple of things. 1) It is good to know that you can not go back and forth between a NESTED loop and a main loop, it is a path I have been trying to go down for a while(no pun intended) with no success. I will make the loops parallel. 2) As far as the equations matching the unknowns, while it may not be very clear, I do only have 5 unknowns for each function as for function #1 lambda is const and â€œaâ€� is just a counter, and function #2 mlt is const, and again â€œaâ€� is the counter. â€œaâ€� is included in the solver function to load the matrix vector as each iteration is carried out, there is probably another way to do this but this seemed to be the easiest way. Loop Description: What you typed is essentially what I am trying to do. Although I would add that the values of K1 through K5 and lambda all need to be â€œrecordedâ€� in a matrix as it goes back and forth between Function1 and 2. Example: When Function1 is done solving, given a set of conditions, x number of vectors that are input into Matrix1, the last vector calculated acts as the initial vector to Function2 but ALSO all those values from the Function1 iteration are recorded in the same matrix as all the vectors calculated with Function2. The final output will be a matrix that has values that are a combo of values from function1 and 2. For instance â€œaâ€� represents the counter and vector(each vector is the 7 values I want to see as in work sheet) position in the matrix, so say for â€œaâ€� 1-250 you have Function1 values and for â€œaâ€� 251-389 you have function2 values, then 390-520 function1, 521-590 function2, so on and so forth until counter reaches limit. Your questions: repeat the loop until some condition is met? &lt;STRONG&gt;Yes until the counter is finished: â€œaâ€� reaches say 1440&lt;/STRONG&gt; Or are you just trying to loop through the values of Ks? &lt;STRONG&gt;No, Ks could be constant, but it is just a variable I control to manipulate the behavior of the solver functions. The number of Ks is definitely related to the total number of iterations I want the two Functions to go through, but is not controlling the loop start and stop.&lt;/STRONG&gt; Does all this make sense? I can try to clarify more, and again any help is appreciated. Best, HW&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 15:31:07 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104843#M41316</guid>
      <dc:creator>hw</dc:creator>
      <dc:date>2010-03-17T15:31:07Z</dc:date>
    </item>
    <item>
      <title>Follow a Matrix Through loops</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104844#M41317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I found a variable error in the previous attachment this new attachment is a correction. I also put the loops on the same level but still not getting Matrix that combines both functions. So again any help would be appreciated. Best, HW&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 04:33:02 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104844#M41317</guid>
      <dc:creator>hw</dc:creator>
      <dc:date>2010-03-18T04:33:02Z</dc:date>
    </item>
    <item>
      <title>RE: Follow a Matrix Through loops</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104845#M41318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class="jive-quote"&gt;&lt;P&gt;"Hogan Winn" wrote:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;&lt;P&gt;2) As far as the equations matching the unknowns, while it may not be very clear, I do only have 5 unknowns for each function as for function #1 lambda is const and â€œaâ€� is just a counter, and function #2 mlt is const, and again â€œaâ€� is the counter. â€œaâ€� is included in the solver function to load the matrix vector as each iteration is carried out, there is probably another way to do this but this seemed to be the easiest way.&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2010 16:07:51 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104845#M41318</guid>
      <dc:creator>RichardJ</dc:creator>
      <dc:date>2010-03-19T16:07:51Z</dc:date>
    </item>
    <item>
      <title>RE: Follow a Matrix Through loops</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104846#M41319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Richard thanks your simplification of the loop and conditional statements, much more eloquent. I apologize for the confusion, my conditional statements are weak, and I thought I could ask the question without fully realizing them. This probably made the point that l3 is constant in solve block 1 and K3 is variable, but in solve block 2 K3 becomes constant and l3 is variable, hard to understand. My conditional statements may still not be solid but, the question now is can I get the initial vector values with function 1 OUTSIDE the FOR loop. I just want to get those values once and then not use that function again without a conditional statement assigned to it, which is inside the FOR loop. I am trying to debug and I don't want this to influence results. I tried taking this initial evaluation out of the FOR loop but then I have issues with an invalid array index. Suggestions? I attached a rework that gets me in the function 1 then to the function 2, however it is still not behaving correctly. Namely l3 should approach 1 as function 2 is utilized, and when 1 is reached, the loop should toggle over to function 1. (the loop funct2test shows how funct2 works) So here is a summary of the logic I think can work: 1) Set initial vector with solve block function 1 calc FOR a set number of iterations 2) If l3b equal to 0 OR l3b equal to 1 Then calc solve block function 1 3) If K3b is greater or equal to mlt AND l3b is between 0 and 1, where l3b can equal 0 but less than 1 (if changed to less than and equal to 1 can see example how funct 1 goes to funct 2) Then calc solve block function 2 4) End Loop 5) Output cumulative Matrix. Thanks again, and let me know if this is still confusing. I think the attachment helps explain what I am trying to do. Also, on a side note, you seem to be very knowledgeable about MathCAD, would you have any suggestions as to where I could get some serious MathCAD training? Best Hogan&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2010 22:38:19 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Following-Develop-a-Matrix-Through-Nested-Loops/m-p/104846#M41319</guid>
      <dc:creator>hw</dc:creator>
      <dc:date>2010-03-19T22:38:19Z</dc:date>
    </item>
  </channel>
</rss>

