Saturday, May 31, 2014

Deriving the Tornado Differential Equations





TORNADO DIFFERENTIAL EQUATIONS


Introduction

Many have asked me where the TDE, Tornado Differential Equations came from. In other words, they want to know how I derived them, so today I will do just that.

The entire purpose of the TDE's is to create a formula set that can describe a tornado or vortex without looking at its destruction. The Fukishima scale is nice, but it evaluates tornadoes based on their destruction, so it cannot be analyzed prior to impact, an ability which could save lives.
 Lets setup a few things first:
The X and Y equations must work in conjuction to create a circle, because if they are written incorrectly, they will create a Lorenz system.

You may wonder why not simply define x and y as:
(i.e. as a circle) and just make z=z and entirely eliminate the need for Diffs. Well the equation set written below will create an equation which will become unstable at extrema omnicron values( a system which I will describe towards the end of this entry). Tornadoes are also unstable when certain factors are strong enough:
Here is a .75 Omnicron core, which was built in a tornado simulator that I developed and may post about later on..75 is optimal, both from a physical and TDE solution standpoint.

Setup
We are going to have three coordinate variables and one for time. Time will simply step through numbers so we can say:

t=0...n

So this will be a 4 dimensional Diff but lets start with x and ẋ.

We need the x to rotate(curve) so:
ẋ=x+y
because the slope of the x axis is now t the y coordinate and the x coordinate combined we will have a curving bottom.

However now we need to fix the other direction so:
=x+y or =-x+y
but we need this to tornado to curve upwards as a function of either x or y. In order to do this we must add in a z term.

Thats easy enough:

=-x+y+z

 and to decrease the turning radius of the tornado we can add an xz term:
=-x+y+z+xz
so y turns tighter as you climb and turn, which competes with the ẋ equation.
Now it's z's turn, Tornadoes curve outwards in a parabolic fashion:
ż=-xy
but if we add a z term into the right hand side of numerator, we can keep all three equations as first order ODE's and acheive a faster curve because of the integration step used for solving ODE's:
ż=z-xy
Groovy, with that done we now have a framework for our ODE's, and we can begin solving for our coefficients of stability, which is a very important step.

To Summarize the previous step, and place all the space equations in a matrix we have:

Selecting the Input Variable

The goal of having a dynamic parameter within the TDE is to allow for simple manipulation of the equations by simply entering a number as a constant or coefficient. To determine the placement examine the equations and a vortex. Note that a vortex has a direct relationship between radius r at a height h, therefore we must simultaneously relate all three variables. However the equations are connected, each is solved by another, therefore we need modify only one equation. The equation contains only 2 variables(3 or 4 if you count the derivative and if you split dt and dx); therefore it is the natural choice for modification. All we need to do is simply place a coefficient, Ο, omnicron, in front of x because increasing this right hand expression, will increase dy which in turn decreases dz which causes the rate of height change to slow as the radius r becomes larger. Thus our tornado graph will be inverted but this is simply an aesthetic problem which is of no real concern.
Coefficients and Constants of Stability

The TDE Matrix


x=x-.5yy-(x^O)/O
Therefore as x increases it simultaneously decreases, as does y. The 3==>> x , and if 0<O<1, than:
is a graph of this( (x^O)/O) term as O is increased, therefore a user can drastically modify the tornado dynamics.
Our y and x term are related and create the vortex, so modifying one effects the other, therefore signs and magnitudes of coefficients are very important.

We need the Y to be heavy reliant on X and therefore:

=-2x+y+z+xz, because with Lorenz type system small coefficients lead to higher stability. The .01 y term is not irrelevant because of its, small magnitude, without it the X and XZ terms would be over powered, and the sinusoidal motion of the tornado would not occur. The xz term can be left with a 1 times multiplier, it is in the equation to assure that y is related to z and x, and by multiplying the two we achieve an exponential growth of the radius with respects to altitude. The Z term is kept small, but larger than the y term to place more emphasis on z in increasing y than on x, however x acts as a limiter of this exponentiation because its differential is not directly related to z.

Z is highly important, it allows for z to decrease exponentially as z is increased, and ensures that the increase in radius out paces the increase in height which achieves this effect:


Other Coefficients
There are coefficients within the equation that I have not yet shown a derivation for, these were discovered through experimentation with the Tornado simulator. In the following section I will demonstrate the Tornado Simulator and provide a synopsis of how these experiments lead to coefficients and constants.
Data and Analysis
The following data lists are explained in the presentation which follows them:

Core Diameters
19
15
56
23.3
23
118
91.4
30.8
30.4
42
80.1
75.1
52
48.3
102
28
Average= 52.15 pixels

Supersonic Blast destruction Method Data:

201.3 x of ellipse
78.1 pixels on y of ellipse
142 pixel blast length
35 pixel width of cone base

Supersonic Ellipse Evaluation Method:

Time(Minutes) and temperature(Celsius) in tornadoes center showing the cooling effect of the low pressure zone as well as the introduction of air.
121.06
221.06
321.06
419.81
519.88
619.88
719.88
819.88
919.88
1019.81
1119.81
1219.75
1319.75
1419.75
1519.75
1619.75
1719.69
1819.75
1919.69
2019.69
2119.69
2219.69
2319.69
2419.69
2519.69
2619.69
2719.69
2819.69







Graphs of Each Function:(X,Y,Z)




Wednesday, May 28, 2014

IMG Grabber for syllipsi.jar

Grabs the lines containing the HTML image attribute, built to go inside of Syllipsi.jar that I debuted in the previous post.

String Minor="<img";
String imgsieve[]= loadStrings("http://www.google.com");
String stringcheese;
String yeah="img.txt";
println(imgsieve.length);
for (int i = 0 ; i < imgsieve.length; i++) {
      stringcheese= imgsieve[i];
  if (stringcheese.indexOf(Minor) !=-1){

  println(imgsieve[i]);
 saveStrings(yeah,imgsieve);

  }
}
String stringcheese is used as a string variable to overcome some args

Cuts down the google home page to 4 lines but this doesn't cut out the excess from long lines of html strings, for example strings can be read much longer than the img section of the HTML, but this fix is included in Syllipsi.jar and will be explained later.

Quick Jar HTML Grab for url with save: Syllipsi.jar

Real quick post today, about a little JAR application I created using Processing's URL and String capabilities. Syllipsi quickly grabs the HTML and saves it to the directory of your choice, its currently just for windows, but Linux and Mac users can copy the source that comes embedded. This quickly and easily copies and saves web page HTML, more so than traditional browser based methods.


Type the URL of your choice. Do not include http:// or https:// ; once you have this filled out just press enter to proceed to the Save Dialog Box



Select the output file, should be a plain text file.

Comment below to ask for a copy of the JAR, I will soon be adding an image grabber to the bundle, as well as a text grabber.


Saturday, May 24, 2014

Voodoo Example

// Example

legend-video
#stp
set-video
/#
#drw
iffy (glamcam.available()) {
draw-video
done

/#


This code is written in Voodoo and saves a video from a camera

Friday, May 23, 2014

Voodoo Command Line

Working on a command line version of Voodoo, that has all the fuctions of Voodude:


Voodude Update:

Control of all programs directly from the computer Using the Scroll bars and manual input

Wednesday, May 21, 2014

Voodude and Voodoo Language V 1.0α Update

The Voodoo VM GUI called Voodude as I introduced in my last post now has a Serial port listener and a debugger that detects what a programmer is typing and then describes the format which is accepted by Voodoo.

Tuesday, May 20, 2014

Voodude V 1.0α


Created a new language called Voodoo with a GUI called Voodude that only requires 3 lines  to create an entire program and translate it into C. This project is designed for easier controlling of C based devices such as the Arduino.


Tuesday, May 6, 2014

Distance and location using internet message time differentials for use in source tracking

Overview:
Messages sent over the internet take time to get to the sender, typically. D/C<D/S because the messages travel through routing stations and are not entirely photonic. Obviously these messages display where they came from for things such as email( but this is relative, an email from Russia may say from Moscow despite coming from Novosibirsk. However we can use Δt of the sent time stamp and the receive time stamp to create a circle around our location and the sender's location is on the circumference, then by searching for major population centers and or using routing information from the routing servers, the algorithms can determine the senders location very accurately:
PHP Server Side:
1. Let's get the current time for the observer:
Wow a monstrous four lines(sarcasm)
2. Now the time that the sender saw the file leave(by time line I mean the line containing the time):








3.Now let's subtract the times; we need to sift out all letters from the alphanumeric known as $stringcheese, so that we can get just the time:
This works because our timestamp will be 'time $militarytime'. Using military time eliminates the problem of searching the string for AM or PM.
/////////////////////////////////////////////////////
Determining Average Speed of the Signal:
Using a Mac just to mash things up a bit. We need the time it takes for the signal  to leave our computer and return from a location.The  methodology is the same as in the North Korea Server post but this time I will use a Mac, however the commands are the same:

User$ ping www.facebook.com
PING star.c10r.facebook.com (31.13.71.33): 56 data bytes
64 bytes from 31.13.71.33: icmp_seq=0 ttl=87 time=39.729 ms
64 bytes from 31.13.71.33: icmp_seq=1 ttl=87 time=39.523 ms
64 bytes from 31.13.71.33: icmp_seq=2 ttl=87 time=39.123 ms
64 bytes from 31.13.71.33: icmp_seq=3 ttl=87 time=38.707 ms
64 bytes from 31.13.71.33: icmp_seq=4 ttl=87 time=36.871 ms
64 bytes from 31.13.71.33: icmp_seq=5 ttl=87 time=39.909 ms
64 bytes from 31.13.71.33: icmp_seq=6 ttl=87 time=37.632 ms
64 bytes from 31.13.71.33: icmp_seq=7 ttl=87 time=40.425 ms
64 bytes from 31.13.71.33: icmp_seq=8 ttl=87 time=39.038 ms
64 bytes from 31.13.71.33: icmp_seq=9 ttl=87 time=41.607 ms

Speed:
We can easily find where 31.13.71.33 is with a web search:
The distance there is about:
4748 km and the average time is about 40 s, but the signals travel double the distance so d==9496km and d/x=40 therefore x==237.4km/sec. Thus -237.4*$dt==radius.Note the negative because we used observer time minus received time and for most applications the observer has to send a message before the receiver can receive it. Now for the city search algorithm.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Code Outline:
First we will use a Google maps api to easily display our location graphically and numerically through HTML
It is of the utmost importance that the degree of magnification or the distance from the earth's surface is a constant so, I will rewrite the HTML file to include this necessity at the end. Finally we will display a circle of radius r, save the radius as r.txt, and open an image of our file in java/processing so that the computer can calculate the most probable point of origin. The logical way to do this is to view the world by night and use light pollution as the indicator for the presence of human life. The more life, the more light and vice versa. However the API does not use this map, so we will search for the presence of a specific color, a grey~tan which is associated with the concrete of urban areas:



And the Grey is:

HTML:
Now for the HTML/Javascript code to find us and display us on a map:

<!DOCTYPE html>
<html>
  <head>
    <title>Location Location Location</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>

    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>

    <script>

var map;

function initialize() {
  var mapOptions = {
    zoom: 10
  };
  map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);

  // attempts HTML GEOLOCATE(MUST BE HTML 5)
  if(navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      var pos = new google.maps.LatLng(position.coords.latitude,
                                       position.coords.longitude);
      alert(pos); //this displays our location
                                                       

      var infowindow = new google.maps.InfoWindow({
        map: map,
        position: pos,
        content: 'Found You'
      });

      map.setCenter(pos);
    }, function() {
      handleNoGeolocation(true);
    });
  } else {
    // Browser doesn't support Geolocation
    handleNoGeolocation(false);
  }
}

function handleNoGeolocation(errorFlag) {
  if (errorFlag) {
    var content = 'Error: The Geolocation service failed.';
  } else {
    var content = 'Error: Your browser doesn\'t support geolocation.';
  }

  var options = {
    map: map,
    position: new google.maps.LatLng(60, 105),
    content: content
  };

  var infowindow = new google.maps.InfoWindow(options);
  map.setCenter(options.position);
}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
  </body>

</html>
Screenshot:
Awesome! Now we need to write a program to capture an image of our area and search for major population centers within the radius, which is defined in the preceding PHP scripts.

In Linux:
$ gnome-screenshot -w -B
This will Screenshot our HTML window. In order to do this we should get rid of the alert() function in the javascript so the HTML tracker reads:
<!DOCTYPE html>
<html>
  <head>
    <title>Location Location Location</title>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <style>
      html, body, #map-canvas {
        height: 100%;
        margin: 0px;
        padding: 0px
      }
    </style>

    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>

    <script>

var map;

function initialize() {
  var mapOptions = {
    zoom: 10
  };
  map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);

  // attempts HTML GEOLOCATE(MUST BE HTML 5)
  if(navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      var pos = new google.maps.LatLng(position.coords.latitude,
                                       position.coords.longitude);
    
                                                       

      var infowindow = new google.maps.InfoWindow({
        map: map,
        position: pos,
        content: 'Found You'
      });

      map.setCenter(pos);
    }, function() {
      handleNoGeolocation(true);
    });
  } else {
    // Browser doesn't support Geolocation
    handleNoGeolocation(false);
  }
}

function handleNoGeolocation(errorFlag) {
  if (errorFlag) {
    var content = 'Error: The Geolocation service failed.';
  } else {
    var content = 'Error: Your browser doesn\'t support geolocation.';
  }

  var options = {
    map: map,
    position: new google.maps.LatLng(60, 105),
    content: content
  };

  var infowindow = new google.maps.InfoWindow(options);
  map.setCenter(options.position);
}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>
  </head>
  <body>
    <div id="map-canvas"></div>
  </body>

</html>

By eliminating the alert(pos); line the command script can now be used to Start firefox and open the HTML file, and then screenshot it.
$ do firefox 'SourcePath of the HTML FILE',sleep(10),gnome-screenshot -w -B
Great!  Now you can set up the above line to save it to the location of you're choice.

Groovy. Now time for Processing/Java.
Java/Processing:












N=The number of sides of the polygon and R is the radius of the circumscribed circle which is equal to the radius of the php script, and A=-1.

This is a fair region for the computer to search, but it should be rather quick.

The Processing Side of things will be done with a similar method to that of my post on my novel Morley Pintururia Naturaleza Muerta Smoothing Algorithm post. In terms of the area to cover, if we were to add in a script which modified the circle to be a regular polygon to try to reduce some of the searching, then:


PImage img;
int a, b,r,u;

void setup() {
  size(1000, 900);
  img = loadImage("cat.jpg");
  a = 1;
  b = 1;
  r=img.width;
  u=0;
  imageMode(CENTER);
  noStroke();
  background(0);

}

void draw() { 

  float pixel = map(11, 0, width, a, b);
  int x = int((img.width)-r);
  int y = int(random(img.height));
  color pix = img.get(x, y);
  fill(pix, 128);
  rect(x-1, y, pixel, pixel);
  rect(x+1, y, pixel, pixel);
  rect(x, y-1, pixel, pixel);
  rect(x, y+1, pixel, pixel); 
   println(pix);
  if pix=(//this will be our city color){
  println("we have a city here");
}
if(r==500){
  r=img.width;
}
}

The above code will find cities but does not compare them in terms of size, in order to achieve this we write the following:
PImage img;
int a, b,r,u;

void setup() {
  size(1000, 900);
  img = loadImage("cat.jpg");
  a = 1;
  b = 1;
  r=img.width;
  u=0;
  imageMode(CENTER);
  noStroke();
  background(0);

}

void draw() { 

  float pixel = map(11, 0, width, a, b);
  int x = int((img.width)-r);
  int y = int(random(img.height));
  color pix = img.get(x, y);
  fill(pix, 128);
  rect(x-1, y, pixel, pixel);
  rect(x+1, y, pixel, pixel);
  rect(x, y-1, pixel, pixel);
  rect(x, y+1, pixel, pixel); 
   println(pix);
  if (pix=(//this will be our city color))
  println("1");
else{
println("0");
}
if(r==500){
  r=img.width;
}
}
Now we have an array map of where the sender is!