這篇文章是專門(mén)寫(xiě)給我的學(xué)妹——某傻璐
第一步
1.在簡(jiǎn)書(shū)中注冊(cè)一個(gè)賬號(hào)
2.然后點(diǎn)擊紅色區(qū)塊開(kāi)始寫(xiě)文章
(1.1)
3.然后進(jìn)入左下方的設(shè)置選項(xiàng)中编丘,設(shè)置編輯器為markdown
(1.2)
(1.3)
4.回到寫(xiě)文章的地方与学,在右上角點(diǎn)擊新建文集
(1.4)
這里我新建了一個(gè)名為“曾梓龍”的文集
5.然后點(diǎn)擊新建文章
(1.5)
6.新建文章之后切換到預(yù)覽模式,開(kāi)始寫(xiě)作
(1.6)
7.進(jìn)入預(yù)覽模式
(1.7)
第二步
1.markdown的基本語(yǔ)法
(2.1)
(2.2)
(2.3)
(2.4)
至于代碼的引用用這個(gè)符號(hào):```
兩個(gè)這樣的符號(hào)包括代碼框瘪吏,就引用了代碼,如下圖所示:
(2.5)
(2.6)
2.latex語(yǔ)法
如果你想輸入公式,就得用到latex蜗巧,但是github不支持掌眠,所以我們轉(zhuǎn)移到簡(jiǎn)書(shū)寫(xiě),簡(jiǎn)書(shū)寫(xiě)挺方便的幕屹。latex的教程地址在這蓝丙,你在那個(gè)網(wǎng)站學(xué)一下怎么輸入方程就行
第三步(代碼部分)
1.這次作業(yè)你先看一下前面的例題级遭,就是鈾原子衰變的那道題,先把方程轉(zhuǎn)化一下渺尘,至于方程的轉(zhuǎn)化看這里挫鸽,這是我自己寫(xiě)的
2.鈾原子衰變的python代碼
# -*- coding: utf-8 -*- #是為了告訴Python解釋器,按照UTF-8編碼讀取源代碼鸥跟,丢郊,否則,你在源代碼中寫(xiě)的中文輸出可能會(huì)有亂碼医咨。
import numpy as np
import pylab as pl
Number=[]
t=[]
print("the number of uranium atoms ->")
number_u=input()
Number.append(number_u)
print("the time of decay ->")
t_decay=input()
print("the time step ->")
dt=input()
t_max=dt*100
t.append(0.0)
for i in range(100):
N=Number[i]-(Number[i]/t_decay)*dt
tadd=t[i]+dt
Number.append(N)
t.append(tadd)
pl.plot(t,Number) #將兩個(gè)列表數(shù)據(jù)導(dǎo)入
pl.title('the decay of uranium') #圖標(biāo)的名稱
pl.xlabel('the time of decaying') #橫軸的標(biāo)簽
pl.ylabel('number of atoms') #縱軸標(biāo)簽
pl.xlim(0.0,t_max) #橫軸的坐標(biāo)范圍
pl.ylim(0.0,100) #縱軸坐標(biāo)范圍
pl.show() #輸出圖表
3.作業(yè)的代碼
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as pl
Number_A=[]
Number_B=[]
t=[]
print("the number of A atoms ->")
number_a=input()
Number_A.append(number_a)
print("the number of B atoms ->")
number_b=input()
Number_B.append(number_b)
print("the time of decay ->")
t_decay=input()
print("the time step ->")
dt=input()
def Bigger(a,b):
if a>b:
return a
else:
return b
def Smaller(a,b):
if a>b:
return b
else:
return a
big=Bigger(Number_A[0],Number_B[0])
small=Smaller(Number_A[0],Number_B[0])
t.append(0.0)
for i in range(100):
NA=Number_A[i]+((Number_B[i]-Number_A[i])/t_decay)*dt
NB=Number_B[i]+((Number_A[i]-Number_B[i])/t_decay)*dt
tadd=t[i]+dt
Number_A.append(NA)
Number_B.append(NB)
t.append(tadd)
t_max=t[-1]
pl.plot(t,Number_A,color="blue",linewidth=2.5,linestyle="-",label="A atom")
pl.plot(t,Number_B,color="red",linewidth=2.5,linestyle="-",label="B atom")
pl.title('the decay between A and B')
pl.xlabel('the time of decaying')
pl.ylabel('number of atoms')
pl.xlim(0.0,t_max)
pl.ylim(small,big)
pl.text(t[len(t)//2],((big-small)//2),r'Number_A[0]=NA,Number_B[0]=NB')
pl.legend(loc='upper right')
pl.show()
第四步:結(jié)果
1.鈾原子衰變
(4.1)
2.作業(yè)的圖像
(4.2)
結(jié)束