<Guest26nakilon>
but I start doing it I get this https://dpaste.org/XhC49/slim -- is it impossible to monkey patch a refinement? or at least not in the way I do it?
<Guest26nakilon>
*in couple with, *that all add to the backtrace, *when I start -- sorry for typos
Guest26nakilon has quit [Quit: Client closed]
Rounin has quit [Ping timeout: 246 seconds]
Guest26nakilon has joined #ruby
Al2O3 has quit [Quit: I'm quitting, thanks for all the sharks.]
Ziyan has joined #ruby
John_Ivan has quit [Ping timeout: 276 seconds]
Guest26nakilon has quit [Quit: Client closed]
davidw has quit [Ping timeout: 246 seconds]
szkl has quit [Quit: Connection closed for inactivity]
desnudopenguino has quit [Ping timeout: 272 seconds]
desnudopenguino1 is now known as desnudopenguino
jpn has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.5]
twosuns has quit [Quit: ...]
s-liao-2000 has joined #ruby
gr33n7007h has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
henninb has quit [Ping timeout: 272 seconds]
jpn has quit [Ping timeout: 244 seconds]
jpn has joined #ruby
Aminda has quit [Quit: Default quit message is difficult to set. If you don't see me returning, ask me? You will find me, if you want to]
jpn has quit [Ping timeout: 246 seconds]
John_Ivan has joined #ruby
Aminda has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.5]
gr33n7007h has joined #ruby
gr33n7007h has quit [Client Quit]
Ziyan has joined #ruby
finsternis has quit [Ping timeout: 240 seconds]
finsternis has joined #ruby
gr33n7007h has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 246 seconds]
RickHull has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 248 seconds]
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 248 seconds]
<RickHull>
i've got a simple curve defined by around 10 points. it starts on the left with a y-value of zero. it goes up and to the right. then falls back to zero.
<RickHull>
i think it's "convex" -- it doesn't swerve sharply
<RickHull>
i think I can represent these 10 points with a function/equation instead. mostly for nice interpolation, where I can provide any x-value and get a corresponding y-val
jpn has joined #ruby
<RickHull>
some relevant terms: "curve fitting" "polynomial regression" "polynomial interpolation"
<RickHull>
not sure on a concrete approach. i think there is a relatively simple equation that describes my set of points. it's not like a scatter plot where a single x-value may have many different y-values (or in a cluster)
<RickHull>
a 10th order polynomial equation would be "guaranteed" to hit my 10 points on the nose, I think. but it would be very wiggly as I understand. not a good model. I'm guessing a good model will hit 50% of my points, and the rest will be very close
jpn has quit [Ping timeout: 246 seconds]
<Ziyan_>
RickHull : interesting... I haven't done that math in a long time... you trying to plot with Ruby?
<RickHull>
i'm simulating a motor with a torque curve. x-axis is RPM. y-axis is torque measurement
aeris has quit [Remote host closed the connection]
<RickHull>
in specifying a motor, you can specify the torque curve. provide torque values at various rpms
aeris has joined #ruby
<RickHull>
next, we need the torque at any given rpm, say 5109
<RickHull>
i'd like to have an equation that describes torque(rpm) given the original 10 points in the spec
<RickHull>
right now, i walk up the points and do linear interpolation in the gap
jpn has joined #ruby
naquad has joined #ruby
davidw has joined #ruby
<Ziyan_>
RickHull IIRC different interpolation algorithms have their strengths. I would take a few known torque curves and code a number of algorithms and see what makes it best. Given the form of the curve your described, I think Spline interpolation might be what you want. Its been a good 12 years since I worked with curves. Don't quote me on it.
<RickHull>
i don't care so much if the curve is a perfect description of reality. already, the curve provided in the form of 10-or-so points is very rough
<RickHull>
i don't want a user to have to specify a curve. just 5-15 points and then the curve is generated
<RickHull>
it looks to me like "cubic spline" is a good approach, just skimming things
<Ziyan_>
RickHull yes, I think so too. give it a try....
<Ziyan_>
That GEM is a little old though, hopefully runs on modern Rub, you may need to fork and update some code
<RickHull>
probably I'll just lift 10-20 lines, if I go that route
<Ziyan_>
Yah, that is simpler
___nick___ has joined #ruby
<Ziyan_>
RickHull may I ask what kind of website you are working on. These electric motors.