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 -*- | |
""" | |
fea method for a one-dimensional model problem: | |
require: | |
- numpy: 1.8.1 | |
- scipy: 0.14.0 | |
Yung Wong <yungwong<yungwong.seu@gmail.com> | |
May 26 09:26:38 2014 |
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
/* | |
* Navierstokes Time marching 2D. | |
* Balaji Sankar. | |
*/ | |
//The Only stuff you need to Change are in this box. | |
//*Please*Do not tamper with the other stuff unless you know exactly what you are doing. | |
//Blasius solution | |
//============================================================= | |
// Number of divisions in X axis | |
#define IMAX 70 |
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
! set parameters | |
xlen=3 | |
ylen=4 | |
zlen=7 | |
! define model | |
/prep7 | |
block,,xlen,,ylen,,zlen | |
et,1,185 | |
mp,ex,1,1e6 |
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
import os | |
import win32com.client | |
#create Sap2000 object | |
SapObject = win32com.client.Dispatch("Sap2000v15.SapObject") | |
#start Sap2000 application | |
SapObject.ApplicationStart() | |
#create SapModel object |
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
\documentclass{article} | |
\usepackage{tikz} | |
\usetikzlibrary{arrows.meta} | |
\begin{document} | |
\begin{tikzpicture}[scale=2] | |
\shade[top color=blue,bottom color=gray!50] (0,0) parabola (1.5,2.25) |- (0,0); | |
\draw (1.05cm,2pt) node[above] {$\displaystyle\int_0^{3/2}\!\!x^2\mathrm{d}x$}; | |
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
# A simple Python script illustrating the architecture of matplotlib. | |
# It defines the backend, connects a Figure to it, | |
# uses the array library numpy to create 10,000 normally distributed random | |
# numbers, and plots a histogram of these. | |
# http://www.aosabook.org/en/matplotlib.html | |
# Import the FigureCanvas from the backend of your choice | |
# and attach the Figure artist to it. | |
import numpy as np | |
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas |
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
\documentclass{article} | |
\usepackage{tikz} | |
\usetikzlibrary{datavisualization} | |
\usetikzlibrary{datavisualization.formats.functions} | |
\begin{document} | |
\begin{tikzpicture} | |
\datavisualization [scientific axes=clean] | |
[ |
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
\documentclass{article} | |
\usepackage{tikz} | |
\begin{document} | |
\begin{tikzpicture}[scale=2] | |
\draw[gray,very thin] (-1.9,-1.9) grid (2.9,3.9) | |
[step=0.25cm] (-1,-1) grid (1,1); | |
\draw[blue] (1,-2.1) -- (1,4.1); % asymptote | |
\draw[->] (-2,0) -- (3,0) node[right] {$x(t)$}; |
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
% Brillouin Function | |
% Author: Mark Wibrow | |
\documentclass[tikz,border=10pt]{standalone} | |
\usepackage{amsmath} | |
\usetikzlibrary{arrows.meta} | |
\directlua{ | |
function coth (i) | |
return math.cosh(i) / math.sinh(i) | |
end |
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
import numpy as np | |
def coth(x): | |
return np.cosh(x)/np.sinh(x) | |
def brilloutin(J, x): | |
if x == 0: | |
return 0 | |
else: | |
return (2*J+1)/(2*J)*coth((2*J+1)/(2*J)*x) - 1/(2*J)*coth(1/(2*J)*x) |
OlderNewer