Skip to content

Commit

Permalink
10.14
Browse files Browse the repository at this point in the history
  • Loading branch information
bowling233 committed Oct 14, 2023
1 parent 840a40a commit bf31d3d
Show file tree
Hide file tree
Showing 9 changed files with 566 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/books/CTP.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ C Traps and Pitfalls

本章我们关注字符是如何组成符号的。

- 术语 **token** (符号)是语言的基本表意单元。字符组成符号。例子: `->``file` 都是符号.
- 术语 **token** (符号)是语言的基本表意单元。字符组成符号。例子: `->``file` 都是符号
- 同一组字符序列在**不同上下文**中可能属于不同符号。

我们来看几个例子,请思考这些程序的行为(注意运算符优先级)。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@

当初学多元微积分没学好,散度旋度啥的都忘光了。现在复习一下。




52 changes: 52 additions & 0 deletions docs/courses-zju/general-physics2/math.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 数学基础

## 几种坐标系

二维平面上的:

- 极坐标变换:$x=r\cos\theta,y=r\sin\theta$
- 雅可比行列式为 $r$。

三维空间中的:

- 球坐标变换:$x=r\sin\theta\cos\phi,y=r\sin\theta\sin\phi,z=r\cos\theta$
- 两个角分别是与 $x$ 轴和 $z$ 轴的夹角。
- 雅可比行列式为 $r^2\sin\theta$,与 $z$ 轴夹角。
- 柱坐标变换:$x=r\cos\theta,y=r\sin\theta,z=z$
- 雅可比行列式为 $r$。

一些概念

- 立体角:以观测点为球心,构造一个单位球面;任意物体投影到该单位球面上的投影面积,即为该物体相对于该观测点的立体角。$\Omega = \frac{S}{r^2}$,其中 $S$ 为球面上的面积,$r$ 为球心到球面的距离。
- 球面坐标系中,任意球面的极小面积为:$\mathrm{d}A = (r\sin\theta\,\mathrm{d}\varphi)(r \mathrm{d}\theta)=r^2(\sin\theta\,\mathrm{d}\theta\,\mathrm{d}\varphi)$,极小立体角为 $\mathrm{d}\Omega = \frac{\mathrm{d}A}{r^2} = \sin\theta\,\mathrm{d}\theta\,\mathrm{d}\varphi$
- 对极小立体角做曲面积分即可得立体角:$\Omega= \iint_S \mathrm{d}\Omega = \iint_S \sin\theta\,\mathrm{d}\theta\,\mathrm{d}\varphi$
- 定向曲面:$\Omega= \iint_S \frac{dA}{r^{2}} =\iint_S \frac { \vec{r} \cdot \textrm{d}\vec{S}}{\left| \vec{r} \right|\, r^2}= \iint_S \frac { \vec{r} \cdot \textrm{d}\vec{S}}{ r^3}$。
- 计算例:顶角为 $2\theta$ 的圆锥的立体角为 $\int_0^{2\pi} \int_0^{\theta} \sin \theta' \ d \theta' \ d \phi = 2\pi\int_0^{\theta} \sin \theta' \ d \theta' = 2\pi\left[ -\cos \theta' \right]_0^{\theta} \ = 2\pi\left(1 -\cos \theta \right)$.


## 其他

### 幂次前缀

| Prefix | Symbol | Factor |
| ------ | ------ | ------ |
| yotta | Y | $10^{24}$ |
| zetta | Z | $10^{21}$ |
| exa | E | $10^{18}$ |
| peta | P | $10^{15}$ |
| tera | T | $10^{12}$ |
| giga | G | $10^{9}$ |
| mega | M | $10^{6}$ |
| kilo | k | $10^{3}$ |
| hecto | h | $10^{2}$ |
| deca | da | $10^{1}$ |
| deci | d | $10^{-1}$ |
| centi | c | $10^{-2}$ |
| milli | m | $10^{-3}$ |
| micro | μ | $10^{-6}$ |
| nano | n | $10^{-9}$ |
| pico | p | $10^{-12}$ |
| femto | f | $10^{-15}$ |
| atto | a | $10^{-18}$ |
| zepto | z | $10^{-21}$ |
| yocto | y | $10^{-24}$ |
47 changes: 47 additions & 0 deletions docs/courses-zju/general-physics2/static_electric.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 电学

## 静止电荷的电场

### 电荷 库仑定律

- 电荷是相对论不变量,与运动无关。
- $e=1.6\times10^{-19}\mathrm{C}$
- 库仑定律
- $\varepsilon_0$ 真空电容率(permittivity of free space)或真空介电常数(dieletric constant of vacuum)。
- 库仑定律只适用于点电荷。与叠加原理结合能够求解静电学中所有问题。

$$
\begin{array}{l}
\vec{F}=\frac{1}{4\pi\varepsilon_0}\frac{q_1q_2}{r^2}\hat{r} \\
k = \frac{1}{4\pi\varepsilon_0}=9\times10^9\mathrm{N\cdot m^2/C^2} \\
\varepsilon_0=8.85\times10^{-12}\mathrm{C^2/N\cdot m^2}
\end{array}
$$


### 静电场 电场强度

- 没有物质作传递介质的超距作用是不存在的。
- 电磁场是物质存在的一种形态,分布在一定范围的空间里,具有能量、动量等属性,并通过交换场量子来实现相互作用的传递。电磁场的媒介子是光子,电荷间相互作用的传递速度也是电磁场的运动速度,光速。
- 静电场是**相对于观察者静止的电荷**在其周围激发的电场。
- 电场强度:$\vec{E}=\frac{\vec{F}}{q}$
- 电场强度形成矢量场 $\vec{E}(\vec{r})$。
- 电场强度叠加原理。
- 连续分布电荷电场强度:$\vec{E}=\int \mathrm{d}\vec{E}=k\int \frac{\mathrm{d}q}{r^2}\hat{r}$

<!-- prettier-ignore-start -->
!!! example "电偶极子"

两个大小相等符号相反的电荷,间距为 $l$,比所考虑的场点到它们的距离小得多时,称为电偶极子(electric dipole)。电偶极子的电偶极矩(electric dipole moment)为 $\vec{p}=q\vec{l}$,方向由负电荷指向正电荷。

- 在轴线延长线上计算电场强度:$\vec{E_A}=\frac{1}{4\pi\varepsilon_0}\frac{2\vec{p}}{x^3}$
- 在中垂线上计算电场强度:$\vec{E_B}=-\frac{1}{4\pi\varepsilon_0}\frac{\vec{p}}{y^3}$

远离电偶极子处场强与距离三次方成反比,与电偶极矩成正比。
<!-- prettier-ignore-end -->

<!-- prettier-ignore-start -->
!!! example "均匀带电直棒"

无限长带点直棒附近某点电场强度 $E = \frac{1}{4\pi\varepsilon_0}\frac{2\lambda}{r}$,其中 $\lambda$ 为电荷线密度。以上结论对靠近有限长直棒中部区域也近似成立。
<!-- prettier-ignore-end -->
165 changes: 163 additions & 2 deletions docs/courses-zjucs/digital-logic/hw1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
# Homework 1
<div class="cover" style="page-break-after:always;font-family:方正公文仿宋;width:100%;height:100%;border:none;margin: 0 auto;text-align:center;">
<div style="width:60%;margin: 0 auto;height:0;padding-bottom:10%;">
</br>
<img src="https://raw.githubusercontent.com/Keldos-Li/pictures/main/typora-latex-theme/ZJU-name.svg" alt="校名" style="width:100%;"/>
</div>
</br></br></br></br></br>
<div style="width:60%;margin: 0 auto;height:0;padding-bottom:40%;">
<img src="https://raw.githubusercontent.com/Keldos-Li/pictures/main/typora-latex-theme/ZJU-logo.svg" alt="校徽" style="width:100%;"/>
</div>
</br></br></br></br></br></br></br></br>
<span style="font-family:华文黑体Bold;text-align:center;font-size:20pt;margin: 10pt auto;line-height:30pt;">Logic and Computer Design Fundamentals</span>
<p style="text-align:center;font-size:14pt;margin: 0 auto">Homework 1</p>
</br>
</br>
<table style="border:none;text-align:center;width:72%;font-family:仿宋;font-size:14px; margin: 0 auto;">
<tbody style="font-family:方正公文仿宋;font-size:12pt;">
<tr style="font-weight:normal;">
<td style="width:20%;text-align:right;">Teacher</td>
<td style="width:2%">:</td>
<td style="width:40%;font-weight:normal;border-bottom: 1px solid;text-align:center;font-family:华文仿宋">马德 </td> </tr>
<tr style="font-weight:normal;">
<td style="width:20%;text-align:right;">Name</td>
<td style="width:2%">:</td>
<td style="width:40%;font-weight:normal;border-bottom: 1px solid;text-align:center;font-family:华文仿宋"> 朱宝林</td> </tr>
<tr style="font-weight:normal;">
<td style="width:20%;text-align:right;">Student ID</td>
<td style="width:2%">:</td>
<td style="width:40%;font-weight:normal;border-bottom: 1px solid;text-align:center;font-family:华文仿宋" </td> 3220106026 </tr>
<tr style="font-weight:normal;">
<td style="width:20%;text-align:right;">Date</td>
<td style="width:2%">:</td>
<td style="width:40%;font-weight:normal;border-bottom: 1px solid;text-align:center;font-family:华文仿宋">2023.10.06</td> </tr>
</tbody>
</table>
</div>

<!-- 注释语句:导出PDF时会在这里分页 -->

## 1-3 Number Systems

Expand All @@ -25,4 +61,129 @@

| Decimal | Binary | Octal | Hex |
| ------- | ------ | ----- | --- |
| 369.3125 | 101110001.0101 | 561.24 | 171.4 |
| 369.3125 | 1 0111 0001.0101 | 561.24 | 171.5 |
| 189.625 | 1011 1101.101 | 275.5 | BD.A |
| 214.625 | 1101 0110.1010 | 326.5 | D6.A |
| 61831.625 | 1111 0011 1100 1110.1010 | 171716.5 | F3C7.A |

## 1-12 Binary Multiplications

(a)

$$
\begin{equation*}\begin{array}{c}
\phantom{\times9999}1010\\
\underline{\times\phantom{9999}1100}\\
\phantom{\times9999999}0\\
\phantom{\times999999}0\phantom9\\
\phantom{\times99}1010\phantom{99}\\
\underline{\phantom{\times9}1010\phantom{999}}\\
\phantom{\times9}1111000
\end{array}\end{equation*}
$$

(b)

$$
\begin{equation*}\begin{array}{c}
\phantom{\times9999}0110\\
\underline{\times\phantom{9999}1001}\\
\phantom{\times9999}0110\\
\phantom{\times999999}0\phantom9\\
\phantom{\times99999}0\phantom{99}\\
\underline{\phantom{\times9}0110\phantom{999}}\\
\phantom{\times99}110110
\end{array}\end{equation*}
$$

(c)

$$
\begin{equation*}\begin{array}{c}
\phantom{\times9999}1111001\\
\underline{\times\phantom{99999}011101}\\
\phantom{\times9999}1111001\\
\phantom{\times999999999}0\phantom9\\
\phantom{\times99}1111001\phantom{99}\\
\phantom{\times9}1111001\phantom{999}\\
\underline{\phantom{\times}1111001\phantom{9999}}\\
\phantom{1}110110110101
\end{array}\end{equation*}
$$

## 1-13 Binary Divisions

```
1 0001
---------
101 | 101 0110
101
---
0110
0101
----
1
```

Quotient: $ 1 0001 $, Remainder: $ 1 $

## 1-16 Radix

(a)

$$
B\times r^2 + E\times r^1 + E\times r^0 = 2699\\
\Rightarrow r = 15
$$

(b)

$$
3\times r^2 + 6\times r^1 + 5\times r^0 = 194\\
\Rightarrow r = 7
$$

## 1-18 BCD

(a)

Decimal: 4867
Binary: 0001 0011 0000 0011

(b)

Decimal: 378.75
Binary: 0001 0111 1010.1100

## 1-19 BCD

$$
(715)_{10} = (0111\ 0001\ 0101)_{BCD}\\
(354)_{10} = (0011\ 0101\ 0100)_{BCD}
$$

## 1-28 Gray code

| Binary | Gray Code | Hexdecimal |
| ------ | --------- | ---------- |
| 0000 | 0000 | 0 |
| 0001 | 0001 | 1 |
| 0010 | 0011 | 2 |
| 0011 | 0010 | 3 |
| 0100 | 0110 | 4 |
| 0101 | 0111 | 5 |
| 0110 | 0101 | 6 |
| 0111 | 0100 | 7 |
| 1000 | 1100 | 8 |
| 1001 | 1101 | 9 |
| 1010 | 1111 | A |
| 1011 | 1110 | B |
| 1100 | 1010 | C |
| 1101 | 1011 | D |
| 1110 | 1001 | E |
| 1111 | 1000 | F |





Loading

0 comments on commit bf31d3d

Please sign in to comment.