Labels

Tuesday, December 11, 2018

Power spectrum

*MAINLY COPY FROM WIKI

 

Energy spectral density

Fourier transform
\[F[x(t)]  = \int_{-\infty}^{\infty} x(t)\exp(-i 2\pi f t) dt \]
inverse transform
\[ x(t) = \int_{-\infty}^{\infty} F[x(t)] \exp(i 2\pi f t) df \]

Energy spectral density describes how the energy of a signal or a time series is distributed with frequency. The term energy is used in the generalized sense of signal processing, that is, the energy E of a singal $x(t)$ is
 \begin{equation}\label{eq:1}
 E = \int_{-\infty}^{\infty} |x(t)|^2 dt.
\end{equation}

The energy spectral density is most suitable for signal with a finite total energy.

\[\int_{-\infty}^{\infty} |x(t)|^2 dt = \int_{-\infty}^{\infty} |\hat{x}(f)|^2 df, \]
where
\[ \hat{x}(f) = \int_{-\infty}^{\infty} \exp(-iwt) x(t) dt ,\]
is the Fourier transform of the signal and $w = 2\pi f$ is angular frequency.

Since the  integrate on the right-hand side is the energy of the signal (see eq 1), the integrand $|\hat{x}(f)|^2$ can be interpreted as a density function describing the energy per unit frequency contained in the signal at the frequency $f$.

The energy spectral density of a signal $x(t)$ is defined as
\[S_{xx}(f) = |\hat{x}(f)|^2. \]

The definition to a discrete signal with an infinite number of values $x_n$ such as a signal sampled at discrete times $x_n = x(n \Delta t)$:
\[S_{xx}(f) = | \sum_{n=1}^{N}\exp(-iw n\Delta t) x_n  \Delta t|^2 \]


Tuesday, November 6, 2018

Deal with file by C++

#include<fstream>

fstream wf("out.dat",ios::out | ios::trunc);
// fstream ofs; ofs.open("out.dat", ios::out | ios::trunc);

Sunday, November 4, 2018

Delay the program some time with C++

#include <chrono> 
#include <thread> 

int main(){
using namespace std::this_thread; /*sleep_for, sleep_until */
using namespace std::chrono; /* nanoseconds, system_clock, seconds */
sleep_for(nanoseconds(10)); 
//sleep_until(system_clock::now() + seconds(1)); 
}  
REFERENCE:
https://stackoverflow.com/questions/158585/how-do-you-add-a-timed-delay-to-a-c-program

Wednesday, October 31, 2018

Powerful string processor with c++

/*MYSTR.h*/
 #ifndef _mystr_
 #define _mystr_
 #include<string>
 #include<dirent.h>
 #include<vector>
 
 /* strim remove space from front/end of string */
 /* sreduce remove all redundancy space */
 /* sremove_spaces remove all of space in string */
 std::string strim(const std::string& str, const std::string& whitespace = " \t");
 std::string sreduce(const std::string& str,const std::string& fill = " ",const std::string& whitespace = " \t");
 std::string inline sremove_spaces(std::string str);
 std::vector lisidir(const char *path);
 #endif

Strengthen the matrix in Gun Scientific Library (GSL)

/* MYMATRIX.h */

 #include <stdio.h>
 #include <string.h>
 #include <vector>
 #include <assert.h>
 #include <gsl/gsl_linalg.h>
 #include <gsl/gsl_matrix.h>
 /* arbitrary maximum size */
 #define MAXSIZE 5000*10000 

 void print_matrix( const gsl_matrix *,const char *);
 void fprint_matrix( const char *filename, const gsl_matrix *m, const char *comment ="");
 gsl_matrix * fread_matrix( const char *filen, int *rows, int *clos, int transpose);
 gsl_matrix * vector2matrix(const std::vector<double> x,const std::vector<double>y);

Thursday, October 25, 2018

Resource tools

online math editor
https://www.mathcha.io


Harvard Fairbank Center for Chinese Studies
https://soundcloud.com/fairbank-center


Digital tools for researchers
Code Ocean is a research collaboration platform that provides researchers and developers an easy way to create, collaborate on, share, discover, and run code for private projects and to be published in academic journals and conferences.
Writefull is an app that gives feedback on your writing by checking your text against databases of correct language.


Second-Order Linear Differential Equations
https://www.stewartcalculus.com/data/CALCULUS%20Concepts%20and%20Contexts/upfiles/3c3-2ndOrderLinearEqns_Stu.pdf
http://tutorial.math.lamar.edu/Classes/DE/NonhomogeneousDE.aspx


Repl.it is a development environment that gives you an instant IDE to learn, build, collaborate, and host all on one platform.


Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud.
With Colaboratory you can write and execute code, save and share your analyses, and access powerful computing resources, all for free from your browser.


online pdf editor
https://online.sodapdf.com/#/home?r=view

itermplot
An awesome iTerm2 backend for Matplotlib, so you can plot directly in your terminal.

https://iris.ai/
Speed up literature review

Arxiv Sanity
Web interface for browsing, search and filtering recent arxiv submissions

tool collection
http://tools.kausalflow.com/

Fighting Internet Censorship in a Mass!


is a remote terminal application that supports intermittent connectivity, allows roaming, and provides speculative local echo and line editing of user keystrokes.

MATHS WITH PYTHON 3: DIFFUSION EQUATION

ping.pe

numerical solve differential eqn


Introduction to Scientific Python programming


Assimulo is a simulation package for solving ordinary differential equations. It is written in the high-level programming language Python and combines a variety of different solvers written in FORTRAN, C and even Python via a common high-level interface

Comparing measures of similarity between curves


http://bbs.vicl.net/forum-44-1.html

https://1lib.us/

https://delta.chat/en/  chat with mails

国际JCI认证的医院


opensource grammar check


watch movie online


GIZMO, PIERNIK, Athena++, stochastic-parker


Tuesday, October 23, 2018

Gamma emission from the interaction between cosmic rays and molecular cloud

\begin{split}
 \Phi_{\gamma} = & \frac{1}{4\pi d^2} \int dE'{ [\frac{4\pi}{c} \frac{dN}{dE'}(E')] *V} [ \frac{M_{mc}}{Vm_p}] \frac{d\sigma}{dE}(E,E')  c \\
 = & \frac{M_{mc}}{d^2m_p} \int dE' \frac{dN}{dE'}(E') \frac{d\sigma}{dE}(E,E')
\end{split}

\[ N \propto exp(-\frac{r^2}{4Dt}) \]

$E_{\gamma} \sim 10\%E_p$

Friday, October 19, 2018

Return a array from function in C language

void func1(double a[])
{
   /* code */
}


void func2(void)
{
   /*  double *t = (double *) malloc(sizeof(double)*array_length); */ //c++ 
   double *t = malloc(sizeof(double)*array_length);
   /* remember to free(t) later */
   /* code */
}


double * func3(double a[])
{
   /* code */
   return a;
}


REFERENCE:
https://stackoverflow.com/questions/3473438/return-array-in-a-function

Find the inverse of a matrix with C

This origin code is wrote by "mop" http://forums.codeguru.com/showthread.php?262248-Algorithm-for-matrix-inversion .
I made a little change.

If you use GSL library, there is a simple example to get the inverse of matrix https://lists.gnu.org/archive/html/help-gsl/2008-11/msg00001.html.

 #include<cstdlib>                                                                                                                                                                          
 #include<math.h>                                                                                                                                                                            
 #include<stdio.h>

float* MatrixInversion(float* A, int n)                                                                                                                                                      
{                                                                                                                                                                                            
// A = input matrix (n x n)                                                                                                                                                              
// n = dimension of A                                                                                                                                                                    
// AInverse = inverted matrix (n x n)                                                                                                                                                    
// This function inverts a matrix based on the Gauss Jordan method.                                                                                                                      
// The function returns 1 on success, 0 on failure.                                                                                                                                      
   int i, j, iPass, imx, icol, irow;                                                                                                                                                        
   float det, temp, pivot, factor;                                                                                                                                                          

   float* ac = (float*)calloc(n*n, sizeof(float));
   float* AInverse = (float*)calloc(n*n, sizeof(float));                                                                                                                                           
   det = 1;                                                                                                                                                                                 
                                                                                                                                                                             
   for (i = 0; i < n; i++)                                                                                                                                                                  
   {                                                                                                                                                                                        
       for (j = 0; j < n; j++)                                                                                                                                                              
       {                                                                                                                                                                                    
           //AInverse[0] = 0;                                                                                                                                                               
           AInverse[n*i+j] = 0;                                                                                                                                                             
           ac[n*i+j] = A[n*i+j];                                                                                                                                                            
       }                                                                                                                                                                                    
       AInverse[n*i+i] = 1.;                                                                                                                                                                
   }                                                                                                                                                                                        
   fprintf(stderr,"%f %f %f %f\n",AInverse[0],AInverse[1],AInverse[2],AInverse[3] );                                                                                                                

// The current pivot row is iPass.                                                                                                                                                       
// For each pass, first find the maximum element in the pivot column.                                                                                                                    
   for (iPass = 0; iPass < n; iPass++)                                                                                                                                                      
   {                                                                                                                                                                                        
       imx = iPass;                                                                                                                                                                         
       for (irow = iPass; irow < n; irow++)                                                                                                                                                 
       { 
           if (fabs(A[n*irow+iPass]) > fabs(A[n*imx+iPass])) imx = irow;                                                                                                                    
       }                                                                                                                                                                                    
// Interchange the elements of row iPass and row imx in both A and AInverse.                                                                                                         
       if (imx != iPass)                                                                                                                                                                    
       {                                                                                                                                                                                    
           for (icol = 0; icol < n; icol++)                                                                                                                                                 
           {                                                                                                                                                                                
               temp = AInverse[n*iPass+icol];                                                                                                                                               
               AInverse[n*iPass+icol] = AInverse[n*imx+icol];                                                                                                                               
               AInverse[n*imx+icol] = temp;                                                                                                                                                 

               if (icol >= iPass)                                                                                                                                                           
               {                                                                                                                                                                            
                   temp = A[n*iPass+icol];                                                                                                                                                  
                   A[n*iPass+icol] = A[n*imx+icol];                                                                                                                                         
                   A[n*imx+icol] = temp;                                                                                                                                                    
               }                                                                                                                                                                            
           }                                                                                                                                                                                
       }                                                                                                                                                                                    

// The current pivot is now A[iPass][iPass].                                                                                                                                         
// The determinant is the product of the pivot elements.                                                                                                                             
       pivot = A[n*iPass+iPass];                                                                                                                                                            
       det = det * pivot;                                                                                                                                                                   
       if (det == 0)                                                                                                                                                                        
       {                                                                                                                                                                                    
           free(ac);                                                                                                                                                                        
           fprintf(stderr,"No inverse exit\n");                                                                                                                                                                        
       }                                                                                                                                                                                    

       for (icol = 0; icol < n; icol++)  
       {                                                                                                                                                                                    
// Normalize the pivot row by dividing by the pivot element.                                                                                                                     
           AInverse[n*iPass+icol] = AInverse[n*iPass+icol] / pivot;                                                                                                                         
           if (icol >= iPass) A[n*iPass+icol] = A[n*iPass+icol] / pivot;                                                                                                                    
       }                                                                                                                                                                                    

       for (irow = 0; irow < n; irow++)                                                                                                                                                     
// Add a multiple of the pivot row to each row.  The multiple factor                                                                                                                 
// is chosen so that the element of A on the pivot column is 0.                                                                                                                      
       {                                                                                                                                                                                    
           if (irow != iPass) factor = A[n*irow+iPass];                                                                                                                                     
           for (icol = 0; icol < n; icol++)                                                                                                                                                 
           {                                                                                                                                                                                
               if (irow != iPass)                                                                                                                                                           
               {                                                                                                                                                                            
                   AInverse[n*irow+icol] -= factor * AInverse[n*iPass+icol];                                                                                                                
                   A[n*irow+icol] -= factor * A[n*iPass+icol];                                                                                                                              
               }                                                                                                                                                                            
           }                                                                                                                                                                                
        }                                                                                                                                                                                    
    }                                                                                                                                                                                        

//    printf("%f %f %f %f\n",AInverse[0],AInverse[1],AInverse[2],AInverse[3] );                                                                                                              
    free(ac);                                                                                                                                                                                
    return AInverse;                                                                                                                                                                         
}                                                                                                                                                                                            


#if 1  // compare the result with one example from https://www.mathsisfun.com/algebra/matrix-inverse.html                                                                                                                                                                                   
int main()                                                                                                                                                                              {                                                                                                                                                                                            
   float a[4] = {3,3.5,3.2,3.6};                                                                                                                                                                      
   float *c;                                                                                                                                                                                
   c = MatrixInversion(a,2);                                                                                                                                                                
   printf("%f %f %f %f\n",c[0],c[1],c[2],c[3]);                                                                                                                                             
   free(c);
}                                          
#endif

REFERENCE:
list above.

Sunday, October 14, 2018

My linux command and setting collection



mostly from https://stackoverflow.com

nohup command >/dev/null 2>&1 &

jobs -l

ps -f -U

ps -ef | grep "command name"


history #show history command

fc [-e true] pid1 pid2 #repeat command with pid1 to pid2

copy between terminal

a) gvim -v
 In editor :echo has("clipboard")
set clipboard=unnamedplus


b)
esc m a
esc m b
:'a,'b w! xfer
ESC :r xfer


Thursday, October 11, 2018

The solution of cosmic ray propagation equation



transport equation

\[ \nabla  \cdot (D \nabla N_e) + \frac{\partial}{\partial E}(\frac{dE}{dt}N_e) + Q_e = \frac{\partial N_e}{\partial t} \]

energy change of particle
\[ E(t+dt) = E(t) + \frac{dE}{dt}dt \]
\[ dt = \frac{dE}{dE/dt} \]
\[ \int_{t_1}^{t_2} dt = \int_{E_1}^{E_2}  \frac{dE}{dE/dt} \]

if $dE/dt \equiv -b(E) = -aE^2 $  and $t_2>t_1$
\[ t_2 - t_1 = \frac{1}{a}[ \frac{1}{E_2} - \frac{1}{E_1}] \]
\[E(t_1) = \frac{E(t_2)}{1-a(t_2-t_1)E(t_2)} \]
and
\[E(t_2) = \frac{E(t_1)}{1+a (t_2-t_1)E(t_1)} \]

green function
\begin{equation}\nonumber
 G_e(\vec{r},\vec{r}',E,E',t,t') = \frac{1}{[\pi 4 f(E,E')]^{3/2}b(E)} \exp[\frac{-(\vec{r}'-\vec{r})^2}{4f(E,E')}]\cdot \delta(t'-t+h(E,E'))
\end{equation}

$f(E,E') = \int_{E'}^E  D(u)\frac{du}{du/dt} $ and $h(E,E') = \int_{E'}^E \frac{du}{du/dt}$

$\delta$ function
\[ \delta(g(x)) = \sum_i  \frac{\delta(x-x_i)}{|g^\prime(x_i)|} \]
$t>t'$    the time axis  ------t'---------t----->
$\delta(t' - t + h)$
\[ h = \int_{E'}^{E}  \frac{dE}{dE/dt} = - \frac{1}{a} [ \frac{1}{E^\prime} - \frac{1}{E} ]  \]
$g(E') = t'-t+h = t'-t + \frac{1}{a}[\frac{1}{E}-\frac{1}{E'}]$
$g(E') = t'-t + \frac{1}{a}[\frac{1}{E}-\frac{1}{E'}] = 0$
$g'(E') = \frac{1}{a{E^\prime}^2}$

\begin{equation}
\delta(t' - t + h)  =  \delta(t' - t  + [- \frac{1}{a}  (\frac{1}{E^\prime} - \frac{1}{E} )  ])
                                 =  \delta(E' -\frac{E}{1 -a (t-t')E}) \cdot [a (\frac{E}{1-a(t-t')E})^2]
\end{equation}

The solution of transport equation is given by
\begin{equation}\nonumber
\begin{split}
 N_e(\vec{r},E,t)  &= \int \int \int d\vec{r}' dE' dt' G_e(\vec{r},\vec{r}',E,E',t,t')Q_e(\vec{r}',E',t') \\
                              &= \int dt' \int d\vec{r}'  \frac{b(E')}{b(E)} \frac{Q_e(\vec{r}',E',t')}{(4\pi f(E,E'))^{3/2}} \exp{[\frac{-(\vec{r}' - \vec r)^2}{4f(E,E')}]}
\end{split}
\end{equation}
In this equation, the $E'$ is given by $E' =  \frac{E}{1-a(t-t')E}$.


In fact, the solution \[  N(\vec{r},E,t)  = \int dt' \int d\vec{r}'  \frac{b(E')}{b(E)} \frac{Q(\vec{r}',E',t')}{(4\pi f(E,E'))^{3/2}} \exp{[\frac{-(\vec{r}' - \vec r)^2}{4f(E,E')}]} \]
is general. It doesn't  depend on the assumption of the form of energy loss.
if we expand $\delta(t'-t + \int_{E'}^{E} \frac{dE}{dE/dt})$ directly, we can get the general solution. In this case $E'$ is a function of $E$ and $t-t'$.


Wednesday, October 10, 2018

Custom css style

CHANGE THE LINE HEIGHT OF YOUR TEXT
<span style=”line-height:150%;”>Text here.</span>
CHANGE THE SPACING BETWEEN LETTERS
<span style=”letter-spacing: 2px;”>Text here. </span>
CREATE SPACE AROUND YOUR TEXT
<span style=”padding:5px;”>Text here. </span>
<span style=”padding-bottom:20px;”>Text here. </span>
<span style=“padding-top:5px;padding-right:15px;”>Text here. </span>
CHANGE THE TEXT COLOR
<span style=”color:#CAE3DA”>Text here. </span>
PUTTING IT ALL TOGETHER
<span style=”font-size: 3em; color: #cae3da; letter-spacing: 5px; line-height: 200%; padding: 20px;”> This is just a few of the things the Span tag can do.</span>


REFEREENCE
THE ONE PIECE OF CODE EVERY BLOGGER SHOULD KNOW
http://saraheggers.com/2016/05/25/span/

Visit blogspot through ipv6

You need to add the ipv6 address of googleblog.blogspot.com into your host file.

for Linux
sudo vi /etc/hosts
and add this line in the file.
2404:6800:4008:c06::84 your blogger domain

You should check the ipv6 address, because it will be changed sometime.
Now you can visit your blogger.

REFEREBCE
For some reason, the reference is not showed.

Python symbol computation package sympy


SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python.

online sympy https://www.sympygamma.com/

from sympy import *

#define variable
x = Symbol('x')
y = Symbol('y')
a, b, c = symbols('a,b,c')

#expand
expand((x + y)**3)
expand(sin(x+y),trig=True)

#simplify
simplify((x + x*y) / x)

#limit
#limit(function, variable, point)
limit(sin(x)/x,x,0)
limit(1/x, x, oo)
limit( (sin(x+y) - sin(x))/y,y,0)

#diff
#diff(func,var,n)
diff(sin(x),x)
diff(sin(x),x,2)

#taylor series
#series(expr, var)
series(sin(x),x)

#integrate
integrate(x**2,x)
integrate(2*x + sinh(x), x)
integrate(exp(-x**2)*erf(x), x)
-----
integrate(x**3, (x, -1, 1))
integrate(exp(-x), (x, 0, oo))
integrate(exp(-x**2), (x, -oo, oo))

#factor
factor(x**2-1)

#solve equation
solve(x**4 - 1, x)
solve([x + 5*y - 2, -3*x + 6*y - 15], [x, y])

#matrix
A = Matrix([[1,x], [y,1]])

#dsolve
f, g = symbols('f g', cls=Function)
dsolve(f(x).diff(x, x) + f(x), f(x))

# real and positive variable
from sympy import symbols integrate
a,b,k=symbols('a,b,k',real=True,positive=True)
f=k**2/(k**2+a**2)/(1+k**2*b**2)**(5/6)
g=integrate(f,(k,-oo,oo))


REFERENCE
https://wizardforcel.gitbooks.io/scipy-lecture-notes/content/15.html

Saturday, September 22, 2018

Cosmic rays propagation equation

the particles number through energy boundary in $dt$ is $dN$
(E+dE)-------->|(E)-------->(E-dE)
boundary

\[ dN = \int_E^{E+dE} dN/dE(E) dE = dN/dE(E_0)dE \approx dN(E)/dEdE  = \frac{dN(E)}{dE}\frac{dE}{dt} dt\]

the number of particles that pass through the energy boundary per unit of time,
\[ J_E = \frac{dN}{dt} = \frac{dN}{dE}\frac{dE}{dt} \]


----------------->[(E+dE)------------------](E)--------------->

the change of particle number due to energy variation within energy interval $[E,E+dE]$ per unit time if $dE/dt<0$.

\begin{equation}
\begin{split}
 \frac{dN}{dt} & =  dN/dE(E+dE)d(E+dE)/dt  - dN/dE(E)dE/dt \\
& = [dN/dE(E)+\frac{d^2N}{dE^2}(E) dE] \cdot [dE/dt + \frac{d^2E}{dEdt}(E)dE ] - dN/dE(E)dE/dt \\
& =  \frac{d}{dE}(\frac{dN}{dE}(E)\frac{dE}{dt}) \cdot dE
\end{split}
\end{equation}

thus,  \[ \frac{dN}{dEdt} = \frac{d}{dE}(\frac{dN}{dE}(E)\frac{dE}{dt}) = \frac{dJ_E}{dE} \]



the change of particle number due to motion

Some operation about vector and tensor

derivative of a vector

\[ Y = (y_1(x_1,x_2,x_3) ,y_2(x_1,x_2,x_3),y_3(x_1,x_2,x_3)) \]
\[ dy_1 = dy_1/dx_1 \cdot dx_1+ \ldots = \sum_i^3 \frac{dy_1}{dx_i} \cdot dx_i\]
\[ dy_i =  \sum_i^3 \frac{dy_1}{dx_i} dx_i \]

\begin{align}
dy_i = \begin{pmatrix}
dy_i/dx_1 &dy_i/dx_2 &dy_i/dx_3
\end{pmatrix} \,
\begin{pmatrix}
dx_1 \\
dx_2 \\
dx_3 \\
\end{pmatrix}
\end{align}

\begin{align}
\begin{pmatrix}
dy_1 \\
dy_2 \\
dy_3 \\
\end{pmatrix} =
\begin{pmatrix}
dy_1/dx_1 &dy_1/dx_2 &dy_1/dx_3 \\
dy_2/dx_1 &dy_2/dx_2 &dy_2/dx_3 \\
dy_3/dx_1 &dy_3/dx_2 &dy_3/dx_3 \\
\end{pmatrix} \,
\begin{pmatrix}
dx_1 \\
dx_2 \\
dx_3 \\
\end{pmatrix}
\end{align}

\begin{equation}
\frac{d\vec{y}}{d\vec{x}} =
\begin{bmatrix}
dy_1/dx_1 &dy_1/dx_2 &dy_1/dx_3 \\
dy_2/dx_1 &dy_2/dx_2 &dy_2/dx_3 \\
dy_3/dx_1 &dy_3/dx_2 &dy_3/dx_3 \\
\end{bmatrix}
\end{equation}

2 double dot product of two tensor
\[\vec{T}:\vec{U} = \sum_i\sum_j T_{ij}U_{ji}\]

3 the dot product of a tensor with a vector
\[ \vec{T}\cdot \vec{v} = \sum_i \vec{\delta}_i  (\sum_j T_{ij}v_j)  \]

4 the dot product of a vector with a tensor
\[\vec{v}\cdot{T} = \sum_i \vec{\delta}_i  (\sum_j T_{ji}) v_j \]

5. unit tensor 
\[ \nabla \cdot \vec{I} = 0 \]
\[ \vec{v} \cdot \vec{I} = \vec{v} \]

6. vector dot gradient of tensor
\[ \vec{A} \cdot \nabla \cdot \vec{T} = \nabla \cdot( \vec{A} cdot \vec{T}) - \vec{T}:\nabla \vec{A} \]

Tuesday, September 18, 2018

First order partial different equation

\[\frac{\partial u}{\partial t} + c(x,t)\frac{\partial u}{\partial x} = 0\]
find a curve that the u is constant along it.

\[ du = \frac{\partial u}{\partial t}dt + \frac{ \partial u}{\partial x}dx \]
\[ t = t(r),\qquad x=x(r) \]
\[ dt = \frac{dt}{dr} dr,\qquad dx = \frac{dx}{dr} dr\]

\[\frac{du}{dr} = \frac{\partial u}{\partial t}\frac{dt}{dr} + \frac{ \partial u}{\partial x}\frac{dx}{dr} \]

we hope $du=0$,then along the curve, the u is constant.
$\frac{du}{dr} = 0 = \frac{\partial u}{\partial t} + c(x,t)\frac{\partial u}{\partial x}$
we get \[\frac{dt}{dr}=1\],and \[\frac{dx}{dr}=c(x,t)\].
they determine the characteristic curve.
\[u(t(r1),x(r1) = u(t(r2),x(r2))\]



Guide to chromebook

screen ctrl + switch window -> full screenshot
ctrl shift switch -> select area

shortcuts of chromebook
https://support.google.com/chromebook/answer/183101?hl=en

latex on chromebook
https://github.com/macbuse/Chromebook/blob/master/LaTeX.md

chrome as text editor
data:text/html, <body contenteditable style="font: 1.5rem/1.5 monospace;max-width:60rem;margin:0 auto;padding:4rem;">

rotate screen
ctrl shift refresh

Friday, September 14, 2018

Force-field solution to solar modulation


propagation equation


\begin{equation}
\frac{\partial f}{\partial t} + \nabla \cdot (C \vec{V}_{sw} f - K \cdot \nabla f) - \frac{1}{3p^2} \frac{\partial (p^3V_{sw}\cdot \nabla f)}{\partial p} =0 \label{eq1}
\end{equation}

$C = -1/3\frac{\partial lnf}{\partial lnp}$

stream current density
\begin{equation}
J = C V_{sw} f - K \cdot \nabla f \label{eq:stream}
\end{equation}

\begin{equation}
K = \begin{bmatrix}
k_{rr} &k_{r\theta} &k_{r\phi} \\
k_{\theta r} &k_{\theta\theta} &k_{\theta\phi} \\
k_{\phi r} &k_{\phi\theta} &k_{\phi\phi}
\end{bmatrix} \nonumber
\end{equation}

$k_{rr} = k_{\parallel}\cos^2(\psi) + k_{\perp,r}\sin^2(\psi)$
$\tan\psi = r*\Omega/V_{sw}$

$\nabla = \hat r \frac{\partial}{\partial r} + \frac{\hat \theta}{r} \frac{\partial}{\partial \theta} + \frac{\hat \phi}{r \sin(\theta)} \frac{\partial}{\partial \phi}$
The dot product of a tensor with a vector is:
$A\cdot B = i(A_{11} B_1 + A_{12}B_2 + A_{13}B_3) + j(A_{21}B_1 + A_{22}B_2 + A_{23}B_3) + k(A_{31}B_1 + A_{32}B_2 + A_{33}B_3)$



Tuesday, September 11, 2018

One example for syntax hightlight in blogspot

Follow the guide https://eric0806.blogspot.com/2014/04/blogger-google-code-prettify.html .

#include&ltstdio.h&gt
int main (void)
{
    print("Hello World");
    return 0;
}
$E=mC^2$


xxx

Some online proxy to access blocked website

Many website are blocked in a few country.
So, if we want to use google search or watch video in youtube, you need to use some tricks. The online web proxy is a convenient method. But I am not sure that whether it is safe or not. You should not sign you account on these proxy.



1)https://www.freeproxyserver.co/
2)https://proxysite.io/
3)https://www.proxysite.com/
4)https://www.vpnbook.com/webproxy

If these proxy are invalid, you should go to www.searx.me to search online proxy, you will find a useful one.



Monday, September 10, 2018

Find similar astronomy papers on arxiv.org

There are too many paper everyday emerge on arxiv.org. It's not simple to find most useful paper. But if you already have some clues, such as having some paper on hands, you can base on these paper find out other related paper.

There are one power tool which can be used to complete this task. It's called deepthought. For the detail, the reader can refer to Knowledge discovery through text-based similarity searches for astronomy literature (arXiv:1705.05840).
                                       http://opensupernova.org/deepthought/
It deserves having a try.

Sunday, September 9, 2018

My write plan in Blogger

This blog will be used to record some usages about linux, c++ and python. I am also going to write some posts about my research work.
Please visit my blog often.
See you later.


Insert formula in google blogger

how to insert formula in google blogger ?

when I search in google, I get one answer. I think it's also very helpful for you.
https://productforums.google.com/forum/#!topic/blogger/_LzlfFT7I



$E = mC^2$

Other reference
https://support.google.com/blogger/forum/AAAAY7oIW-wJB67ApTH4zw/?hl=en&gpf=%23!msg%2Fblogger%2FJB67ApTH4zw%2FEyLkBJxEAgAJ&msgid=EyLkBJxEAgAJ
https://www.airinaa.com/2018/04/add-mathjax-beautiful-mathematic.html?m=1