# Complete-ASM-NN on water flow: von Karman effect
## Simulation
Water flow simulation of cylinder von Karman effect

:::info
**Reynolds number** = density of the fluid$\times$flow speed$\times$characteristic linear dimension/dynamic viscosity of the fluid
**Reynolds number** determines the behavior
:::




## data summary

:::info
x-axis: sample time (unit: 500s)
y-axis: location (unit: 0.1m)
entry value: water x-velocity (unit: m/s)
:::
| Min | 25th Percentile | Median | 75th Percentile | Max
| -------- | -------- | -------- |-------- | -------- |
| 6.258897e-06 | 7.727324e-05 | 1.1245722e-04 | 1.219506e-04 | 1.39250e-04 |
| **Mean** | **std** | -------- |-------- | -------- |
| 9.7317653e-05 | 3.317341e-05 | Text | Text | Text |
## ASM Implementation
| v_f | v_c | sigma | zeta |v_threshold |v_delta |
| -------- | -------- | -------- |-------- | -------- |-------- |
| 0.0001 | -0.0001 | 0.5 | 250 |0.00009 |0.00004|
The reconstruction error 1 is 0.13853908996947964
The reconstruction error 2 is 0.14163856893550444

### Complete-ASM-NN results:
The training error is 0.020063613855071518
The reconstruction error is 0.10146872252500364

The training error is 0.02031472284401133
The reconstruction error is 0.09989442553699493

The training error is 0.020254287805192273
The reconstruction error is 0.09980701034450298

**Additional attempts**
| v_f | v_c | sigma | zeta |v_threshold |v_delta |
| -------- | -------- | -------- |-------- | -------- |-------- |
| 0.00011 | -0.00011 | 0.4 | 1000 |1 |1|
The reconstruction error 1 is 0.11869534759921051
The reconstruction error 2 is 0.12113336954054438

Modified Cost Function Filter : $[[-0.5,-0.5,0],[-1.,3.,0],[-0.5,-0.5,0]]$
The training error is 0.009492165068873109
The reconstruction error is 0.09988091259620421

### ASM-NN results:
### Two a priori estimates
| v_f | v_c | sigma | zeta |v_threshold |v_delta |
| -------- | -------- | -------- |-------- | -------- |-------- |
| 0.00011 | -0.00011 | 0.5 | 1000 |0.00009 |0.00004|
The training error is 0.08592179626054416
The reconstruction error is 0.1315701121928401

The training error is 0.0859217793442029
The reconstruction error is 0.13156315163192406

### Multiple a priori estimates
The training error is 0.08259863177054745
The reconstruction error is 0.13143098690736998

The training error is 0.08217246402415788
The reconstruction error is 0.13146017543236363

## Alternative Smoothing Kernel
### Gaussian Kernel (Complete-ASM-NN)
The training error is 0.005021960923631318
The reconstruction error is 0.10143207932520176

The training error is 0.005138579360834681
The reconstruction error is 0.10128620831094266

### Cauchy Kernel
$$
\phi(x,t) = \frac{1}{1+\frac{x^2}{\sigma^2}+\frac{t^2}{\zeta^2}}
$$
The reconstruction error 1 is 0.14026903020295003
The reconstruction error 2 is 0.13761133793341268

The training error is 0.1759526733093271
The reconstruction error is 0.20033726020575182

The training error is 0.006275701106173028
The reconstruction error is 0.16254095612308483

### Inverse Multiquadric Kernel
$$
\phi(x,t) = \frac{1}{\sqrt{\frac{x^2}{\sigma^2}+\frac{t^2}{\zeta^2}+c^2}}
$$
The training error is 0.09169232114366106
The reconstruction error is 0.19937711814144976

### custom kernel
$$
\phi(x,t) = \exp{(-\frac{x^2}{\sigma^2}-\frac{t^2}{\zeta^2}-\alpha*\frac{(t-\tau)^2}{\zeta^2})}
$$
The training error is 0.02909929568433578
The reconstruction error is 0.10109650438169683

The training error is 0.029152675199157513
The reconstruction error is 0.10119950206446994

### Extra degree of freedom on $\sigma,\zeta,\tau$
$$
\phi_c(x,t) = \exp{(-\frac{x^2}{\sigma_1^2}-\frac{(t-\tau)^2}{\zeta_1^2})} \\
\phi_f(x,t) = \exp{(-\frac{x^2}{\sigma_2^2}-\frac{(t)^2}{\zeta_2^2})}
$$
The training error is 0.04531668754880319
The reconstruction error is 0.09971007092771234

### Weighted sum replaced by ConvAutoEncoder
The training error is 0.07586432653848106
The reconstruction error is 0.10865212880642654

### wave bases
$$
\phi_c(x,t) = \cos(\alpha*(\frac{x^2}{\sigma_1^2}+\frac{t^2}{\zeta_1^2}))\exp{(-\frac{x^2}{\sigma_1^2}-\frac{t^2}{\zeta_1^2})} \\
\phi_f(x,t) = \exp{(-\frac{x^2}{\sigma_2^2}-\frac{(t-\tau)^2}{\zeta_2^2})}
$$
| sigma_c | zeta_c | sigma_f | zeta_f |tau |alpha |
| -------- | -------- | -------- |-------- | -------- |-------- |
| 0.4 | 1000 | 0.005 | 500 |5000 |1.75|
The reconstruction error 1 is 0.14285462639626098
The reconstruction error 2 is 0.1511420856414609

The training error is 0.046841286901120584
The reconstruction error is 0.12262546200645963

Complete ASM NN:
The training error is 0.006528100670980884
The reconstruction error is 0.16166204924708688

### Extra degree of freedom on $\sigma,\zeta,\tau$ + multiple estimates
The training error is 0.03511340178453521
The reconstruction error is 0.12250001436641098

The training error is 0.04019386681711638
The reconstruction error is 0.11832722970795045
