You can subscribe to this list here.
2008 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}
(5) 
_{Oct}
(39) 
_{Nov}
(277) 
_{Dec}
(299) 

2009 
_{Jan}
(261) 
_{Feb}
(162) 
_{Mar}
(70) 
_{Apr}
(141) 
_{May}
(55) 
_{Jun}
(166) 
_{Jul}
(202) 
_{Aug}
(122) 
_{Sep}
(368) 
_{Oct}
(290) 
_{Nov}
(232) 
_{Dec}
(516) 
2010 
_{Jan}
(302) 
_{Feb}
(253) 
_{Mar}
(253) 
_{Apr}
(184) 
_{May}
(184) 
_{Jun}
(82) 
_{Jul}
(62) 
_{Aug}
(154) 
_{Sep}
(331) 
_{Oct}
(450) 
_{Nov}
(312) 
_{Dec}
(249) 
2011 
_{Jan}
(252) 
_{Feb}
(286) 
_{Mar}
(175) 
_{Apr}
(175) 
_{May}
(194) 
_{Jun}
(130) 
_{Jul}
(211) 
_{Aug}
(340) 
_{Sep}
(150) 
_{Oct}
(398) 
_{Nov}
(572) 
_{Dec}
(199) 
2012 
_{Jan}
(458) 
_{Feb}
(378) 
_{Mar}
(332) 
_{Apr}
(385) 
_{May}
(228) 
_{Jun}
(188) 
_{Jul}
(199) 
_{Aug}
(336) 
_{Sep}
(349) 
_{Oct}
(271) 
_{Nov}
(61) 
_{Dec}
(155) 
2013 
_{Jan}
(230) 
_{Feb}
(302) 
_{Mar}
(350) 
_{Apr}
(162) 
_{May}
(118) 
_{Jun}
(209) 
_{Jul}
(75) 
_{Aug}
(94) 
_{Sep}
(32) 
_{Oct}
(92) 
_{Nov}
(276) 
_{Dec}
(84) 
2014 
_{Jan}
(36) 
_{Feb}
(50) 
_{Mar}
(16) 
_{Apr}
(32) 
_{May}
(61) 
_{Jun}
(233) 
_{Jul}
(37) 
_{Aug}
(13) 
_{Sep}
(23) 
_{Oct}
(38) 
_{Nov}
(52) 
_{Dec}
(34) 
2015 
_{Jan}
(9) 
_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 



1
(3) 
2
(1) 
3

4

5
(1) 
6
(1) 
7
(1) 
8
(2) 
9
(4) 
10
(1) 
11

12
(5) 
13
(8) 
14
(2) 
15
(7) 
16
(2) 
17

18
(5) 
19
(7) 
20
(10) 
21
(9) 
22

23
(1) 
24
(4) 
25
(2) 
26
(4) 
27
(1) 
28
(1) 
29

30




From: W.D. Beelitz <wdb@wd...>  20100621 20:35:10

Hello Christos, no, it works fine without ;). The changes in rads are very small, so from time step to time step it never has to go more than one step back or forward (The min. delta rads in an interval is 500). Regards WolfDieter Ursprüngliche Nachricht Von: Christos Dimitrakakis [mailto:olethros@...] Gesendet: 21 June 2010 22:31 An: W.D. Beelitz Cc: speeddreamsdevel@... Betreff: Re: AW: [Speeddreamsdevel] Optimization of calculation of torque from rads On 21/06/10 20:44, W.D. Beelitz wrote: > Hello Christos, > > here a simple replacement for CalculateTorque in simuV3. > I think you are missing a for or while loop here. See drivers/bt/spline.cpp for an example. 
From: Christos Dimitrakakis <olethros@fa...>  20100621 20:25:29

On 21/06/10 20:44, W.D. Beelitz wrote: > Hello Christos, > > here a simple replacement for CalculateTorque in simuV3. > I think you are missing a for or while loop here. See drivers/bt/spline.cpp for an example. 
From: Christos Dimitrakakis <olethros@fa...>  20100621 20:21:00

On 21/06/10 14:06, W.D. Beelitz wrote: > Hello Christos, > > sorry but based on your proposal I would use: > >> 1. Assume we have r_1, ..., r_n rpm points with values T_1, ..., T_n. >> 2. Let r be the last rpm value and [r_i, r_j] be the smallest interval > containing r (i.e. so that j = i + 1) >> 3. Let r' be the current rpm value. > 4. If r'> r_j, do a binary search on the interval [r_j, r_n] > else if r'< r_i do a binary search on the interval [r_1,r_i] > else interpolate T' in [r_i, r_j] at r'. Yes, correct. > > 5. Obtain a new interval [r'_i, r'_j]. > > And caused by the context I would expect that if r'> r_j the resulting > interval will be [r_j, r_j+1] > and for r'< r_i [r_i1, r_i]. > > So for r' r< eps we should look at previous/next interval if not the > current interval matches. OK. But what if r'  r< eps and we don't find r' in the previous/next interval? > For r' r> eps we should use the binary search as described above. Well, not really. If the interval is not contained in previous/next then we should look at either [r_1, r_{i1}] or [r_{j+1}, r_n]. > Having no r we should use the binary search on the interval [r_1,r_n]. > OK, but the binary search should be in either [r_1, r_i] or [r_j, r_n] (with i1/j+ 1 if we have already searched previous/next intervals). > Regards > > WolfDieter > > Ursprüngliche Nachricht > Von: Christos Dimitrakakis [mailto:olethros@...] > Gesendet: 21 June 2010 09:31 > An: speeddreamsdevel@... > Betreff: Re: [Speeddreamsdevel] Optimization of calculation of torque from > rads > > On 21/06/10 09:21, Christos Dimitrakakis wrote: >> On 21/06/10 07:46, W.D. Beelitz wrote: >>> The value of rpms is changing "slowly" in most cases. > > PS2. So, the ideal way to implement this is as follows: > > 1. Assume we have r_1, ..., r_n rpm points on the spline, with values > T_1, ..., T_n. > 2. Let r be the last rpm value and [r_i, r_j] be the smallest interval > containing r (i.e. so that j = i + 1) > 3. Let r' be the current rpm value. > 4. If r'> r, do binary search on the interval [r_i, r_n], > else do binary search on the interval [r_1, r_j]. > 5. Obtain a new interval [r'_i, r'_j]. > > As you can see, this reduces computation by a factor of 2. So, original > complexity: O(n), binary search O(log n), and this O(log sqrt(n)). > > Again, I wouldn't do a linear search because once the number of points n > increases, the amount of search increases with rate O(n). > > >  >  > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeekpromo > _______________________________________________ > Speeddreamsdevel mailing list > Speeddreamsdevel@... > https://lists.sourceforge.net/lists/listinfo/speeddreamsdevel > > > > 
From: W.D. Beelitz <wdb@wd...>  20100621 18:45:15

Hello Christos, here a simple replacement for CalculateTorque in simuV3. tdble CalculateTorque2 (tEngine* engine, tdble rads) { //double StartTimeStamp = RtTimeStamp(); // To get used time tEngineCurve *curve = &(engine>curve); int i = engine>lastInterval; // Get last interval, is set to 0 at config engine tdble Tq; tdble rpm_min = curve>data[i].rads; // Current lower limit tdble rpm_max = curve>data[i+1].rads; // Current upper limit tdble alpha; // Ratio between limits if (rads > rpm_max) { if (i < engine>curve.nbPts) { rpm_min = rpm_max; engine>lastInterval = ++i; rpm_max = curve>data[i+1].rads; } } else if (rads < rpm_min) { if (i > 0) { rpm_max = rpm_min; engine>lastInterval = i; rpm_min = curve>data[i].rads; } } alpha = (rads  rpm_min) / (rpm_max  rpm_min); Tq = (float)((1.0alpha) * curve>data[i].Tq + alpha * curve>data[i+1].Tq); //SimTicks2 += RtDuration(StartTimeStamp); // To get used time return Tq; } The ratio of time consumed: CalculateTorque = 2.5 * CalculateTorque2. Regards WolfDieter Ursprüngliche Nachricht Von: Christos Dimitrakakis [mailto:olethros@...] Gesendet: 21 June 2010 09:31 An: speeddreamsdevel@... Betreff: Re: [Speeddreamsdevel] Optimization of calculation of torque from rads On 21/06/10 09:21, Christos Dimitrakakis wrote: > On 21/06/10 07:46, W.D. Beelitz wrote: >> The value of rpms is changing "slowly" in most cases. PS2. So, the ideal way to implement this is as follows: 1. Assume we have r_1, ..., r_n rpm points on the spline, with values T_1, ..., T_n. 2. Let r be the last rpm value and [r_i, r_j] be the smallest interval containing r (i.e. so that j = i + 1) 3. Let r' be the current rpm value. 4. If r' > r, do binary search on the interval [r_i, r_n], else do binary search on the interval [r_1, r_j]. 5. Obtain a new interval [r'_i, r'_j]. As you can see, this reduces computation by a factor of 2. So, original complexity: O(n), binary search O(log n), and this O(log sqrt(n)). Again, I wouldn't do a linear search because once the number of points n increases, the amount of search increases with rate O(n).   ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeekpromo _______________________________________________ Speeddreamsdevel mailing list Speeddreamsdevel@... https://lists.sourceforge.net/lists/listinfo/speeddreamsdevel 
From: W.D. Beelitz <wdb@wd...>  20100621 12:06:58

Hello Christos, sorry but based on your proposal I would use: > 1. Assume we have r_1, ..., r_n rpm points with values T_1, ..., T_n. > 2. Let r be the last rpm value and [r_i, r_j] be the smallest interval containing r (i.e. so that j = i + 1) > 3. Let r' be the current rpm value. 4. If r' > r_j, do a binary search on the interval [r_j, r_n] else if r' < r_i do a binary search on the interval [r_1,r_i] else interpolate T' in [r_i, r_j] at r'. 5. Obtain a new interval [r'_i, r'_j]. And caused by the context I would expect that if r' > r_j the resulting interval will be [r_j, r_j+1] and for r' < r_i [r_i1, r_i]. So for r' r < eps we should look at previous/next interval if not the current interval matches. For r' r > eps we should use the binary search as described above. Having no r we should use the binary search on the interval [r_1,r_n]. Regards WolfDieter Ursprüngliche Nachricht Von: Christos Dimitrakakis [mailto:olethros@...] Gesendet: 21 June 2010 09:31 An: speeddreamsdevel@... Betreff: Re: [Speeddreamsdevel] Optimization of calculation of torque from rads On 21/06/10 09:21, Christos Dimitrakakis wrote: > On 21/06/10 07:46, W.D. Beelitz wrote: >> The value of rpms is changing "slowly" in most cases. PS2. So, the ideal way to implement this is as follows: 1. Assume we have r_1, ..., r_n rpm points on the spline, with values T_1, ..., T_n. 2. Let r be the last rpm value and [r_i, r_j] be the smallest interval containing r (i.e. so that j = i + 1) 3. Let r' be the current rpm value. 4. If r' > r, do binary search on the interval [r_i, r_n], else do binary search on the interval [r_1, r_j]. 5. Obtain a new interval [r'_i, r'_j]. As you can see, this reduces computation by a factor of 2. So, original complexity: O(n), binary search O(log n), and this O(log sqrt(n)). Again, I wouldn't do a linear search because once the number of points n increases, the amount of search increases with rate O(n).   ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeekpromo _______________________________________________ Speeddreamsdevel mailing list Speeddreamsdevel@... https://lists.sourceforge.net/lists/listinfo/speeddreamsdevel 
From: Christos Dimitrakakis <olethros@fa...>  20100621 07:29:42

On 21/06/10 09:21, Christos Dimitrakakis wrote: > On 21/06/10 07:46, W.D. Beelitz wrote: >> The value of rpms is changing "slowly" in most cases. PS2. So, the ideal way to implement this is as follows: 1. Assume we have r_1, ..., r_n rpm points on the spline, with values T_1, ..., T_n. 2. Let r be the last rpm value and [r_i, r_j] be the smallest interval containing r (i.e. so that j = i + 1) 3. Let r' be the current rpm value. 4. If r' > r, do binary search on the interval [r_i, r_n], else do binary search on the interval [r_1, r_j]. 5. Obtain a new interval [r'_i, r'_j]. As you can see, this reduces computation by a factor of 2. So, original complexity: O(n), binary search O(log n), and this O(log sqrt(n)). Again, I wouldn't do a linear search because once the number of points n increases, the amount of search increases with rate O(n). 
From: Christos Dimitrakakis <olethros@fa...>  20100621 07:21:47

On 21/06/10 07:46, W.D. Beelitz wrote: > The value of rpms is changing "slowly" in most cases. PS. As you increase the number of points on the curve, then starting from the last used point does not help, since there can be arbitrarily many points between the new and last RPM value. So you'd only expect the 'last point' to give you, at best, a constantfactor speedup. 
From: Christos Dimitrakakis <olethros@fa...>  20100621 07:19:49

On 21/06/10 07:46, W.D. Beelitz wrote: > The value of rpms is changing "slowly" in most cases. Sure, you could do that and it might save a bit of time (though binary search already saves a lot). You'd need to start your binary search from the previous point. That would require modifying the search a little bit. This is only important as long as we are talking about torque curves with 100s of points though, really. :) 
From: W.D. Beelitz <wdb@wd...>  20100621 05:47:00

Hello Christos, what about starting with the last used segment of the torque characteristic? The value of rpms is changing "slowly" in most cases. Regards WolfDieter Ursprüngliche Nachricht Von: Christos Dimitrakakis [mailto:olethros@...] Gesendet: 20 June 2010 22:15 An: speeddreamsdevel@... Betreff: Re: [Speeddreamsdevel] Optimization of calculation of torque from rads For the torque curve, the best thing to do would be to reuse the spline code, which does a binary search.   ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeekpromo _______________________________________________ Speeddreamsdevel mailing list Speeddreamsdevel@... https://lists.sourceforge.net/lists/listinfo/speeddreamsdevel 