Grasshopper

algorithmic modeling for Rhino

hello, 

is it possible to solve an equation in grasshopper?

Views: 6656

Replies to This Discussion

I do not really understand how galapagos works. I need to solve an equation that is quite complicated, in my grasshopper definition and extract the result of the unknown value. Is it possible?

Why don't you post the equation or a link to the equation

in this equation all values are known except b. I would like to solve this equation and let grasshopper extract the b value.

thanks

What values do you have for h,w and u?

w=6

u=2

and h=a*b^2 where a = 0.001

Attachments:

I should say that for this equation Galapagos is a bit over the top as you only have to change one slider. you could do this yourself or use Hoopsnake (Which is a plug-in to grasshopper)

Where Galapagos comes into its own is when you have more than one unknown.

thank you very much. i'll test and let you know!

thanks

Interesting that this three year old thread was re-activated because I was about to post a related question that is alluded to in this thread, here:

Reply by Danny Boyes on April 26, 2012 at 4:13am
I should say that for this equation Galapagos is a bit over the top as you only have to change one slider. you could do this yourself or use Hoopsnake (Which is a plug-in to grasshopper)
Where Galapagos comes into its own is when you have more than one unknown.

QUESTION: Short of writing C, VB or Python, is there a FAST (binary search speed) GH way to "solve" toward a goal by "moving" a single slider?

CONTEXT:

I have a boat hull of a given displacement, at rest.  I rotate the hull to an arbitrary angle ("heel" caused by wind in the sails) and want to adjust a 'Z-offset' slider so the displacement is the same as it was at rest.

I can adjust the slider manually, zooming in for better control, and with a dozen tries or so, in a very short time, narrow in with a binary search method and get very close to matching the value.

When I hook up Galapagos, it runs on and on forever, trying values that are "obviously" further away instead of closer to the goal.

Binary search would be difficult for a problem like this, as it is not known how many solution and how many near-solutions there are. But I think there are no ways to do it now. One interesting option is to put the expression in the slider itself, then try and assign a value by double clicking and typing. the in-build resolver will try and get close, but the algorithm isn't particularly advanced. It's also hard to get the unmodified value out somehow.

The first solution within a specified degree of accuracy is the one I want, as fast as possible, and a binary search works fine for that, doesn't it?  It doesn't need to control a slider, they just happen to be handy for defining a range and precision of values.

Maybe I haven't configured Galapagos properly or maybe it's just not the right tool for this job.  When I can solve it manually faster than Galapagos, a different solution is needed.

Not sure I understand about putting the expression in the slider itself?

I want a FAST solution that doesn't need any manual input.  Ideally, it would respond like any other component and re-calc whenever its inputs changed.  A button click at most to start it, but prefer that isn't necessary.

This seems like a very common class of problem for GH, a single slider with direct (linear?) effect on "Fitness" for a solution, where a binary search can be assumed.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service