Generating a list of values

It might be a simpler method to use the “Partial Results” output values.



I got it wrong. What I actually need is the following. Let’s say we have an equation x+y=z, then for the next step z=x1, we have to get the second item to be equal to x1+y1=z1, then the next step z1=x2 and we plug it into x2+y2=z2 and so on. More or less like this: 1+2=3, 3+2=5, 5+4=9, 9+2=11. We have the y values already in a list and we need to generate the x values, where every next x is the result of the previous step.

How you generate x values if you have y values only?
Where is the first number of x values?

Give it any starting value.

use method of HS_Kim and add the starting value x0

Here is the actual problem. (10.5 KB)

The equation is Sqrt(2*(x+y*z)). We have a starting value for X = 0 and a list for Y and another one for Z. We must take the result from the first calculation and plug it back in toast a second X, then get the result and plug it back in as a third X and so on until the values for Y and Z end.

and where is y list? (11.3 KB)

what you need is not clear , you said : x+y=z, then for the next step z=x1, we have to get the second item to be equal to x1+y1=z
but in your definition you already have y values and x values

I need the value for X, initially 0, to change for every next calculation. Take the first values for X Y and Z, get result. Use the result as new X and the second items in the Y and Z lists for the second calculation, Get result, use it as a third X along with the third values from the lists for Y and Z and so on.

ok that totally different from your previous post because it is not just x+y=z

Yeah and it seems also I gave you the wrong equation. Here is the correct version of it all. (15.1 KB)

It seems I have to iterate the equation or something. Have no idea how to do that in grasshopper

i have a solution but i wait maybe someone give you a simple one
if no one help i will post it

I have one too… plug it all manually and I did it, but this is not neat. A big mess of wires. Works, but if the lists change numbers then there is a problem :smiley: I really hope there is a better way.

create it manually is not a solution, i use loop

I think thatis the only solution

My GIF was meant to be a joke, which seemed appropriate, I apologize if you read it any other way! (19.1 KB)

1 Like

Thank you Seghier! I have never worked with loops in grasshopper. I will play with this quite a bit. Again thank you and sorry for the messy input :slight_smile:

1 Like