Code covered by the BSD License
-
Calibrating Simulating Natur...
-
Modeling Simulating Hourly E...
-
Modeling Simulating Hourly T...
-
Simulation of Hybrid Electric...
-
backtestPlantPortfolio(assets...
BACKTESTPLANTPORTFOLIO applies the simple dispatch algorithm on
-
dispatch(capacity, heatRate, ...
DISPATCH computes optimal daily dispatch decisions for a gas-fired plant
-
dynamicDateTicks(axH, link)
DYNAMICDATETICKS is a wrapper function around DATETICK which creates
-
fetchDBElecData(startDate, en...
FETCHDBDATA is a modified auto-generated function to import electricity
-
fetchNGData()
FETCHDBDATA is a modified auto-generated function to import natural gas
-
fitPlot(dates, YMatrix1, res1...
FITPLOT is a modified auto-generated function to create a plot of the actual series,
-
genPredictorsElec(dates, hour...
GENPREDICTORSELEC generates a set of predictors for modeling electricity
-
simulateElecPrices(elecModel,...
SIMULATEELECPRICES simulates the electricity price model derived in script
-
simulateNGPrices(NGModel, dat...
SIMULATENGPRICES simulates the natural gas price model derived in script
-
simulatePlantPortfolio(assets...
SIMULATEPLANTPORTFOLIO jointly simulates natural gas prices, temperatures
-
simulateTemperature(tempModel...
SIMULATETEMPERATURE simulates the temperature model derived in script
-
View all files
|
|
| fetchNGData()
|
function data = fetchNGData()
% FETCHDBDATA is a modified auto-generated function to import natural gas
% price data from a database
%
% SYNTAX:
% data = fetchNGData()
% Set preferences with setdbprefs.
s.DataReturnFormat = 'structure';
s.ErrorHandling = 'store';
s.NullNumberRead = 'NaN';
s.NullNumberWrite = 'NaN';
s.NullStringRead = 'null';
s.NullStringWrite = 'null';
s.JDBCDataSourceFile = '';
s.UseRegistryForSources = 'yes';
s.TempDirForRegistryOutput = 'C:\Temp';
s.DefaultRowPreFetch = '10000';
setdbprefs(s)
% Make connection to database. Note that the password has been omitted.
% Using ODBC driver.
conn = database('EnergyData','','password');
% Read data from database.
e = exec(conn,'SELECT ALL Date,NaturalGas,CrudeOil,FuelOil FROM Fuels');
e = fetch(e);
close(e)
% Assign data to output variable.
data = e.Data;
data.Date = datenum(data.Date, 'yyyy-mm-dd HH:MM:SS');
% Close database connection.
close(conn)
|
|
Contact us