Tidal Effect Simulation

Share you PDE file with our community
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Mar 14, 2013 5:26 am
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...
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Mar 14, 2013 1:07 pm
I think I can use the map() function to shift the range... this way I can stop banging my head and questioning myself... :)
User avatar
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL
PostPosted: Thu Mar 14, 2013 1:15 pm
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 ;)
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sat Mar 16, 2013 11:38 am
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.
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun Mar 17, 2013 2:05 pm
Doing the constrain badly...need to reload later tonight. Thank god for graphs! ;)
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun Mar 17, 2013 3:14 pm
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
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Mar 22, 2013 5:21 am
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.
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Fri Mar 22, 2013 3:55 pm
Yeah, map did not like a number between 0 and 1. I multiplied by 100 and then used that in the map function :)
User avatar
Posts: 5361
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Mar 25, 2013 1:28 pm
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

Posts: 12288
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Mon Mar 25, 2013 2:07 pm
Looks pretty cool :)
Roberto.
PreviousNext

Return to My PDE/INO file

Who is online

Users browsing this forum: No registered users and 2 guests

cron