This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def LeastRootSq(x, t, M): | |
aaa = np.array([x**k for k in range(2*M+1)]) | |
aa = np.sum(aaa, axis=1) | |
A = np.array([[aa[i+j] for i in range(M+1)] for j in range(M+1)]) | |
tt = np.array([x**k for k in range(M+1)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!TEX encoding = Shift-JIS | |
%Last update for this template : 2014-12-19 | |
\documentclass[10pt,a4paper]{jsarticle} % Option : [twocolumn] / jsbook : [openany, oneside] | |
\usepackage[dvipdfmx,hiresbb]{graphicx} % graphicx | |
% | |
%====== preamble =========================== | |
%\input{C:/w32tex/share/texmf-dist/preamble/pream01.tex} % Win | |
%\input{/usr/local/share/texmf/preamble/pream01.tex} % Mac | |
%UTF-8 case : pream**_utf8.tex | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%!TEX encoding = Shift-JIS | |
%Last update for this preamble : 2014-12-19 | |
%pream01.tex -- jsarticle,,柱あり,listing 無 | |
% | |
%usepackages | |
% | |
\usepackage{amsmath,amssymb} | |
\usepackage{bm} | |
\usepackage{ascmac} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################## | |
# | |
# name : checkSS.py | |
# usage : checkSteadyState for ALPS based on ALPS wiki, | |
# http://comp-phys.org/mediawiki/index.php/Documentation:Monte_Carlo_Equilibration | |
# edit : potass | |
# Last Update : 2014-10-19 | |
# | |
########################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################## | |
# | |
# name : replace.py | |
# usage : xml to csv for ALPS | |
# edit : potass | |
# Last Update : 2014-10-18 | |
# | |
########################################################## | |
import sys, os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################## | |
# | |
# name : binning.py | |
# usage : binnig analysis for ALPS | |
# edit : potass | |
# Last Update : 2014-10-18 | |
# | |
########################################################## | |
import sys, os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub rainflow() | |
Dim mem_arr() As Variant | |
Dim peakdata() As Variant | |
Dim ex_data() As Variant | |
Dim ws As Worksheet | |
Dim i As Long | |
Dim j As Long | |
Dim k As Long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import numpy as np | |
from scipy import signal | |
import matplotlib.pyplot as plt | |
import rainflow | |
def f(x): | |
return 0.2+0.4*np.sin(x)-0.6*np.cos(2*x)+1.2*np.sin(8*x) | |
def main(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
demag.c | |
*/ | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#define LENG 100 | |
static double PI = 3.141592653582; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function inv(x As Double) As Double | |
' Define involute function | |
inv = Tan(x) - x | |
End Function | |
Function solve_inv(val As Double) As Double | |
' Solve for x : inv(x) = val | |
Dim x0 As Double, x1 As Double | |
Dim eps As Double, pi As Double | |