简体   繁体   English

如何在Jupyter Notebook Markdown中编写分段函数?

[英]How to write piecewise function in jupyter notebook markdown?

I'm trying to write a piecewise function in markdown on jupyter and jupyter is being spooky. 我正在尝试在jupyter的markdown中编写分段功能,而jupyter令人毛骨悚然。 Out of three functions, it only displays one properly (the $n_o$ one), even though they are all written in the same manner. 在这三个函数中,即使它们都是以相同的方式编写的,它也只能正确显示一个($ n_o $一个)。

Is there a more elegant way to write this up? 有没有更优雅的方式来写这个?

$$ N(a)=  \left\{
\begin{array}{ll}
      n_o & A>A_{krit} \\
      n_o+2 & A=A_{krit} \\
      n_o+4 & A<A_{krit} \\
\end{array} 
\right, $$

gdje je: $$A=\frac{1}{|a|},$$ 

$$ A_{krit}(a)=  \left\{
\begin{array}{ll}
      \frac{\sin(2\pi*floor(\frac{|a|}{2*\pi})+\frac{\pi}{2})}{2\pi*floor(\frac{|a|}{2*\pi})+\frac{\pi}{2}} & a>0 \\
      \frac{\sin(2\pi*floor(\frac{|a|}{2*\pi})+\frac{3\pi}{2})}{2\pi*floor(\frac{|a|}{2*\pi})+\frac{3\pi}{2}} & a<0\\
\end{array} 
\right, $$ i

$$ n_o(a)=  \left\{
\begin{array}{ll}
      |floor(\frac{|a|}{2*\pi})-1| & a>2\pi \\
      |floor(\frac{|a|}{2*\pi})-1|-2 & 0<a<2\pi \land A\leq A_{krit} \\
      floor(\frac{|a|}{2*\pi})+1 & a<0 \\
\end{array} 
\right. $$ 

It seems there is spacing issue in your latex code. 您的乳胶代码中似乎存在间距问题。 I just modified little bit, it works: 我只是修改了一点,它的工作原理是:

    $$ N(a)=   \left\{
\begin{array}{ll}
      n_o & A>A_{krit} \\
      n_o+2 & A=A_{krit} \\
      n_o+4 & A<A_{krit} \\
\end{array} 
\right.  $$


gdje je: $$A=\frac{1}{|a|},$$ 

$$ A_{krit}(a)=   \left\{
\begin{array}{ll}
      \frac{\sin(2\pi*floor(\frac{|a|}{2*\pi})+\frac{\pi}{2})}{2\pi*floor(\frac{|a|}{2*\pi})+\frac{\pi}{2}} & a>0 \\
      \frac{\sin(2\pi*floor(\frac{|a|}{2*\pi})+\frac{3\pi}{2})}{2\pi*floor(\frac{|a|}{2*\pi})+\frac{3\pi}{2}} & a<0\\
\end{array} 
\right.  $$ i

$$ n_o(a)=  \left\{
\begin{array}{ll}
      |floor(\frac{|a|}{2*\pi})-1| & a>2\pi \\
      |floor(\frac{|a|}{2*\pi})-1|-2 & 0<a<2\pi \land A\leq A_{krit} \\
      floor(\frac{|a|}{2*\pi})+1 & a<0 \\
\end{array} 
\right. $$ 

样本演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM