Calculated Fields

by camel

Downloads: 23,692 (9) • Reviews: 4

Version:

1.2.9.4

Updated:

Apr 11, 2011

Calculated Fields plugin: Formulas pool

Postby camel » Wed Oct 27, 2010 12:22 pm

New build is available (1.2.5.5)

ChangeLog:
added formulas pool to dropdown menu
added halftime and halfdistance field in activity (you don't need dummy field for this now)
fixed potential culture problem within Range formula
added VO2 formulas
Added ACTIVERANGE formula, see examples in Range dropdown menu

some UI tweaks in settings page
and some other small changes

Enjoy
Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby HENNES » Wed Oct 27, 2010 12:32 pm

camel wrote:New build is available (1.2.5.5)


I was near to start complaining: 24hours no new version, no new formulas...
nearly getting a chance to catch up with everything here

:lol: :lol: :lol: :lol:
rgds hennes
- kickbiking with FR 305 and STs 3

runner´s map ... EURE Karte für Laufveranstaltungen - zum MITMACHEN!!!
http://www.runnersmap.info
...mehr als DREI TAUSEND Laufveranstaltungen!
HENNES
Donated!
Donated!
 
Posts: 1158
Joined: Thu Feb 07, 2008 1:55 am
Location: Duesseldorf, Germany

Postby camel » Wed Oct 27, 2010 12:49 pm

HENNES wrote:
camel wrote:New build is available (1.2.5.5)


I was near to start complaining: 24hours no new version, no new formulas...
nearly getting a chance to catch up with everything here

:lol: :lol: :lol: :lol:


Users are just never happy... ;)
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby Kuki » Wed Oct 27, 2010 2:17 pm

camel wrote:Users are just never happy... ;)

No, the users are happy. Every day new interesting functions, its like to open a nice christmascalendar, to push at the updatebutton every day. But the wifes are not happy and make trouble, because their husbands spent to much time before the computer, to enojy and play with the new functions. :wink:

Thanks for the new functions, and the new Vxx Values. I'm very interested in them, and it is nice now, to make them displayble in reports :D .

But please stop the developing of new interesting functions for 48 hours to rescue my marriage! :lol: :lol: :lol:



Thankyou very much; Kuki
Kuki
Donated!
Donated!
 
Posts: 25
Joined: Fri Feb 06, 2009 7:11 am

Postby Stumpjumper68 » Wed Oct 27, 2010 3:39 pm

Kuki wrote:
camel wrote:Users are just never happy... ;)

No, the users are happy. Every day new interesting functions, its like to open a nice christmascalendar, to push at the updatebutton every day. But the wifes are not happy and make trouble, because their husbands spent to much time before the computer, to enojy and play with the new functions. :wink:

Thanks for the new functions, and the new Vxx Values. I'm very interested in them, and it is nice now, to make them displayble in reports :D .

But please stop the developing of new interesting functions for 48 hours to rescue my marriage! :lol: :lol: :lol:



Thankyou very much; Kuki


Camel please don't stop I want to get rid of my wife :lol: :lol: :lol: :lol:
Image
Stumpjumper68
Donated!
Donated!
 
Posts: 1074
Joined: Thu Oct 11, 2007 3:39 pm
Location: Bad Vilbel, Germany

Postby emcotrina » Wed Oct 27, 2010 3:55 pm

Stumpjumper68 wrote:
Kuki wrote:
camel wrote:Users are just never happy... ;)

No, the users are happy. Every day new interesting functions, its like to open a nice christmascalendar, to push at the updatebutton every day. But the wifes are not happy and make trouble, because their husbands spent to much time before the computer, to enojy and play with the new functions. :wink:

Thanks for the new functions, and the new Vxx Values. I'm very interested in them, and it is nice now, to make them displayble in reports :D .

But please stop the developing of new interesting functions for 48 hours to rescue my marriage! :lol: :lol: :lol:



Thankyou very much; Kuki


Camel please don't stop I want to get rid of my wife :lol: :lol: :lol: :lol:


About to get rid of my husband, just waiting for the new version tomorrow.

:lol: :lol: :lol: :lol: :lol: :lol:
emcotrina
Donated!
Donated!
 
Posts: 89
Joined: Fri Jun 04, 2010 6:16 am

Postby gerhard » Wed Oct 27, 2010 4:26 pm

camel wrote:Or you could just ask Gerhard, if we can use formulas from Performance Predictor plugin source. It's open sourced, but to be honest when licences laws come to scene, I'm lost. So I'm not sure if we can use that.


camel, you basically have three options:
1. The formula is open, so it can be reused in CalculatedFields.
2. Both plugins are LGPL, so the code can be reused in CalculatedFields.
3. Call PP to get the data (new method needed). LGPL allows other plugins to call the binary, so also a non-LGPL plugin could call the plugin to get the data (a shared dll a for Trails should not be needed.

For 3: If you submit a patch, I will use it in PP. If you want me to provide the methods, it will likely take longer time.
gerhard
Contributor!
Contributor!
 
Posts: 1747
Joined: Mon Nov 27, 2006 7:07 pm
Location: Sweden

Postby Scorpion79 » Wed Oct 27, 2010 4:37 pm

camel wrote:New build is available (1.2.5.5)

ChangeLog:
added formulas pool to dropdown menu
added halftime and halfdistance field in activity (you don't need dummy field for this now)
fixed potential culture problem within Range formula
added VO2 formulas
Added ACTIVERANGE formula, see examples in Range dropdown menu

some UI tweaks in settings page
and some other small changes

Enjoy
Peter

the values from VO2 might be slightly off .. need some enhancement see:

when i calc the following:
10.50 km in 45:11
inet calc gives me vdot 47.85
perf predictor gives me: 47.9
we now calc 53.59

also the %vo2max is off
perf predictor: 90.6
calc: 80.97
Scorpion79
Donated!
Donated!
 
Posts: 78
Joined: Wed Apr 07, 2010 9:47 am

Postby PissedOffCil » Thu Oct 28, 2010 6:51 am

I don't think it's possible yet but I'd like the following formula. Roughly I'm looking for a decoupling factor but when I'm doing 2x20 workouts. So I have the workout in my Edge which goes along the following lines
- Warmup
- First 20min at 110%FTP
- Rest 5 min
- Second 20min at 110%FTP

I'd like to get the decoupling factor my comparing both 20min segments.

I'm not sure I can access both laps because I see no way of getting a lap per "number" or id. Maybe the best way to do this would be to use the notes field?

If I go into the more general, I also do 2x40 at FTP. So ideally, I would be able to find activities which have "2x" in their name, get the rest of the name to get segment length inm inutes, then find both segments of given length and get my decoupling factor from comparing those 2 segments. I would like 2 fields
1) Segment length
2) Number of repeats (I sometimes push a 3x20)
3) Decoupling factor using first and last segment

Possible?
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Thu Oct 28, 2010 11:40 am

PissedOffCil wrote:I don't think it's possible yet but I'd like the following formula. Roughly I'm looking for a decoupling factor but when I'm doing 2x20 workouts. So I have the workout in my Edge which goes along the following lines
- Warmup
- First 20min at 110%FTP
- Rest 5 min
- Second 20min at 110%FTP

I'd like to get the decoupling factor my comparing both 20min segments.

I'm not sure I can access both laps because I see no way of getting a lap per "number" or id. Maybe the best way to do this would be to use the notes field?

If I go into the more general, I also do 2x40 at FTP. So ideally, I would be able to find activities which have "2x" in their name, get the rest of the name to get segment length inm inutes, then find both segments of given length and get my decoupling factor from comparing those 2 segments. I would like 2 fields
1) Segment length
2) Number of repeats (I sometimes push a 3x20)
3) Decoupling factor using first and last segment

Possible?


Ok I will try to talk about it a little bit. And correct me if I'm wrong.

You have activity with:
Warmup (rest)
20min (active)
5min (rest)
20min (active)

And you want to have decoupling factor of first 20min active and seconds 20min active.
So this will work?
{DECOUPLINGRATIOACTIVE}
It takes only active parts of activity into calculation. But this will divide 40min by half distance. So perhaps it's not ok for you.

If you know how your training looks. You can just get time distance speed etc for exact split number easily with this formula:
{SPLITAVGPACE(2)}
{SPLITAVGPACE(4)}
etc see Splits drop down menu (just right click on expression textbox

So I think that you can construct formula for decoupling with this?
And you can create two formulas for same custom fields. And add conditions to calculate it from exact splits numbers based on name of your workout or some text in location.
So you will have one formula for 2x20
and another for 3x30 etc.

Or you need something more generic like to get ability to find all splits that are >= 19min and <= 21min etc?

I'll wait for feedback before more thinking ;)

Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby camel » Thu Oct 28, 2010 11:59 am

gerhard wrote:
camel wrote:Or you could just ask Gerhard, if we can use formulas from Performance Predictor plugin source. It's open sourced, but to be honest when licences laws come to scene, I'm lost. So I'm not sure if we can use that.


camel, you basically have three options:
1. The formula is open, so it can be reused in CalculatedFields.
2. Both plugins are LGPL, so the code can be reused in CalculatedFields.
3. Call PP to get the data (new method needed). LGPL allows other plugins to call the binary, so also a non-LGPL plugin could call the plugin to get the data (a shared dll a for Trails should not be needed.

For 3: If you submit a patch, I will use it in PP. If you want me to provide the methods, it will likely take longer time.


Thanks,
I think that it's no reason to add a new integration for something that is relative easy formula for plugin. So if it's not illegal. And formula will be not inside of plugin, it will be fully modificable.

I will just write formula for that with help of source of Performance Prediction plugin. Just to make sure that results will be same as in plugin.

Users please wait a moment if you want to see same results as in performance prediction plugin...

It will be there in some time. I can't yet release it now, some user's wifes will kill me, so I'm under pressure ...

:lol:
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby PissedOffCil » Thu Oct 28, 2010 12:06 pm

I consider a warmup as active so I can't use your formula. Plus I want it split by time and do the ratio of avg. power/ avg. HR.

What I figured from your post though is that the number in the splits argument is the split number. So I should be alright from here on since my segments are always splits 16, 18 or 20. With 2 formulas for the second segment I can do as I wish. First formula checks for lap 18 and validates with the note (.Contains("Second segment")), the second does the same on split 20.

It requires some notes editing though, I guess I could validate length but then it wouldn't require some tweaking to work withboth 20min & 40 min segmented workouts.

I'll post the results once I get them as I like.

Obviously, what comes to mind as an improvement is the ability to "script" formulas. It's a big load of work though but if one could define variables within a calculated field, then add conditional statement, loops and such it would be extremely powerful.

camel wrote:Ok I will try to talk about it a little bit. And correct me if I'm wrong.

You have activity with:
Warmup (rest)
20min (active)
5min (rest)
20min (active)

And you want to have decoupling factor of first 20min active and seconds 20min active.
So this will work?
{DECOUPLINGRATIOACTIVE}
It takes only active parts of activity into calculation. But this will divide 40min by half distance. So perhaps it's not ok for you.

If you know how your training looks. You can just get time distance speed etc for exact split number easily with this formula:
{SPLITAVGPACE(2)}
{SPLITAVGPACE(4)}
etc see Splits drop down menu (just right click on expression textbox

So I think that you can construct formula for decoupling with this?
And you can create two formulas for same custom fields. And add conditions to calculate it from exact splits numbers based on name of your workout or some text in location.
So you will have one formula for 2x20
and another for 3x30 etc.

Or you need something more generic like to get ability to find all splits that are >= 19min and <= 21min etc?

I'll wait for feedback before more thinking ;)

Peter
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Thu Oct 28, 2010 12:13 pm

Obviously, what comes to mind as an improvement is the ability to "script" formulas. It's a big load of work though but if one could define variables within a calculated field, then add conditional statement, loops and such it would be extremely powerful.


Remember that in fact formula is a one C# expression. (only fields {} are replaced with values taken from activity etc) So you can use ? : operator.
You can use lambdas in fact if you want. Only thing that's a little wrong that you can't use {} in expressions. Because I have used it for fields syntax.
(but if needed it could be changed but there will be a problem with backward compatibility a little)

But you have ability to do very much with lambdas. Of course that's not a thing for standard users. But scripts too...

But it's not a problem to add conditions to expressions etc..
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby PissedOffCil » Thu Oct 28, 2010 12:22 pm

You're right, using lamba would work, in fact nested expressions are lambda when you think of it. Interesting. I suppose we can also do recursive expressions!!!

Regarding conditions, I tried to have a double conditon this morning but had a crash. Is "&&" the right expresison for an AND? And "||" for an OR I guess?

camel wrote:Remember that in fact formula is a one C# expression. (only fields {} are replaced with values taken from activity etc) So you can use ? : operator.
You can use lambdas in fact if you want. Only thing that's a little wrong that you can't use {} in expressions. Because I have used it for fields syntax.
(but if needed it could be changed but there will be a problem with backward compatibility a little)

But you have ability to do very much with lambdas. Of course that's not a thing for standard users. But scripts too...

But it's not a problem to add conditions to expressions etc..
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Thu Oct 28, 2010 12:25 pm

PissedOffCil wrote:You're right, using lamba would work, in fact nested expressions are lambda when you think of it. Interesting. I suppose we can also do recursive expressions!!!

Regarding conditions, I tried to have a double conditon this morning but had a crash. Is "&&" the right expresison for an AND? And "||" for an OR I guess?

camel wrote:Remember that in fact formula is a one C# expression. (only fields {} are replaced with values taken from activity etc) So you can use ? : operator.
You can use lambdas in fact if you want. Only thing that's a little wrong that you can't use {} in expressions. Because I have used it for fields syntax.
(but if needed it could be changed but there will be a problem with backward compatibility a little)

But you have ability to do very much with lambdas. Of course that's not a thing for standard users. But scripts too...

But it's not a problem to add conditions to expressions etc..


Yes all is like in C#, because it's C# ;)

As far I'm remembering I have disallowed creating of recursive expressions.
But I'm not sure try it :)
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby PissedOffCil » Thu Oct 28, 2010 12:30 pm

camel wrote:As far I'm remembering I have disallowed creating of recursive expressions.
But I'm not sure try it :)


Even indirect recursion? Something like A->B->A?
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Thu Oct 28, 2010 12:55 pm

PissedOffCil wrote:
camel wrote:As far I'm remembering I have disallowed creating of recursive expressions.
But I'm not sure try it :)


Even indirect recursion? Something like A->B->A?


Yes now it's not enabled any recursion.

Do you have some special meaningfull application for recursion?

Just a note nested expressions are evaluated only at the end. In fact they are only macros.

Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby PissedOffCil » Thu Oct 28, 2010 1:17 pm

Ah that's why you disabled recursion. I'm not sure how you would setup a lambda expression then...

This syntax?
http://msdn.microsoft.com/en-us/library/bb397687.aspx

camel wrote:Just a note nested expressions are evaluated only at the end. In fact they are only macros.

Peter
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Thu Oct 28, 2010 1:28 pm

PissedOffCil wrote:Ah that's why you disabled recursion. I'm not sure how you would setup a lambda expression then...

This syntax?
http://msdn.microsoft.com/en-us/library/bb397687.aspx

camel wrote:Just a note nested expressions are evaluated only at the end. In fact they are only macros.

Peter


Hms it seems like a problem. I have used it with DataTrack features for linq.

Could you give me an example for what you need this advanced functions to get an idea what we need? Or how can it be done.

In theory I can imagine an concept of declaring of your functions etc in some new column on expressions or for whole calculated fields plugin.
And than use this functions in formula.

But to be honest this will be usable only for programmers.
So an example to create something usable will help.

Thanks
Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby PissedOffCil » Thu Oct 28, 2010 1:59 pm

camel wrote:Could you give me an example for what you need this advanced functions to get an idea what we need? Or how can it be done.


I have no idea what I could do with this, honestly. I'm just visualizing the possibilites.
Developer of the Garmin Fitness, Filtered Statistics and Distribution plugins
PissedOffCil
Donated!
Donated!
 
Posts: 1589
Joined: Sat Jul 05, 2008 9:18 pm
Location: Chicoutimi, Qc, Canada

Postby camel » Thu Oct 28, 2010 2:03 pm

PissedOffCil wrote:
camel wrote:Could you give me an example for what you need this advanced functions to get an idea what we need? Or how can it be done.


I have no idea what I could do with this, honestly. I'm just visualizing the possibilites.


Ok just invent something crazy whatever you want, and I will than get a look at that ;)
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby camel » Thu Oct 28, 2010 2:13 pm

Scorpion79 wrote:well i have an excell sheet which does a lot of calcualtions i don't get them completely

but what is listed is the following:

i had a 10k PB of 42:55 and for that it was calculated to have a VDOT 47.8

the formula in excel seems to be: (will edit later need to digg it out first)
what you post:
only there is also a value calculated being % of VO2max
(i will digg deeper :) )

Weight in kg VDOT Absolute VO2max
75 47.8 3.6 liters / min

Absolute VO2max (in Liters) = weight in kg x VDOT / 1000


Hmz I have tried to go to performance predictor plugin.

And the calculation from plugin for VO2Max looks like this:
0.8 + 0.1894393 * Math.Exp(-0.012778 * {TIME} / 60) + 0.2989558 * Math.Exp(-0.1932605 * {TIME} / 60)

And my calculations from daniels formula looks like this:
(0.8 + 0.1894393 * Math.Exp(-0.012778 * ({DISTANCE}/{TIME}*60)) + 0.2989558 * Math.Exp(-0.1932605 * ({DISTANCE}/{TIME}*60)))

But formula from that web page and from your excel looks like this:
VO2 Max=(-4.60 + 0.182258 * velocity + 0.000104 * velocity^2)/(0.8 + 0.1894393 * e^(-0.012778 * time) + 0.2989558 * e^(-0.1932605 * time))

So performance predictor is calculating it only with time.
And I'm calculating with speed.

So who is correct? That's a question...

Vdot calculation is same as in plugin in my plugin.
But it uses VO2Max in formula that is calculated differently so it's different too.

Peter
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

Postby mazoaguirre » Sat Oct 30, 2010 7:07 pm

idecoupling ratio works ok, but i have some old ones and several more recent without HR

there is a way to do same as decoupling but just with pace or speed?

thanks
FR 310 and Foot Pod, Edge 500 and Cadence Sensor, GoPro HD 960
mazoaguirre.com
mazoaguirre
Contributor!
Contributor!
 
Posts: 1005
Joined: Fri May 27, 2005 6:29 pm
Location: San Felipe "Torres Mochas" Guanajuato Mexico

Postby mazoaguirre » Sat Oct 30, 2010 7:53 pm

i am lost, trying to figureout with a formula to calculate de max elevation gain in 300 mts distnace

i try with {MAXPEAKDISTANCE(ASCENDING,300)}

but getting 0

i creates a field wih type number and summarize as sum
FR 310 and Foot Pod, Edge 500 and Cadence Sensor, GoPro HD 960
mazoaguirre.com
mazoaguirre
Contributor!
Contributor!
 
Posts: 1005
Joined: Fri May 27, 2005 6:29 pm
Location: San Felipe "Torres Mochas" Guanajuato Mexico

Postby camel » Sun Oct 31, 2010 12:55 am

mazoaguirre wrote:idecoupling ratio works ok, but i have some old ones and several more recent without HR

there is a way to do same as decoupling but just with pace or speed?

thanks


You have out of box formula for this:
{HALFSPEEDRATIO}

And it could be calculated with your manualy created formula if no.
camel
Donated!
Donated!
 
Posts: 363
Joined: Tue May 18, 2010 7:14 am
Location: Slovakia

PreviousNext

Return to Calculated Fields

Who is online

Users browsing this forum: No registered users and 1 guest