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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Find() with indexing for "iteration"?

JBlackhole
16-Pearl

Find() with indexing for "iteration"?

to all

 

I think I had an example of what I am attempting but lost hard drive a while ago means I have lost it.

I would like to use indexing in a Given block. Please see attached. Can this be done if so what is the correct mathcad 15 syntax?

Aim is to return a vector of solution for each index i

 

Thanks

Regards

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:JBlackhole)

Are you looking for something like this:

Werner_E_0-1592179461965.png

From your example it looked like you alwys want to use 1 as guess value for m and not the last m of the iteration. Therefore I also implemented it that way.

The values are not what you expected but I think the routine is doing what you demanded in your description.

 

 

View solution in original post

6 REPLIES 6
LucMeekes
23-Emerald III
(To:JBlackhole)

You can make the result of the Solve block a function, in your case that would be

msol(i), and then you replace in the first solve block 1=>i, and 2=>i+1

 

Success!
Luc

Thanks LucMeekes - Half-expected a reply from you 🙂

Not quite success I am afraid - I am sure I did something similar a looong time go but my memory is nearly totally gone

I am getting a "Unitless" issue

LucMeekes
23-Emerald III
(To:JBlackhole)

Your yv has only one element, you can't have j index that, same as xv.

LucMeekes_0-1592146293656.png

 

Success!
Luc

Thanks. But I had in mind the following once I have mj I can calculate vyj which is the starting for the next iteration 

j = 1 range xv1-xv2, find m1, calculate yv2

j = 2 range xv2-xv3, find m2 , calculate yv3

j = 3 range xv3-xv4, find m3 calculate yv4

Werner_E
25-Diamond I
(To:JBlackhole)

Are you looking for something like this:

Werner_E_0-1592179461965.png

From your example it looked like you alwys want to use 1 as guess value for m and not the last m of the iteration. Therefore I also implemented it that way.

The values are not what you expected but I think the routine is doing what you demanded in your description.

 

 

Thanks a lot for the input and programm. Not sure I would have figured out the coding. But looking at it makes sense and it's almost obvious.

Don't think the value for mguess make much of difference.

it's interesting that the m3 and m4 (to get yv3 and yv4) are not what I expect. Still a step in the right direction

Thanks a lot

 

[EDIT]. I can't type numbers! the values in variable ATarget are the cumlutative ara and not the area for each band as I wanted to enter. if one uses  Atarget={146.06, 360.62,250}T then the programm returns  yv={1,2,0.5,0.5}

Announcements

Top Tags