Skip to content

Instantly share code, notes, and snippets.

@Opiprog
Opiprog / gist:6039573
Created July 19, 2013 14:38
Solving ODE in Python
from scipy.integrate import odeint
from pylab import * # for plotting commands
def deriv(y,t): # return derivatives of the array y
a = -2.0
b = -0.1
return array([ y[1], a*y[0]+b*y[1] ])
time = linspace(0.0,10.0,1000)
yinit = array([0.0005,0.2]) # initial values
@Opiprog
Opiprog / UpdateCycleNum
Last active January 1, 2016 17:09
Excel VB Macro - Updating cycle numbers
Sub UpdateCycleNum()
Dim CellSelect As Long
Dim CycAdd As Long
Dim rng As Range
CellSelect = 1000
CycAdd = 67000
'Set the range in column A you want to loop through
Sub CopyData()
Dim i As Long
Dim j As Long
i = 0
j = 1
Header = Range("A" & (1 + (258 * i)))
Index Axial Load FE AA IE
0 70 25 3 -10
1 195.9902 24.97371961 3.235454367 -9.992665938
2 400.7797 24.89494269 3.470092195 -9.97068168
3 773.9403 24.76386181 3.703099776 -9.934100971
4 1254.5773 24.58079744 3.933669057 -9.88301324
5 1760.8765 24.34619711 4.161000441 -9.81754338
6 2173.2502 24.06063434 4.384305557 -9.737851445
7 2404.0408 23.72480725 4.602809999 -9.644132256
8 2537.4333 23.33953682 4.815756011 -9.536614927
@Opiprog
Opiprog / gist:8bb6f491578d4f23540ccd98e85288c3
Created December 6, 2016 12:45
Convert xls to xlsx using Windows cmd
# Open a command prompt in windows and type the following
# This open the excelcnv.exe from the Office15 folder and converts MyFile.xls (from the in folder) to MyFile.xlsx (to the out folder)
"C:\Program Files (x86)\Microsoft Office\Office15\excelcnv.exe" -oice "C:\in\MyFile.xls" "C:\out\MyFile.xlsx”
@Opiprog
Opiprog / Kivy_HelloWorld.py
Created November 25, 2017 23:31
Kivy - Hello World
import kivy
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text='Hello world')