-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_generation.R
More file actions
54 lines (42 loc) · 1.92 KB
/
Copy pathplot_generation.R
File metadata and controls
54 lines (42 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
library(readr)
library(tidyverse)
python_file <- "~/zbt/github_repo/DPMFuelCellChannel/400-rounds-S-python.csv"
matlab_file <- "~/zbt/github_repo/DPMFuelCellChannel/jul/run_1.csv"
X200_rounds_S_python <- read_csv(python_file, col_names = FALSE)
X200rounds_S_matlab <- read_csv(matlab_file, col_names = FALSE)
names(X200_rounds_S_python) <- c("t", "TotalP", "sum_Vevap", "mean_velocity")
names(X200rounds_S_matlab) <- c("t", "TotalP", "sum_Vevap", "mean_velocity")
X200rounds_S_matlab["iteration"] <- seq(1, 402)
X200rounds_S_matlab["lang"] <- rep("matlab", 402)
X200_rounds_S_python["iteration"] <- seq(1, 400)
X200_rounds_S_python["lang"] <- rep("python", 400)
S <- rbind(X200_rounds_S_python, X200rounds_S_matlab)
S %>%
group_by(lang) %>%
ggplot(aes(iteration, TotalP, color = lang)) + geom_line() + theme_bw()
X200_rounds_Droplets_matlab <- read_csv("~/zbt/github_repo/DPMFuelCellChannel/matlab-400-rounds.csv",
col_names = FALSE)
X200_rounds_Droplets_python <- read_csv("~/zbt/github_repo/DPMFuelCellChannel/400-rounds-Droplets-python.csv",
col_names = FALSE)
python_droplets <- X200_rounds_Droplets_python %>%
select(num_range("X", 3:6), X28) %>%
rename("X" = X3, "Y" = X4, "Z" = X5, "Regime" = X6, "Iteration" = X28) %>%
mutate("lang" = "python")
matlab_droplets <- X200_rounds_Droplets_matlab %>%
select(num_range("X", 3:6), X28) %>%
rename("X" = X3, "Y" = X4, "Z" = X5, "Regime" = X6, "Iteration" = X28) %>%
mutate("lang" = "matlab")
droplets <- rbind(python_droplets, matlab_droplets)
head(matlab_droplets)
head(python_droplets)
droplets %>%
group_by(Iteration, lang) %>%
summarise(no_droplets = n(), .groups = "drop") %>%
ungroup() %>%
ggplot(aes(Iteration, no_droplets, color = lang)) +
geom_line() +
geom_point() +
theme_bw() +
labs(title = "Anzahl Droplets je Iteration") +
xlab("Iteration") +
ylab("Anzahl Droplets")