Skip to content

Instantly share code, notes, and snippets.

@aavogt
Created September 18, 2024 14:51
Show Gist options
  • Select an option

  • Save aavogt/bc95f009c08da1a993c4662b51a34a5e to your computer and use it in GitHub Desktop.

Select an option

Save aavogt/bc95f009c08da1a993c4662b51a34a5e to your computer and use it in GitHub Desktop.
Wang 2006 equation plot
# https://link.springer.com/article/10.1007/s00170-006-0556-9
library(pacman)
p_load(tidyverse, directlabels)
delta <- function(dh,alpha,hdt,dt,L,H) {
n <- H / dh
te <- hdt - dt
tibble(n=n, te=te, delta = n^3 * dh / (6*alpha*dt*(n-1)) * (1 - cos(3*alpha*L/(n*dh) * dt * (n-1)/n^2 )))
}
# hdt # https://omnexus.specialchem.com/polymer-property/heat-deflection-temperature-of-plastics
materials <- bind_rows(tibble(name = "nylon", alpha = 90e-6, hdt = 150),
tibble(name = "pla", alpha = 68e-6, hdt = 56),
tibble(name = "pp", alpha = 150e-6, hdt = 140),
tibble(name = "pom", alpha = 100e-6, hdt = 172),
tibble(name = "abs", alpha = 80e-6, hdt = 100),
tibble(name = "petg", alpha = 60e-6, hdt = 71),
tibble(name = "pvdf", alpha = 150e-6, hdt = 105),
tibble(name = "peek", alpha = 20e-6, hdt = 150),
tibble(name = "pesu", alpha = 60e-6, hdt = 200),
tibble(name = "pps", alpha = 40e-6, hdt = 115)
)
prints <- list(dh = c(0.07, 0.14, 0.28), dt = seq(1, 80, length.out=10), L = 100, H = 10, name = materials$name) %>%
do.call(expand_grid, .)
ps <- prints %>%
left_join(materials, by = "name") %>%
rowwise() %>%
mutate(delta(dh, alpha, hdt, dt, L, H)) %>%
filter(te>20)
png("warping.png", width=800, height=400)
ggplot(ps, aes(te, delta / dh, color = name)) +
geom_line() +
facet_wrap(~dh, labeller=label_both) +
labs(title = "warping is proportional to layer height") +
geom_dl(aes(label = name), method = first.points) + xlim(00, 200) + xlab("enclosure temperature [°C]") +
ylab("10x1 cm beam warp / layer height [1]") + theme_minimal() + theme(legend.position = "none")
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment