Welcome, Guest

Author Topic: Coding  (Read 275952 times)

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #600 on: March 21, 2016, 11:50:05 AM »
snip

now fixed so that if you lock your screen it won't crash

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #601 on: May 06, 2016, 05:26:56 PM »




i wrote a very rudimentary gravity simulator that's limited to 3 bodies but you can watch it as the simulation progresses

requires matplotlib

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #602 on: May 24, 2016, 04:02:15 AM »
this line is the death of my code:

Code: [Select]
input=open("coords.txt",'r')
which is funny, because it works just fine

but i'm running a script through cmd that runs in jython in some other program... and that causes it not to work

which is funny, because it should work just fine per this http://www.ssec.wisc.edu/~tomw/visadtutor/load.html

but, i did have some issues coding since some functions were changed from some earlier version of this program and had to updated to a new version of the function name... but that was for some other module presumably and not... normal... file... input/output... operations?????????????????????



anyway, i've been trying to get some help on the support forum for said program for a month now but my account hasn't been approved

so i made a new one

i figure this issue probably has a really simple fix and i'm just missing something really stupid... but i don't know, maybe i'll know in july

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #603 on: May 24, 2016, 05:47:54 PM »
a more detailed chart and calculations that were used to determine this can be found here
new univision pots

« Last Edit: May 24, 2016, 05:54:58 PM by atomic7732 »

FiahOwl

  • *****
  • Posts: 1234
  • This is, to give a dog and in recompense desire my dog again.
Re: Coding
« Reply #604 on: May 24, 2016, 06:36:44 PM »

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '170686'.

« Last Edit: March 22, 2021, 02:12:45 AM by FiahOwl »

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #605 on: May 24, 2016, 09:31:45 PM »
wouldn't that be

darvincia aeridani kallisto bongatar

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #606 on: May 24, 2016, 09:34:36 PM »
>implying i would stoop to the level of shitposting

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #607 on: May 24, 2016, 10:32:13 PM »
you shitpost in univision by sending yoko ono

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #608 on: May 24, 2016, 10:41:42 PM »
>no you shitpost by not sending enough yee

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #609 on: May 26, 2016, 08:43:06 AM »
we define the product function over the d-dimensional space as the product of the components of any point.
for example, product(.2) = .2, product([0.5,0.5,0.5]) = 0.125

if we integrate product over the unit interval [0,1], we get 1/2
if we integrate product over the unit square, with corners (0,0) and (1,1), we get 1/4
if we integrate product over the unit cube, we get 1/8
if we integrate product over the unit d-dimensional hypercube, we get 2^-d

notice that in high dimensions, this function has a very narrow peak which can trip up numerical integration methods.
therefore it is a good way to test how good a numerical integrator is.

we measure error of a numerical integrator as follows:
if the integrator returns some value y, and the actual solution is w, we say error is y/w-1

in the below graph, the x-axis is the number of dimensions
the y-axis is the error as computed previously

the blue line represents a perfect symbolic integrator
the red line is a non-adaptive monte carlo integrator
the green line is an adaptive monte carlo integrator (VEGAS) which i used from this python library which is really nice

parameters were set so that both numerical integrators sampled 150000 points
we can see that up to 12 dimensions or so, the adaptive integrator is off by no more than one part in a thousand

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #610 on: June 10, 2016, 03:05:07 AM »


I got WRF (an open-source regional weather model) running today and I've run a few test simulations... Here's my first "real" simulation:

It's a simulation using the North Atlantic basin as the domain for the model. I'll be using this as my region to see how the model forecasts Atlantic TCs throughout the season. I might also set up a region for the EPAC or WPAC but as of yet they haven't been doing anything.

I ran the simulation for 72hrs out from 2016-06-10 00:00:00 UTC with 30 km resolution, using the GFS model as data input and for the bounds of the sim (since it's a regional model). The run took about 55 minutes to complete. Here are a few of the types of data it can output that I've been messing around with:

http://imgur.com/a/6drUC

The first album here is just 6 hour precipitation between each frame for the whole length of the run.



Here is an outgoing longwave radiation plot which works well to visualize where clouds and convection are. There is definitely a better way to simulate infrared satellite (probably a combination of factors and some math) but I don't know how to do that yet.



And here is a plot of mean sea level pressure and 10m winds. I'm still working on the contour-fill color scheme.

I'm still messing around with it though and trying to figure out all the cool things you can do with it.

But finally... I'm in control. ^-^
« Last Edit: June 10, 2016, 03:10:35 AM by atomic7732 »

FiahOwl

  • *****
  • Posts: 1234
  • This is, to give a dog and in recompense desire my dog again.
Re: Coding
« Reply #611 on: June 10, 2016, 09:58:19 AM »

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '171175'.

« Last Edit: March 22, 2021, 02:08:55 AM by FiahOwl »

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #612 on: June 10, 2016, 11:32:36 AM »
kol

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #613 on: June 29, 2016, 01:59:31 AM »


ehhhh... what

y axis is time (date of year)
x axis is longitude (in degrees)

points are locations of the formation of tropical cyclones

i'm trying to see if there's a pattern in the longitude of their formation... something like this:



but i have no idea because the kernel function is predicting(?) places of high frequency of cyclone formation where there were none, specifically west of 60E

and not showing any frequency where cyclones did actually form

cause it likely follows a pattern similar to this:

« Last Edit: June 29, 2016, 02:11:21 AM by atomic7732 »

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #614 on: July 03, 2016, 09:57:23 PM »


[04:53] <+kalassak> i'm working on a game but since i can't code it on vacation i figured i'd mess around with mechanics
[04:53] <+kalassak> so i'm figuring out how to generate dvorak numbers based on a known correct intensity
[04:53] <+kalassak> so that the player can take the dvorak and use it for their tracking
[04:56] <+kalassak> less often a microwave estimate will be given (a bit more accurate) and even less often will you get a scatterometer pass (very accurate)

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #615 on: July 03, 2016, 10:59:45 PM »
for R E A L I S M scatterometer should only be accurate below hurricane strength

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #616 on: September 09, 2016, 08:03:26 PM »
A video of my repulsive gravity simulator.

The repulsion seems to slow down over time. that's just the universe expanding according to hubble's law

tuto99

  • *****
  • Posts: 533
  • Baba Booey
Re: Coding
« Reply #617 on: September 09, 2016, 09:25:09 PM »
doesnt play 0/10

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #618 on: September 10, 2016, 06:32:08 AM »
yes it does

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #619 on: September 10, 2016, 12:15:40 PM »
https://www.youtube.com/watch?v=LrjYWNN5sQ8&feature=youtu.be

a small scale simulation before i actually run the full scale version of the simulation. if you view this in full screen, each white pixel weighs about 2 milk way galaxies. the reason there are bars on the side of this video is because the video itself is 1024 x 1024, yet youtube kept resizing it to 720p, losing information in the process, so i was forced to pad it until it was 1920 x 1080. there are 65536 objects in this simulation. the full scale sim will have just over a million (2^20). each second of this video is about 160 million years of time.

i will admit there are some "glitches" with this simulation. if you watch one of the blobs in the lower left corner, you'll see that at some point, it spontaneously explodes itself.
« Last Edit: September 10, 2016, 12:21:58 PM by vh »

FiahOwl

  • *****
  • Posts: 1234
  • This is, to give a dog and in recompense desire my dog again.
Re: Coding
« Reply #620 on: September 10, 2016, 12:22:05 PM »

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '174484'.

« Last Edit: March 22, 2021, 01:50:22 AM by FiahOwl »

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #621 on: September 10, 2016, 12:41:01 PM »
Very cool

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #622 on: March 04, 2017, 11:34:08 PM »
yall need to be more active



Start with the numbers from 3 through 10 billion (skip 1 and 2 because they have weird properties). Now compute a list of primes in that range -- there should be a bit less than 500 million of them.

Now consider these primes in groups of 3072 primes each, with groups separated by 2048 primes, so that there are 1024 primes of overlap. We will do some math with each group.

Take the second prime, subtract it from the first prime. This gives you the first number in a new sequence. Then take the third prime, subtract it from the second prime, giving you the second number. Continue doing this through all 3072 primes. This procedure is called the adjacent difference.

Now take the absolute values of this sequence. You don't have to do this really, because all the numbers are positive right now -- but that will change.

Go back to the start and take the adjacent difference of your sequence again. Then take he absolute value. Then the adjacent difference. Keep going. After a while, you will realize that all your numbers have become zeroes and twos.

You are done with the first group. Now take your second group of 3072 primes, and repeat. There are over 200 thousand groups in this first chunk of 500 million primes.

You finish your first chunk. Out of all the groups, what is the most repeats of adjacent difference and absolute value you had to take before everything became 0s and 2s? Let's call this value the "chunk maximum"

Now move on to your second chunk. And the third. And so on. The final goal is to process 10 million chunks (up to the number 10^17), containing an aggregate total of over 2600 trillion primes.

Now ask yourself, at any point in time, what is the most difficult group of primes you have seen before? In all the groups in all chunks which you have processed, which group took the most iterations of adjacent difference and absolute value? Let's call this value the "global maximum"

In the plot below, the blue line is a smoothed plot of the chunk maximum. The green line is the global maximum. On the x axis is the chunk number. As you can see, I'm not too close to the ultimate goal of 10 million yet. Then again, I've only been running my code for about a day.
« Last Edit: March 04, 2017, 11:50:25 PM by vh »

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #623 on: March 05, 2017, 12:15:18 AM »
what is the significance of this?

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #624 on: March 05, 2017, 12:51:55 PM »
Ok some recent stuff from my master project

A small script I wrote to determine the size of Sr atomic cloud from photos of its flourescence



A bit from another script I wrote that simulates the physics in the cloud inside a cavity and magneto-optical trap, and applying a Rabi pulse. This predicts the fraction that would be excited by different pulse durations (starting at 100 µs)



The script can make sims with different experimental parameters to maximize the flash intensity or number of excited atoms. Here's an example of max excited fraction with different combinations of the waist sizes of the Rabi laser pulse



It takes into account temperature, magnetic field, cloud shape (gaussian but can be elongated along axes), seed and Rabi laser power, number of atoms, and uhh, lots of other things.
Bachelor students did some experiments in the lab and I hacked their results to compare with my simulation. However all this was from when we weren't very sure on the cloud size, temperature and stuff. The bachelor students worked on measuring temperature but I don't have their results yet.


vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #625 on: March 05, 2017, 09:08:33 PM »
cute.

what is the significance of this?

well basically there's this conjecture which says that if you keep taking the absolute adjacent differences of the prime numbers (this will give you a bunch of sequences), the first number of each sequence is always 1.

an more efficient way of testing this is, at the nth iteration of this absolute adjacent difference, all the numbers (besides the first one of course) are 0 and 2. if this is the case up to the kth number in this sequence, you can be sure that the 1st number in the next k absolute adjacent differences is a 1 (convince yourself this is true by working it out on a piece of paper)

now instead of computing the adjacent difference all at once, i compute it in groups. think about this for a minute and it should be clear why the groups of primes i described above need to overlap. now it should also be clear what the significance of that plot is -- it's the number of iterations each group needs to go through

the amount of memory on the streaming multiprocessors i'm running this on is very small (32KB). therefore, i can only fit around 3072 primes on the each multiprocessor at once. i have an overlap of 1024 primes, which means i can do up to 1024 iterations without any problems. this may become problematic if there is some group which requires more than 1024 iterations, but we can fix this by making the overlap larger, say 1536, at the cost of computational efficiency


vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #626 on: March 06, 2017, 10:12:23 PM »
ok well i redid that plot again... big surprise

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #627 on: March 11, 2017, 10:32:12 AM »
just found out google uses 2 space indents instead of 4

i could never work for them now.

atomic7732

  • Global Moderator
  • *****
  • Posts: 3849
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #628 on: March 11, 2017, 11:41:29 AM »
2 space indents are fine

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #629 on: March 11, 2017, 12:30:54 PM »
Kol 2 space sounds nice if you have a lot of loops. Coding Map War and some other stuff I got tired of all the code ending up in a small spot on the right