Page 4 of 5

Re: The Church of Climatology: App rumblings

Posted: Mon Nov 08, 2010 1:39 am
by Anguipes
su_liam wrote:Any chance of your exposing the source code?
If I can bear the embarrassment :oops:

Re: The Church of Climatology: App rumblings

Posted: Mon Nov 08, 2010 11:34 am
by Daistallia
Anguipes wrote:
su_liam wrote:Any chance of your exposing the source code?
If I can bear the embarrassment :oops:
Free the code. :) (Not that I could necessarily use it, but just like to see open source.)

Also, I assume you were planning on making it adjustable to various star type, yes?

Re: The Church of Climatology: App rumblings

Posted: Mon Nov 08, 2010 2:06 pm
by alice
Anguipes wrote:
su_liam wrote:Any chance of your exposing the source code?
If I can bear the embarrassment :oops:
As long as you can apply it to the Earth so that I'll know what the weather will be like when I'm on holiday, your code will be beyond any reasonable criticism :-)

Re: The Church of Climatology: App rumblings

Posted: Mon Nov 08, 2010 3:56 pm
by Anguipes
Nancy Blackett wrote:
Anguipes wrote:
su_liam wrote:Any chance of your exposing the source code?
If I can bear the embarrassment :oops:
As long as you can apply it to the Earth so that I'll know what the weather will be like when I'm on holiday, your code will be beyond any reasonable criticism :-)
Only if your holiday is in Manchester.


When there's a program to show, source code will certainly be available to anyone who wants a peek.

Daistallia wrote:Also, I assume you were planning on making it adjustable to various star type, yes?

"Adjustable" is my main goal (well, apart from "working"). Want to set the energy output from your star directly? Sure. Want to calculate it from a radius and surface temperature? Sure. Want to fiddle with the specific heat capacities of land and/or ocean areas? Why not.

Most of this flexibility will take the form of an editable config file full of variables.

I have currently chickened out of oblate spheroid planets, and will probably be working from circular orbits, at least for early stuff.

I'm also not going to go into great detail about atmospheric composition, or anything else that starts to push too hard towards "real physics". There are detailed climate models out there, source code available, for anyone who's that determined to catch every single possible variable of a realistic planet. I'm more after a quick and dirty solution that can model from basic principles (heat -> atmospheric circulation -> preciptiation), and then be played with in more of an artistic, non-scientific way - adding the Zone of Fire to model of Almea, for example.

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 09, 2010 6:28 am
by alice
Anguipes wrote:Only if your holiday is in Manchester.
Is that not an oxymoron?

Re: The Church of Climatology: App rumblings

Posted: Sat Nov 13, 2010 11:52 pm
by Anguipes
If anyone plans on working with highly elliptical orbits (eccentricity over 0.3), they're going to have to find me some C++ code to solve Kepler's equation for those cases. I'm currently running the (C?) code from here, which runs the < .3 case fine but sulks at everything else. This may well be because it's C rather than C++, or some other relatively simple matter that I would know about if I actually bothered to study programming.

Aside from that things are going well, at least in that I should have some useful heat data output soonish.

Re: The Church of Climatology: App rumblings

Posted: Mon Nov 15, 2010 3:50 pm
by su_liam
Anguipes wrote:If anyone plans on working with highly elliptical orbits (eccentricity over 0.3), they're going to have to find me some C++ code to solve Kepler's equation for those cases. I'm currently running the (C?) code from here, which runs the < .3 case fine but sulks at everything else.
It's not because it's C. It actually looks like it should handle eccentricity up to 0.8 ...pretty... well. Its just that over about e=0.3 it takes a lot of iterations to find the root unless you make a really good initial guess. Doing it by hand usually bogs down scary bad at 0.1, so don't complain...

Two hints. One, unless they're darting around little class-M stars, planets with orbital eccentricities much over 0.3 are really unlikely to be remotely fit for humans. Without invoking magic... Two, assuming that your angular coordinates are zeroed at perihelion, a good guess for about nine tenths of the year would be right around pi(180º). With these two points in mind, a fastish computer and a widdle bit of patience, you got it made my man!

P.S: Hey Nancy(are you ever going to change that back?), who's the angry lady in your avatar? Kinda makes me think of a very young Jodie Foster(yum).

Re: The Church of Climatology: App rumblings

Posted: Mon Nov 15, 2010 4:02 pm
by alice
su_liam wrote:P.S: Hey Nancy(are you ever going to change that back?), who's the angry lady in your avatar? Kinda makes me think of a very young Jodie Foster(yum).
No (why???), and I'm not saying :-) It isn't Jodie Foster.

Re: The Church of Climatology: App rumblings

Posted: Mon Nov 15, 2010 4:10 pm
by su_liam
Awww...

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 16, 2010 8:30 am
by Anguipes
su_liam wrote:It's not because it's C. It actually looks like it should handle eccentricity up to 0.8 ...pretty... well. Its just that over about e=0.3 it takes a lot of iterations to find the root unless you make a really good initial guess. Doing it by hand usually bogs down scary bad at 0.1, so don't complain...

Two hints. One, unless they're darting around little class-M stars, planets with orbital eccentricities much over 0.3 are really unlikely to be remotely fit for humans. Without invoking magic... Two, assuming that your angular coordinates are zeroed at perihelion, a good guess for about nine tenths of the year would be right around pi(180º). With these two points in mind, a fastish computer and a widdle bit of patience, you got it made my man!
Thanks. I'm aware that high eccentricities are unlikely in strictly realistic conworlds, but I would like this program to (eventually) cover as many crazy possibilities as possible.

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 16, 2010 1:22 pm
by su_liam
Anguipes wrote:Thanks. I'm aware that high eccentricities are unlikely in strictly realistic conworlds, but I would like this program to (eventually) cover as many crazy possibilities as possible.
It looks like the code you linked to should eventually cover everything up to hyperbolic escape. By eventually I mean it might take awhile to calculate.

Mathematica's FindRoot can solve this for e=0.99 and a Mean Anomaly of 30º in a couple seconds on my computer with some pretty stupid initial guesses. My processor spikes to 67ºC while its doing the job. It fails if I guess pi(?). The Solve function is slower and complains about the inverse trig functions, but it is more reliable and less dependent on my not making a stupid guess. Even Solve takes less than five seconds. That's doing symbolic math and with no optimizations on my part.

I'll need to compile the code you linked to, but I just can't figure out why it would be much slower. The Mathematica routine I'm using is just plain stupid(I wrote it) and has a lot of overhead, that C code actually looks pretty nicely optimized from what I can tell.

Re: The Church of Climatology: App rumblings

Posted: Wed Nov 17, 2010 4:46 pm
by su_liam
I've put up a first-draft of the temperatures chapter of my forthcoming(? hahaha, er I hope.) webbook on conworlding.
The link is right here.

Please don't laugh at me too hard. I hope someday to be a n00b!

Re: The Church of Climatology: App rumblings

Posted: Sat Nov 20, 2010 9:36 pm
by Anguipes
Heat (or rather energy) oddity: around the solstices, an odd phenomenon happens at the pole pointing towards the sun - according to my pretty pictures, the latitude equal to the axial incline of the planet experiences an optimum balance of day length and sun angle and actually gets more energy per day than the latitudes directly below and above it.

Can anyone confirm that this is a real phenomenon, or has something gone wrong with my maths?

Re: The Church of Climatology: App rumblings

Posted: Sun Nov 21, 2010 10:00 am
by the duke of nuke
Yes - these latitudes are the tropics (of Cancer and Capricorn, on Earth).

Re: The Church of Climatology: App rumblings

Posted: Sun Nov 21, 2010 11:56 am
by Anguipes
Anguipes wrote:the latitude equal to the axial incline of the planet
the duke of nuke wrote:Yes - these latitudes are the tropics.
...arse. That'll teach me to debug programs at three in the morning.

It's not the tropics, because I gave the wrong angle :oops: I meant 90 - axial incline of the planet, the polar circles. I suspect I have the maths for mean sun elevation wrong in 24-hour daylight cases.

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 23, 2010 6:14 pm
by su_liam
I remember reading... somewhere(which I can't find in my current state)... that, on planets with an axial inclination in excess of 45º, the annual mean insolation is greatest at the poles. I have yet to figure out the calculations for annual mean of insolation, so I don't know.

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 23, 2010 6:52 pm
by Anguipes
I think I've got things fixed now. Still a little suspicious of my day lengths, but at least I'm not getting odd blips and ridges.

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 23, 2010 7:21 pm
by Anguipes
su_liam wrote:I remember reading... somewhere(which I can't find in my current state)... that, on planets with an axial inclination in excess of 45º, the annual mean insolation is greatest at the poles. I have yet to figure out the calculations for annual mean of insolation, so I don't know.
That's not what I'm getting :?

Image
The higher the inclination the more evenly the annual mean insolation is spread, up to an almost completely even annual insolation at 90 degrees. I used a very quick and dirty method of getting the average though, so who knows.

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 23, 2010 8:20 pm
by the duke of nuke
Hm. I'll leave this to the experts...
but... out of interest, will we be able to use this for planets that are tidally locked, or that have ridiculously long days?

Anyways, I'm looking forward to seeing a usable version :D

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 23, 2010 8:57 pm
by su_liam
Huhh.

You're getting what I'd instinctively expect. At 90º inclination, the whole world gets its day in the Sun.

Considering it further, I think the peak insolation was what I was reading about.

Hopefully my brain will function soon.

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 23, 2010 9:36 pm
by Anguipes
the duke of nuke wrote: out of interest, will we be able to use this for planets that are tidally locked, or that have ridiculously long days?
Probably not in version 1.0, unless there's a demand. It's something I want to be possible, but at the moment I'm taking a fixed orbital position for each "day", which is a) simple and b) bad, as you can set day length independently and well out of the threshold of stationary days making any sense.

I don't want to get too bogged down in astronomy for v1, because there are a vast amount of cases (long days, tidal locking, twin planets, binary stars...) and they all effect only one thing - energy input patterns. If I can get a program that takes energy input patterns and turns them into a climate, that's well over half the work done. Groovy astronomical setups can then be added to a working product.

Re: The Church of Climatology: App rumblings

Posted: Tue Nov 23, 2010 9:54 pm
by bulbaquil
Incidentally, because of refraction and the fact that if the sun's partly over the horizon it counts as daytime, the equator of a planet with 90º axial tilt would get a 24-hour-long day at both solstices.

Re: The Church of Climatology: App rumblings

Posted: Wed Nov 24, 2010 12:06 am
by Anguipes
bulbaquil wrote:...refraction...
LALALALALA I CAN'T HEAR YOU LALALALA

Re: The Church of Climatology: App rumblings

Posted: Wed Nov 24, 2010 1:20 am
by su_liam
Tidal locking is one special case that would probably be worth handling.

Re: The Church of Climatology: App rumblings

Posted: Thu Nov 25, 2010 9:35 pm
by Anguipes
Well, things have passed an important threshold: I am now getting honest to goodness temperatures out.

Image

This shows the theoretical rise in temperature that would caused by the incoming energy for one day around the (NH) winter. You can see how the oceans heat slower than the land. There are two more factors I need for a proper first pass* temperature map - the amount of heat the same areas would be losing, and a base temperature to modify.


*Calculating surface temperature relies (amongst other things) on cloud cover. Calculating cloud cover relies on air motion and moisture capacity. Which is calculated from temperature. Climate modeling is full of this kind of thing.