Message Boards Message Boards

0
|
5196 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Data assimilation for ice growth

Posted 9 years ago

Dear group, I'm trying to use the temperature data structure ("AirTemperatureData") as input to a simple ice growth model, expressed as a simple linear 1D ODE. The ODE depends on 2 time dependent variables (air temperature and heat transfer coefficient). As a test I currently simulate the time dependence as Sine functions (T[t_] = f(Sin(w t))), with step size 1 s, using the NDSolve method.

The weather temperature and wind data are available as a timeseries. How can I use the weather measurements as input to the NDSolve function? The data seems to be sampled at 2.5 hour intervals and I need to convert and interpolate this data somehow down to 1 s. Any hints are welcome!

Regards, Soren

POSTED BY: Soren Molander
5 Replies
Posted 9 years ago

Thanks a lot, I will try this!

POSTED BY: Soren Molander

I'm not sure what it would mean to use it as input for an ODE.

If you had a TimeSeries called ts, you could easily define a differential equation with it:

myfunction'[t]==ts[t]

and you could use that in NDSolve once you've defined an initial condition. I would go ahead and try some simple examples.

v = {2, 1, 6, 5, 7, 4};
t = {1, 2, 5, 10, 12, 15};

ts = TimeSeries[v, {t}]

NDSolveValue[{myfunction'[time] == ts[time], myfunction[1] == 0}, myfunction, {time, 1, 10}]
POSTED BY: Sean Clarke
Posted 9 years ago

I finally got it working. First read the data:

temp = AirTemperatureData[
   "Linkoping", {DateObject[{2015, 12, 27}, TimeObject[{12}]], 
    DateObject[{2016, 1, 6}, TimeObject[{12}]]}];

The trick then was to interpolate missing data using

tempI = TimeSeries[temp, 
MissingDataMethod -> {"Interpolation", InterpolationOrder -> 2}];

and finally remove units from the weather data

tempVal = QuantityMagnitude[tempI["Values"]];

Then using NDSolveValue (using a simple ice growth model):

solution = 
  NDSolveValue[{he'[t] == 1/(rho L) (Tm - Ta[t])/(he[t]/k + 1/Hia[t]),
     he[0] == 0.0}, he, {t, 0, Last[tempTimes]}]; 

I had to fake the heat exchange parameter, recommended values are 20-40 w/m2, and I used 20 with a sinusoidal variation over 24 h. enter image description here

Thanks!

Sören

POSTED BY: Soren Molander
Posted 9 years ago

Yes, it's a TimeSeries expression. The question is if it's possible to use it as input to a NDSolve in order to solve a ODE. If not, I'd like to know about other possible ways to assimilate data.

Cheers,

Sören

POSTED BY: Soren Molander

When you say the data is a timeseries, do you mean that it is a TimeSeries expression?

https://reference.wolfram.com/language/ref/TimeSeries.html

You can sample a TimeSeries expression at any time value and it will interpolate between known values.

Otherwise, you can use Interpolation and interpolate the data yourself into a function.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract