Skip to content

Instantly share code, notes, and snippets.

# The double pendulum problem
# https://matplotlib.org/2.1.2/gallery/animation/double_pendulum_animated_sgskip.html
from numpy import sin, cos
import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate as integrate
import matplotlib.animation as animation
G = 9.8 # acceleration due to gravity, in m/s^2
import numpy as np
import matplotlib.pyplot as plt
#color= ['red', 'green', 'blue', 'magenta']
fig= plt.figure()
plt.xticks(rotation= 45,
ha= "right",
rotation_mode="anchor") #rotate the x-axis values
plt.subplots_adjust(bottom = 0.2,
@renyuanL
renyuanL / finalTerm2020_cnn.py
Created December 24, 2020 22:18
for Final Term Test in CGU @2020.12.25
#
# finalTerm2020_cnn.py
#
# # LeNet-5 MNIST Digits Classifier
# This notebook implements the classic LeNet-5 convolutional network [1] and applies it to MNIST digit classification. The basic architecture is shown in the figure below:
#
# ![](lenet-5_1.jpg)
@renyuanL
renyuanL / imagenet1000_clsidx_to_labels.txt
Created September 8, 2020 23:55 — forked from yrevar/imagenet1000_clsidx_to_labels.txt
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
'''
ryPythonHk002.py
解二元一次方程式002
'''
aMessage= '''
solve:
a x + b y = c
d x + e y = f
input:
'''
ryPythonHk001.py
解二元一次方程式001
'''
aMessage= '''
solve:
a x + b y = c
d x + e y = f
'''
ryYinyangRotation_en.py
After playing with yinyang.py in Turtle Graphics,
we will make it rotate.
use sin and cos from math module
for rotation computation
Renyuan
# -*- coding: utf-8 -*-
"""
Created on Tue May 10 14:15:38 2016
@author: csie3
financial data is here:
https://www.franklin.com.tw/Fund/NavHistory/101
===> f101.csv
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 20 10:08:12 2016
@author: csie3
"""
from thinkdsp import *
from pylab import *
@renyuanL
renyuanL / ryJim001.py
Created March 26, 2016 19:11
solving a math problem for Jimmy
#----------------------------------------------
'''
ryJim001.py
今天我要做的是,
從__(A)到_(B)_整數中,__(C)的倍數共有幾個。
Renyuan Lyu , 2016/03/27
'''