Instantly share code, notes, and snippets.

😎
Solving solar

# Mark Mikofskimikofski

😎
Solving solar
• Sort options
Last active Mar 24, 2020
dcloss
View dcloss.ipynb Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Last active Mar 13, 2020
use Requests with OAuth 1.0 and Netflix REST API 1.5
View keyfile.json
 { "key": "", "secret": "" }
Last active Mar 13, 2020
horners method in 2-D
View polyDer2D.m
 function [fx,fy] = polyDer2D(p,x,y,n,m) %POLYDER2D Evaluate derivatives of 2-D polynomial using Horner's method. % F = POLYDER2D(P,X,Y,N,M) evaluates the derivatives of 2-D polynomial P at % the points specified by X and Y, which must have the same dimensions. The % outputs FX and FY will have the same dimensions as X and Y. N and M specify % the order of X and Y respectively. Polynomial coefficients are in the % following order. % % F(X,Y) = P_1 * X^N * Y^M + P_2 * X^{N-1} * Y^M + ... + P_{N+1} * Y^M + ... % P_{N+2} * X^N * Y^{M-1} + P_{N+3} * X^{N-1} * Y^{M-1} + ... + P_{2*(N+1)} * Y^{M-1} + ...
Last active Mar 13, 2020
View Moody_diagram.jpg Last active Mar 13, 2020
fit (x,y) to polynomial of degree (degree) forcing y-intercept to zero
View polyfitZero.m
 function [p,S,mu] = polyfitZero(x,y,degree) % POLYFITZERO Fit polynomial to data, forcing y-intercept to zero. % P = POLYFITZERO(X,Y,N) is similar POLYFIT(X,Y,N) except that the % y-intercept is forced to zero, i.e. P(N) = 0. In the same way as % POLYFIT, the coefficients, P(1:N-1), fit the data Y best in the least- % squares sense. You can also use Y = POLYVAL(PZERO,X) to evaluate the % polynomial because the output is the same as POLYFIT. % % [P,S,MU] = POLYFITZERO() Return structure, S, similar to POLYFIT for use % with POLYVAL to calculate error estimates of predictions with P.
Last active Mar 13, 2020
View EncryptUtil_test.m
 %% initialize workspace close('all'),clear('all'),clc rmdir('keys','s') % delete old keys %% test encryption PANGRAM = 'The quick brown fox jumped over the lazy dog.'; EncryptionUtil.testJschSECSH(PANGRAM) % run test %% make SSH keys in workspace keyFactory = java.security.KeyFactory.getInstance('RSA'); % make a key factory % read public OpenSSH key [keyln, totlines] = EncryptionUtil.readJschKeyFile('keys/publicJschSECSH.key',7);
Last active Mar 13, 2020
time series examples that subclass numpy ndarray
View timeseries.py
 #! /usr/bin/env python import numpy as np from datetime import datetime, time, timedelta import pytz class Timeseries(object): def __init__(self, x, t): self.x = np.array(x) self.t = np.array(t,dtype='datetime64[s]')
Last active Mar 13, 2020
NSRDB NY STATIONS
View ny_nsrdb_map.geojson Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Last active Mar 13, 2020
proof of an implicit solver
View PV-system-MPP-implicit-solver.ipynb 