Page 4 of 6

Tidal Effect Simulation

PostPosted: Thu Mar 14, 2013 5:26 am
by lnevo
Hmmm...maybe I did want the range cut in half...probably...not sure now...oh well, play with it later :)

Edit: reverted the change in the code above...after re-looking at the math...

Re: Tidal Effect Simulation

PostPosted: Thu Mar 14, 2013 1:07 pm
by lnevo
I think I can use the map() function to shift the range... this way I can stop banging my head and questioning myself... :)

Re: Tidal Effect Simulation

PostPosted: Thu Mar 14, 2013 1:15 pm
by DrewPalmer04
lnevo wrote:I think I can use the map() function to shift the range... this way I can stop banging my head and questioning myself... :)


HATE when that happens ;)

Re: Tidal Effect Simulation

PostPosted: Sat Mar 16, 2013 11:38 am
by lnevo
Modified the above code with the map function which looks to be working good in my test executable. Should be good. We'll see how test goes.

Tidal Effect Simulation

PostPosted: Sun Mar 17, 2013 2:05 pm
by lnevo
Doing the constrain badly...need to reload later tonight. Thank god for graphs! ;)

Re: Tidal Effect Simulation

PostPosted: Sun Mar 17, 2013 3:14 pm
by lnevo
Yep... was actually doing the constrain twice and amplitude starts out -1 to 1. So... didn't need it.

Code modified in viewtopic.php?p=22049#p22049

Tidal Effect Simulation

PostPosted: Fri Mar 22, 2013 5:21 am
by lnevo
I think the map function is not working as written. Hard to tell since based on current MoonPhase we should be close to minimum which I am, but I've seen no change... In any event, I plan on doing some debug tonight to confirm the values Im getting.

Re: Tidal Effect Simulation

PostPosted: Fri Mar 22, 2013 3:55 pm
by lnevo
Yeah, map did not like a number between 0 and 1. I multiplied by 100 and then used that in the map function :)

Re: Tidal Effect Simulation

PostPosted: Mon Mar 25, 2013 1:28 pm
by lnevo
So, I wanted to post some charts of that show the usage of the simulation.

Here is the graph of the default curve coming out of CalcTide() function. You can see that the high/low marks before Mar 25 are just slightly less than today's. This will continue to grow till we hit full moon.
Image

Here you can see the change of incoming/outgoing tide. I use the following code to address either channel 0 or channel 1 of my vortech pumps. I do the slower pump first so that RFS shows the higher value :)
Code: Select all
  ReefAngel.RF.SetMode(Custom,rcSpeedAS,tide.isOutgoing());
  ReefAngel.RF.SetMode(Custom,rcSpeed,tide.isIncoming());

Image

Here's the speed that my tide class is set to. You can see my transition to night mode around the 9pm and 10am marks.
Code: Select all
  tide.SetSpeed(PWMSlope-1(sl.GetRiseHour(),sl.GetRiseMinute(),
    sl.GetSetHour(),sl.GetSetMinute(),vtNightSpeed,vtSpeed,120,vtNightSpeed));

Image

And finally, the moment we've been building up to. This is the end result of the speed my vortech's are being set to. This is with the ReefCrest function applied to it. You could use whichever mode you wanted and feed the result similarly. The anti-sync output is applied to the second pump. That is the second graph.
Code: Select all
  int rcSpeed=ReefCrestMode(tide.CalcTide(),vtDuration,true);

Image
Currently the anti-sync pump is running at 70% of the main pump. The pumps switch roles during the switch from high toward low tide and vice-versa.
Code: Select all
  int rcSpeedAS=ReefCrestMode(tide.CalcTide(),vtDuration,false)*pumpOffset;

Image

Re: Tidal Effect Simulation

PostPosted: Mon Mar 25, 2013 2:07 pm
by rimai
Looks pretty cool :)