Skip to main content
16-Pearl
June 14, 2020
Solved

Find() with indexing for "iteration"?

  • June 14, 2020
  • 2 replies
  • 2757 views

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

Best answer by Werner_E

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.

 

 

2 replies

23-Emerald IV
June 14, 2020

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

16-Pearl
June 14, 2020

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

23-Emerald IV
June 14, 2020

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

LucMeekes_0-1592146293656.png

 

Success!
Luc

Werner_E25-Diamond IAnswer
25-Diamond I
June 15, 2020

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.

 

 

16-Pearl
June 15, 2020

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}