text:
Archive

## Tag Cloud

3d 3d printing account algorithms android announcement architecture archives arduino artificial intelligence artix assembly async audio automation backups bash batch blog bookmarklet booting bug hunting c sharp c++ challenge chrome os cluster code codepen coding conundrums coding conundrums evolved command line compilers compiling compression containerisation css dailyprogrammer data analysis debugging demystification distributed computing docker documentation downtime electronics email embedded systems encryption es6 features ethics event experiment external first impressions future game github github gist gitlab graphics hardware hardware meetup holiday holidays html html5 html5 canvas infrastructure interfaces internet interoperability io.js jabber jam javascript js bin labs learning library linux lora low level lua maintenance manjaro minetest network networking nibriboard node.js operating systems own your code pepperminty wiki performance phd photos php pixelbot portable privacy problem solving programming problems project projects prolog protocol protocols pseudo 3d python reddit redis reference releases rendering resource review rust searching secrets security series list server software sorting source code control statistics storage svg talks technical terminal textures thoughts three thing game three.js tool tutorial tutorials twitter ubuntu university update updates upgrade version control virtual reality virtualisation visual web website windows windows 10 xmpp xslt

## Installing Python, Keras, and Tensorflow from source

I found myself in the interesting position recently of needing to compile Python from source. The reasoning behind this is complicated, but it boils down to a need to use Python with Tensorflow / Keras for some natural language processing AI, as Tensorflow.js isn't going to cut it for the next stage of my PhD.

The target upon which I'm aiming to be running things currently is Viper, my University's high-performance computer (HPC). Unfortunately, the version of Python on said HPC is rather old, which necessitated obtaining a later version. Since I obviously don't have sudo permissions on Viper, I couldn't use the default system package manager. Incredibly, pre-compiled Python binaries are not distributed for Linux either, which meant that I ended up compiling from source.

I am going to be assuming that you have a directory at $HOME/software in which we will be working. In there, there should be a number of subdirectories: • bin: For binaries, already added to your PATH • lib: For library files - we'll be configuring this correctly in this guide • repos: For git repositories we clone Make sure you have your snacks - this was a long ride to figure out and write - and it's an equally long ride to follow. I recommend reading this all the way through before actually executing anything to get an overall idea as to the process you'll be following and the assumptions I've made to keep this post a reasonable length. ### Setting up Before we begin, we need some dependencies: • gcc - The compiler • git - For checking out the cpython git repository • readline - An optional dependency of cpython (presumably for the REPL) On Viper, we can load these like so: module load utilities/multi module load gcc/10.2.0 module load readline/7.0 ### Compiling openssl We also need to clone the openssl git repo and build it from source: cd ~/software/repos git clone git://git.openssl.org/openssl.git; # Clone the git repo cd openssl; # cd into it git checkout OpenSSL_1_1_1-stable; # Checkout the latest stable branch (do git branch -a to list all branches; Python will complain at you during build if you choose the wrong one and tell you what versions it supports) ./config; # Configure openssl ready for compilation make -j "$(nproc)"                              # Build openssl

With openssl compiled, we need to copy the resulting binaries to our ~/software/lib directory:

cp lib*.so* ~/software/lib;
# We're done, cd back to the parent directory
cd ..;

To finish up openssl, we need to update some environment variables to let the C++ compiler and linker know about it, but we'll talk about those after dealing with another dependency that Python requires.

### Compiling libffi

libffi is another dependency of Python that's needed if you want to use Tensorflow. To start, go to the libgffi GitHub releases page in your web browser, and copy the URL for the latest release file. It should look something like this:

cd ~/software/lib
curl -OL URL_HERE

Note that we do it this way, because otherwise we'd have to run the autogen.sh script which requires yet more dependencies that you're unlikely to have installed.

Then extract it and delete the tar.gz file:

tar -xzf libffi-3.3.tar.gz
rm libffi-3.3.tar.gz

Now, we can configure and compile it:

./configure --prefix=$HOME/software make -j "$(nproc)"

Before we install it, we need to create a quick alias:

cd ~/software;
ln -s lib lib64;
cd -;

libffi for some reason likes to install to the lib64 directory, rather than our pre-existing lib directory, so creating an alias makes it so that it installs to the right place.

### Updating the environment

Now that we've dealt with the dependencies, we now need to update our environment so that the compiler knows where to find them. Do that like so:

export LD_LIBRARY_PATH="$HOME/software/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"; export LDFLAGS="-L$HOME/software/lib -L$HOME/software/include$LDFLAGS";
export CPPFLAGS="-I$HOME/software/include -I$HOME/software/repos/openssl/include -I$HOME/software/repos/openssl/include/openssl$CPPFLAGS"

It is also advisable to update your ~/.bashrc with these settings, as you may need to come back and recompile a different version of Python in the future.

Personally, I have a file at ~/software/setup.sh which I run with source $HOME/software/setuop.sh in my ~/.bashrc file to keep things neat and tidy. ### Compiling Python Now that we have openssl and libffi compiled, we can turn our attention to Python. First, clone the cpython git repo: git clone https://github.com/python/cpython.git cd cpython; Then, checkout the latest tag. This essentially checks out the latest stable release: git checkout "$(git tag | grep -ivP '[ab]|rc' | tail -n1)"

Important: If you're intention is to use tensorflow, check the Tensorflow Install page for supported Python versions. It's probable that it doesn't yet support the latest version of Python, so you might need to checkout a different tag here. For some reason, Python is really bad at propagating new versions out to the community quickly.

Before we can start the compilation process, we need to configure it. We're going for performance, so execute the configure script like so:

./configure --with-lto --enable-optimizations --with-openssl=/absolute/path/to/openssl_repo_dir

Replace /absolute/path/to/openssl_repo with the absolute path to the above openssl repo.

Now, we're ready to compile Python. Do that like so:

make -j "$(nproc)" This will take a while, but once it's done it should have built Python successfully. For a sanity check, we can also test it like so: make -j "$(nproc)" test

The Python binary compiled should be called simply python, and be located in the root of the git repository. Now that we've compiled it, we need to make a few tweaks to ensure that our shell uses our newly compiled version by default and not the older version from the host system. Personally, I keep my ~/bin folder under version control, so I install host-specific to ~/software, and put ~/software/bin in my PATH like so:

export PATH=$HOME/software/bin With this in mind, we need to create some symbolic links in ~/software/bin that point to our new Python installation: cd$HOME/software/bin;
ln -s relative/path/to/python_binary python
ln -s relative/path/to/python_binary python3
ln -s relative/path/to/python_binary python3.9

Replace relative/path/to/python_binary with the relative path tot he Python binary we compiled above.

To finish up the Python installation, we need to get pip up and running, the Python package manager. We can do this using the inbuilt ensurepip module, which can bootstrap a pip installation for us:

python -m ensurepip --user

This bootstraps pip into our local user directory. This is probably what you want, since if you try and install directly the shebang incorrectly points to the system's version of Python, which doesn't exist.

Then, update your ~/.bash_aliases and add the following:

export LD_LIBRARY_PATH=/absolute/path/to/openssl_repo_dir/lib:$LD_LIBRARY_PATH; alias pip='python -m pip' alias pip3='python -m pip' ...replacing /absolute/path/to/openssl_repo_dir with the path to the openssl git repo we cloned earlier. The next stage is to use virtualenv to locally install our Python packages that we want to use for our project. This is good practice, because it keeps our dependencies locally installed to a single project, so they don't clash with different versions in other projects. Before we can use virtualenv though, we have to install it: pip install virtualenv Unfortunately, Python / pip is not very clever at detecting the actual Python installation location, so in order to actually use virtualenv, we have to use a wrapper script - because the [shebang]() in the main ~/.local/bin/virtualenv entrypoint does not use /usr/bin/env to auto-detect the python binary location. Save the following to ~/software/bin (or any other location that's in your PATH ahead of ~/.local/bin): #!/usr/bin/env bash exec python ~/.local/bin/virtualenv "$@"

For example:

# Write the script to disk
nano ~/software/bin/virtualenv;
# chmod it to make it executable
chmod +x ~/software/bin/virtualenv

### Installing Keras and tensorflow-gpu

With all that out of the way, we can finally use virtualenv to install Keras and tensorflow-gpu. Let's create a new directory and create a virtual environment to install our packages in:

mkdir tensorflow-test
cd tensorflow-test;

### Conclusion

In this tutorially-kinda post, I've talked through how to manage user accounts for the Mosquitto MQTT. I've also talked about how to enable and manage access control lists too.

This should make your MQTT server more secure. The other thing you can do to make your MQTT server more secure is enable TLS encryption. I'm going to hold off on showing that in this file because I'm still unsure about the best way of doing it (getting Mosquitto to do it vs using Nginx as a reverse proxy - I'm currently testing the former), but if there's the demand I'll post about it in the future.

## Rendering Time plan / Gantt charts: hourgraph

I have a number of tools and other programs I've implemented, but forgotten to blog about here - hourgraph is one such tool I stumbled across today again. Originally I implemented it for my PhD panel 1 topic project analysis report, as I realised that not only have I manually created a number of these, but I'm going to have to create a bunch more in the future, but I open-sourced it as I usually do with most of the things I write in the hopes that someone else will find it useful.

I've published it on NPM, so you can install it like this:

npm install --global hourgraph

You'll need Node.js installed, and Linux users will need to prefix the above with sudo.

The program takes in a TOML definition file. Here's an example:

width = 1500
height = 480
title = "Apples"

name = "Pick apples"
start = 0
duration = 3

name = "Make apple juice"
start = 2
duration = 2

name = "Enjoy!"
start = 4
duration = 4
colour = "hsl(46, 90%, 60%)"
ghost_colour = "hsla(46, 90%, 60%, 0.1)"

The full set of options are available in the default config file, which is loaded in to fill in any gaps of things you haven't specified in your custom file.

Comprehensive usage instructions are found in the README, but you can render a new time plan chart thingy like this:

hourgraph --input path/to/input.toml --output path/to/output.toml

The above renders to this:

Personally, I find it's much easier to create charts like this by defining them in a simple text file that is then rendered into the actual thing. That way, I don't have to fiddle with the layout myself - it all comes out in the wash automatically.

For those interested in the code, it can be found here: https://github.com/sbrl/hourgraph

## Skyliner: Automated text document outlining

When editing large documents, it's often helpful to have a hierarchical "navigation view" of sorts. For a text document like the Markdown that I'm typing now for this blog post, it would consist of a list of headings in the document. For a Javascript or C♯ file, it might consist of classes, functions, and methods.

Either way, it's a helpful thing to have - but for some ridiculous reason as far as I know a generic text document outlining tool doesn't exist.

While GitHub's Atom (my code editor of choice) has an atom-ide has an outline view that works great, it only supports a limited number of languages (you have to have a plugin installed for every language), and sometimes it hangs and takes like 30 seconds plus to generate the outline.

To this end, I intend to remedy the situation with a new library I'm writing call Skyliner.

It's based on finite-state automata and regular expressions (also, Wikipedia and regexper), and it streams the input and generates an outline line-by-line. It provides both a command-line interface and a Javascript API (though the command-line interface currently consumes all input before generating any output, but the library is capable of streaming objects as it consumes the input). As of the time of typing, it supports the following languages:

• clike (e.g. c, c++, header files)
• csharp
• go
• ini
• javascript
• json
• lua
• markdown
• php
• rust
• sh (including bash)
• toml
• xml

While using regular expressions means that the output won't be perfect (especially in the case of XML/HTML), it does mean that adding support for a new language is as simple as defining a new finite-state automaton in a Javascript object. Adding support for Lua was a 10-15 minute job - including automated tests! Support for more languages is definitely on the way.

The combination of line-by-line parsing, regular expressions, and finite-state automata also means that it's much faster than Atom IDE, because it doesn't have to parse the entire document into an abstract syntax tree before generating the outline.

My goal here is to have good support as many languages as possible, rather than amazing support for just a small handful of languages. This isn't to say that I won't fix issues with existing languages as they come up, but the focus is really on ensuring that whenever I open a text document in Atom.

Once I've added support for a bunch of languages, written some documentation, and published it on npm, I'm going to try my hand it implementing my first plugin for GitHub's Atom. Apparently plugins for Atom aren't too difficult to port to Visual Studio Code, so maybe I'll take a look at doing that too (but I don't use Visual Studio Code much, so not a priority).

The code is open-source already (link below) and completely usable, but since it's an ongoing process you can expect another post on here in the future about my progress.

Skyliner on GitHub: https://github.com/sbrl/skyliner

If you'd be interested in some more detail about how it works, I'll be writing some documentation soon, which will appear in the above Git repository.

## Booting my multiboot flash drive via EFI

In December 2019, I posted about my new multiboot flash drive that I put together. In that post, I partitioned a flash drive and installed grub to it such that I could boot from any one of a selection of ISOs that I put in a directory.

Here's a link to that post: Multi-boot + data + multi-partition = octopus flash drive 2.0?

This has been working brilliantly, except that I noticed after posting it that it had a tendency to hang infinitely if I booted into an ISO via UEFI instead of legacy BIOS. I've been hunting for a solution to this awkward issue ever since then - and as you might have guessed by the fact that you're reading this post now, I've finally found a solution.

As I suspected - the solution is really very simple:

# Ref https://askubuntu.com/q/1186040/139735
# As far as I can tell, this bug only affects UEFI / EFI
rmmod tpm

Adding rmmod tpm to the top of the grub.cfg grub configuration file fixes the issue - as far as I can tell (I still want to run some more tests on different machines).

I've also taken the unusual step of retroactively going back and updating the original post.

I found the solution in an answer on Ask Ubuntu. As it turns out, sometimes it's just a case of trying different search terms. I had tried a number of times to find a solution previously, but I kept coming up against solutions such as recompiling grub from source myself, which would require an enormous amount of effort, or suggestions to install grub from a different version of Ubuntu (which didn't work).

As far as I understand it, the solution disables the Trusted Platform Module support built into grub. As for why this fixes my ISO booting issue, I'm not sure.

If you're trying to find a solution to a problem you're encountering, never give up! You'll find a solution eventually :-)

## PhD, Update 7: Just out of reach

Oops! I must have forgotten about writing an entry for this series. Things have been complicated with the current situation, but I've got some time now to talk about what's been happening since my last post about my PhD. Before we continue though, here's a list of all the parts so far:

In this post, there are 2 different distinct areas to talk about. Firstly, the (limited) progress I've made on the Temporal CNN - and secondly the social media content.

### Rainfall Radar / Temporal CNN

Things on the Temporal CNN front have been.... interesting. In the last post, I talked about how I was planning to update the model to use a cross-entropy loss function instead of mean squared error. In short, the idea here is to bin the water depth values we want to predict into a number of different categories, and then get the AI to predict which category each pixel belongs in.

The point of this is to allow for evaluating what the model is good at, and what it struggles with more effectively with the help of a confusion matrix.

Unfortunately, after going to a considerable amount of effort, the model hasn't yet been able to learn anything at all when using the cross-entropy loss error function. I've tried a whole array of different things by this point:

• Using sparse / non-sparse categorical cross-entropy loss (ref)
• Changing the number of filters in the model
• Changing the format of the input data
• Moving from average pooling → max pooling
• Fiddling with the 2D CNN layer at the end of the model
• ...and many more things - too many to list or remember here

Unfortunately, none of these have had a meaningful impact on the model's ability to learn anything. Despite this, we haven't run out of ideas yet. My current plan is to rebuild the model based on a known good model.

The known-good model in question is one I built earlier for a talk I did. It's purpose is classifying images, which it does fabulously with the well-known MNIST handwriting digits dataset. It's structure has 1 2D CNN layer, followed by a dense layer that outputs the probabilities as a 1D array:

I devised 2 learning tasks to test the model with here. The "hard" task, which is to predict the exact digit in the picture, and the "easy" task - which is to predict whether the digit is greater than or equal to 5 or not (this simulates a binary cross-entropy task I've been trying my original model with). The original model works brilliantly with the hard task, gaining an easy 98% accuracy after 12 epochs.

After forking it and then refactoring significantly to decouple its various components, I started to modify the model's structure step by step to more closely match that of the Temporal CNN.

The initial results of this process (which only really got going on Tuesday 23rd February 2021) have been fascinating, as I've been running the MNIST dataset through it in between each step to check that it's still working as intended.

For example, I've discovered that the model has an intense dislike of pooling layers (both average and max). I suspect this might be because I'm not using it correctly, but I discovered that I could only get about 40% accuracy with the pooling layer in place, compared to ~99% without it.

Another thing I've done is removing the dense layer from the model, but this comes with its own set of problems though. The eventual goal is to do what is essentially image-to-video translation, so a key part of this process is to get the model to produce at least 2D tensor as an output instead of a 1D list of predictions for a single pixel.

To simulate this with the MNIST dataset, copied the output prediction. For the "hard" task, I copied the array of probabilities for each category into a cube, with 1 copy of the array for each pixel of the output. I found while doing this though that I got about 22% accuracy - though I suspect that the model was slower to converge than normal and if I'd maybe made the model a bit larger or let it train for longer, I'd be able to improve that somewhat.

It fared much better on the "easy" task though - easily achieving 99% accuracy fairly quickly with just 2 x 2D CNN layers in a row.

With these tests in mind, I'll be continuing the process of tweaking my new model bit by bit to match the original Temporal CNN, with the eventual goal of running my actual dataset through the model.

### Social Media

I thought I'd be well into the social media part of my PhD by now, but things have been getting in the way (e.g. life stuff with respect to the current situation, and the temporal cnn being awkward) so I haven't yet been able to make a serious start on the social media side of things yet.

Still, I've been working away at the paperwork. I've now got ethical approval to work with publicly-available social media data (so long as I anonymise it, of course), and I've also been applying to get access to Twitter's new Academic API (which apparently went through successfully, but I'm currently troubleshooting the reason why it's asking me to apply for an account all over again).

I've also been reading a paper or 2, but since most of my energy has been spent elsewhere I have yet to dive seriously into this (I re-discovered the other day a folder full of interesting papers my supervisor sent me, so I'm going to dive into that as soon as I get a moment).

Papers looking into analysing social media data with advanced AI models appear to be in short supply - most papers I've read so far are either talking about analysing longer texts such as newspaper articles, or are using keyword-based and statistics-based methodologies to analyse data.

While this makes for an interesting research gap, I do feel slightly nervous that I've somehow missed something (which I guess I'll find out soon enough after reading some more papers). At any rate, my supervisor and I have some promising ideas and directions to look into moving forwards, so I'm not too worried here. I've also had some interesting discussions with people from the humanities side of my PhD (if you can call it that? I'm not sure what the right terminology is) over potential research questions too, so there's lots of scope here for investigation.

I anticipate that social media data isn't going to be as difficult a dataset to wrangle as the rainfall radar either (it's got to be better than a badly documented propriety binary format), as it's already encoded in JSON - so I'm not expecting I'll need to spend ages and ages writing programs to reformat and parse the data.

### Conclusion

Things have been moving slowly recently, due in part to difficulties with the Temporal CNN, and due in part to life in general suddenly becoming rather challenging recently. Things are starting to calm down now though, so I'm starting to have more time to work on my PhD (but it's going to be a number of months yet until things are properly back to normal).

By changing tack with the Temporal CNN, I feel like I'm starting to make some more progress again, and the social media track of my PhD is showing lots of promise even though it's too early to tell exactly what direction I'll be heading in with it.

Hopefully by the time I make another post here in 2 months time, I'll have a working Temporal CNN and a start to the social media side of things - but this seems a tad ambitious based on how things have been going so far.

If you've got any comments or suggestions, do leave them below! I'd love to hear from you.

## Cluster, Part 11: Lock and Key | Let's Encrypt DNS-01 for wildcard TLS certificates

Welcome one and all to another cluster blog post! Cluster blog posts always take a while to write, so sorry for the delay. As is customary, let's start this post off with a list of all the parts in the series so far:

With that out of the way, in this post we're going to look at obtaining a wildcard TLS certificate using the Let's Encrypt DNS-01 challenge. We want this because you need a TLS certificate to serve HTTPS without lighting everyone's browsers up with warnings like a Christmas tree.

The DNS-01 challenge is an alternate challenge to the default HTTP-01 challenge you may already me familiar with.

Unlike the HTTP-01 challenge which proves you have access to single domain by automatically placing a file on your web server, the DNS-01 challenge proves you have control over an entire domain - thus allowing you to obtain a wildcard certificate - which is valid for not only your domain, but all possible subdomains! This should save a lot of hassle - but it's important we keep it secure too.

As with regular Let's Encrypt certificates, we'll also need to ensure that our wildcard certificate we obtain will be auto-renewed, so we'll be setting up a periodic task on our Nomad cluster to do this for us.

If you don't have a Nomad cluster, don't worry. It's not required, and I'll be showing you how to do it without one too. But if you'd like to set one up, I recommend part 7 of this series.

In order to complete the DNS-01 challenge successfully, we need to automatically place a DNS record in our domain. This can be done via an API, if your DNS provider has one and it's supported. Personally, I have the domain name I'm using for my cluster (mooncarrot.space.) with Gandi. We'll be using certbot to perform the DNS-01 challenge, which has a plugin system for different DNS API providers.

We'll be installing the challenge provider we need with pip3 (a Python 3 package manager, as certbot is written in Python), so you can find an up-to-date list of challenge providers over on PyPi here: https://pypi.org/search/?q=certbot-dns

If you don't see a plugin for your provider, don't worry. I couldn't find one for Gandi, so I added my domain name to Cloudflare and followed the setup to change the name servers for my domain name to point at them. After doing this, I can now use the Cloudflare API through the certbot-dns-cloudflare plugin.

With that sorted, we can look at obtaining that TLS certificate. I opt to put certbot in a Docker container here so that I can run it through a Nomad periodic task. This proved to be a useful tool to test the process out though, as I hit a number of snags with the process that made things interesting.

The first order of business is to install certbot and the associate plugins. You'd think that simply doing an sudo apt install certbot certbot-dns-cloudflare would do the job, but you'd be wrong.

As it turns out, it does install that way, but it installs an older version of the certbot-dns-cloudflare plugin that requires you give it your Global API Key from your Cloudflare account, which has permission to do anything on your account!

That's no good at all, because if the key gets compromised an attacker could edit any of the domain names on our account they like, which would quickly turn into a disaster!

Instead, we want to install the latest version of certbot and the associated Cloudflare DNS plugin, which support regular Cloudflare API Tokens, upon which we can set restrictive permissions to only allow it to edit the one domain name we want to obtain a TLS certificate for.

I tried multiple different ways of installing certbot in order to get a version recent enough to get it to take an API token. The way that worked for me was a script called certbot-auto, which you can download from here: https://dl.eff.org/certbot-auto.

Now we have a way to install certbot, we also need the Cloudflare DNS plugin. As I mentioned above, we can do this using pip3, a Python package manager. In our case, the pip3 package we want is certbot-dns-cloudflare - incidentally it has the same name as the outdated apt package that would have made life so much simpler if it had supported API tokens.

Now we have a plan, let's start to draft out the commands we'll need to execute to get certbot up and running. If you're planning on following this tutorial on bare metal (i.e. without Docker), go ahead and execute these directly on your target machine. If you're following along with Docker though, hang on because we'll be wrapping these up into a Dockerfile shortly.

First, let's install certbot:

sudo apt install curl ca-certificates
cd some_permanent_directory;
curl -sS https://dl.eff.org/certbot-auto -o certbot-auto
chmod +x certbot-auto
sudo certbot-auto --debug --noninteractive --install-only

Installation with certbot-auto comprises downloading a script and executing it. with a bunch of flags. Next up, we need to shoe-horn our certbot-dns-cloudflare plugin into the certbot-auto installation. This requires some interesting trickery here, because certbot-auto uses something called virtualenv to install itself and all its dependencies locally into a single directory.

sudo apt install python3-pip
cd /opt/eff.org/certbot/venv
source bin/activate
pip install certbot-dns-cloudflare
deactivate

In short, we cd into the certbot-auto installation, activate the virtualenv local environment, install our dns plugin package, and then exit out of the virtual environment again.

With that done, we can finally add a convenience synlink so that the certbot command is in our PATH:

ln -s /opt/eff.org/certbot/venv/bin/certbot /usr/bin/certbot

That completes the certbot installation process. Then, to use certbot to create the TLS certificate, we'll need an API as mentioned earlier. Navigate to the API Tokens part of your profile and create one, and then create an INI file in the following format:

# Cloudflare API token used by Certbot
dns_cloudflare_api_token = "YOUR_API_TOKEN_HERE"

...replacing YOUR_API_TOKEN_HERE with your API token of course.

Finally, with all that in place, we can create our wildcard certificate! Do that like this:

sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials path/to/credentials.ini -d 'bobsrockets.io,*.bobsrockets.io' --preferred-challenges dns-01

It'll ask you a bunch of interactive questions the first time you do this, but follow it through and it should issue you a TLS certificate (and tell you where it stored it). Actually utilising it is beyond the scope of this post - we'll be tackling that in a future post in this series.

For those following along on bare metal, this is where you'll want to skip to the end of the post. Before you do, I'll leave you with a quick note about auto-renewing your TLS certificates. Do this:

sudo letsencrypt renew
sudo systemctl reload nginx postfix

....on a regular basis, replacing nginx postfix with a space-separated list of services that need reloading after you've renewed your certificates. A great way to do this is to setup a cron job.

### Sweeping things under the carpet

For the Docker users here, we aren't quite finished yet: We need to package this mess up into a nice neat Docker container where we can forget about it :P

Some things we need to be aware of:

• certbot has a number of data directories it interacts with that we need to ensure don't get wiped when the Docker ends instances of our container.
• Since I'm serving the shared storage of my cluster over NFS, we can't have certbot running as root as it'll get a permission denied error when it tries to access the disk.
• While curl and ca-certificates are needed to download certbot-auto, they aren't needed by certbot itself - so we can avoid installing them in the resulting Docker container by using a multi-stage Dockerfile.

To save you the trouble, I've already gone to the trouble of developing just such a Dockerfile that takes all of this into account. Here it is:

ARG REPO_LOCATION
# ARG BASE_VERSION

FROM ${REPO_LOCATION}minideb AS builder RUN install_packages curl ca-certificates \ && curl -sS https://dl.eff.org/certbot-auto -o /srv/certbot-auto \ && chmod +x /srv/certbot-auto FROM${REPO_LOCATION}minideb

COPY --from=builder /srv/certbot-auto /srv/certbot-auto

RUN /srv/certbot-auto --debug --noninteractive --install-only && \
install_packages python3-pip

WORKDIR /opt/eff.org/certbot/venv
RUN . bin/activate \
&& pip install certbot-dns-cloudflare \
&& deactivate \
&& ln -s /opt/eff.org/certbot/venv/bin/certbot /usr/bin/certbot

VOLUME /srv/configdir /srv/workdir /srv/logsdir

USER 999:994
ENTRYPOINT [ "/usr/bin/certbot", \
"--config-dir", "/srv/configdir", \
"--work-dir", "/srv/workdir", \
"--logs-dir", "/srv/logsdir" ]

A few things to note here:

• We use a multi-stage dockerfile here to avoid installing curl and ca-certificates in the resulting docker image.
• I'm using minideb as a base image that resides on my private Docker registry (see part 8). For the curious, the script I use to do this located on my personal git server here: https://git.starbeamrainbowlabs.com/sbrl/docker-images/src/branch/master/images/minideb.
• If you don't have minideb pushed to a private Docker registry, replace minideb with bitnami/minideb in the above.
• We set the user and group certbot runs as to 999:994 to avoid the NFS permissions issue.
• We define 3 Docker volumes /srv/configdir, /srv/workdir, and /srv/logsdir to contain all of certbot's data that needs to be persisted and use an elaborate ENTRYPOINT to ensure that we tell certbot about them.

Save this in a new directory with the name Dockerfile and build it:

sudo docker build --no-cache --pull --tag "certbot" .;

...if you have a private Docker registry with a local minideb image you'd like to use as a base, do this instead:

sudo docker build --no-cache --pull --tag "myregistry.seanssatellites.io:5000/certbot" --build-arg "REPO_LOCATION=myregistry.seanssatellites.io:5000/" .;

In my case, I do this on my CI server:

laminarc queue docker-rebuild IMAGE=certbot

The hows of how I set that up will be the subject of a future post. Part of the answer is located in my docker-images Git repository, but the other part is in my private continuous integration Git repo (but rest assured I'll be talking about it and sharing it here).

Anyway, with the Docker container built we can now obtain our certificates with this monster of a one-liner:

sudo docker run -it --rm -v /mnt/shared/services/certbot/workdir:/srv/workdir -v /mnt/shared/services/certbot/configdir:/srv/configdir -v /mnt/shared/services/certbot/logsdir:/srv/logsdir certbot certonly --dns-cloudflare --dns-cloudflare-credentials path/to/credentials.ini -d 'bobsrockets.io,*.bobsrockets.io' --preferred-challenges dns-01

The reason this is so long is that we need to mount the 3 different volumes into the container that contain certbot's data files. If you're running a private registry, don't forget to prefix certbot there with registry.bobsrockets.com:5000/.

Don't forget also to update the Docker volume locations on the host here to point a empty directories owned by 999:994.

Even if you want to run this on Nomad, I still advise that you execute this manually. This is because the first time you do so it'll ask you a bunch of questions interactively (which it doesn't do on subsequent times).

If you're not using Nomad, this is the point you'll want to skip to the end. As before with the bare-metal users, you'll want to add a cron job that runs certbot renew - just in your case inside your Docker container.

For the truly intrepid Nomad users, we still have one last task to complete before our work is done: Auto-renewing our certificate(s) with a Nomad periodic task.

This isn't really that complicated I found. Here's what I came up with:

job "certbot" {
datacenters = ["dc1"]
priority = 100
type = "batch"

periodic {
cron = "@weekly"
prohibit_overlap = true
}

driver = "docker"

config {
image = "registry.service.mooncarrot.space:5000/certbot"
labels { group = "maintenance" }
entrypoint = [ "/usr/bin/certbot" ]
command = "renew"
args = [
"--config-dir", "/srv/configdir/",
"--work-dir", "/srv/workdir/",
"--logs-dir", "/srv/logsdir/"
]
# To generate a new cert:
# /usr/bin/certbot --work-dir /srv/workdir/ --config-dir /srv/configdir/ --logs-dir /srv/logsdir/ certonly --dns-cloudflare --dns-cloudflare-credentials /srv/configdir/__cloudflare_credentials.ini -d 'mooncarrot.space,*.mooncarrot.space' --preferred-challenges dns-01

volumes = [
"/mnt/shared/services/certbot/workdir:/srv/workdir",
"/mnt/shared/services/certbot/configdir:/srv/configdir",
"/mnt/shared/services/certbot/logsdir:/srv/logsdir"
]
}
}
}

If you want to use it yourself, replace the various references to things like the private Docker registry and the Docker volumes (which require "docker.volumes.enabled" = "True" in clientoptions in your Nomad agent configuration) with values that make sense in your context.

I have some confidence that this is working as intended by inspecting logs and watching TLS certificate expiry times. Save it to a file called certbot.nomad and then run it:

nomad job run certbot.nomad

### Conclusion

If you've made it this far, congratulations! We've installed certbot and used the Cloudflare DNS plugin to obtain a DNS wildcard certificate. For the more adventurous, we've packaged it all into a Docker container. Finally for the truly intrepid we implemented a Nomad periodic job to auto-renew our TLS certificates.

Even if you don't use Docker or Nomad, I hope this has been a helpful read. If you're interested in the rest of my cluster build I've done, why not go back and start reading from part 1? All the posts in my cluster series are tagged with "cluster" to make them easier to find.

Unfortunately, I haven't managed to determine a way to import TLS certificates into Hashicorp Vault automatically, as I've stalled a bit on the Vault front (permissions and policies are wildly complicated), so in future posts it's unlikely I'll be touching Vault any time soon (if anyone has an alternative that is simpler and easier to understand / configure, please comment below).

Despite this, in future posts I've got a number of topics lined up I'd like to talk about:

• Configuring Fabio (see part 9) to serve HTTPS and force-redirect from HTTP to HTTPS (status: implemented)
• Implementing HAProxy to terminate port forwarding (status: initial research)
• Password protecting the private docker registry, Consul, and Nomad (status: on the todo list)
• Semi-automatic docker image rebuilding with Laminar CI (status: implemented)

In the meantime, please comment below if you liked this post, are having issues, or have any suggestions. I'd love to hear if this helped you out!


text:
# Local Extremum – A function with fixed powers – Exercise 6524

Exercise

Find the local extremum points of the function

$$z(x,y)=x^2+xy+y^2+\frac{1}{x}+\frac{1}{y}$$

$$(\frac{1}{\sqrt[3]{3}},\frac{1}{\sqrt[3]{3}})$$

format: plain


text:
Open access peer-reviewed chapter

# Traditional Wooden Buildings in China

By Ze-li Que, Zhe-rui Li, Xiao-lan Zhang, Zi-ye Yuan and Biao Pan

Submitted: May 17th 2016Reviewed: October 4th 2016Published: March 1st 2017

DOI: 10.5772/66145

## Abstract

Chinese ancient architecture, with its long history, unique systematic features and wide-spread employment as well as its abundant heritages, is a valuable legacy of the whole world. Due to the particularity of the material and structure of Chinese ancient architecture, relatively research results are mostly published in Chinese, which limits international communication. On account of the studies carried out in Nanjing Forestry University and many other universities and teams, this chapter emphatically introduces the development, structural evolution and preservation of traditional Chinese wooden structure; research status focuses on material properties, decay pattern, anti-seismic performance and corresponding conservation and reinforcement technologies of the main load-bearing members in traditional Chinese wooden structure.

### Keywords

• materials and properties
• anti-seismic performance
• reinforcement techniques

## 1. Introduction

Being one of the world’s three major architecture systems, Chinese ancient architecture plays an important role in the global history of architecture. With its long history, unique systematic features and wide-spread employment as well as its abundant heritages, Chinese ancient architecture keeps growing and developing. Emerging from a system using earth and wood to one using bricks and wood, it held on its tradition of taking wooden structure as the main structure and carpentry as the main technology. After over 2000 years of progression and evolution, it has formed a complete system of structure and construction, which includes regulations and standards inherited both from Song Dynasty (1103 AD) and from Qing Dynasty (1734 AD). Compared to Western ancient buildings constructed with stones, bricks and natural concrete, Chinese traditional wooden buildings lack durability and need frequent maintenance and renovation, and properties of the wood in use have a fairly big influence on the joints and the performance of the whole structure. However, under the influence of traditional Chinese philosophy, buildings have been more of an exhibition of social status and the materials and structures involved have not been taken seriously as a technology for a long time.

The study with significance to the modern world in the field of Chinese traditional wooden buildings started in the 1920s and 1930s. Historic and artistic fields of the architecture attracted most attention and were often selected as main research directions over a long period of time. Up to now, limited number of fundamental studies on the structural behaviour of Chinese traditional timber structure and its typical joint connections can be found; hence there is an urgency to study and evaluate the seismic performance and structural behaviour of the existing historical timber buildings so as to prevent as much earthquake-inflicted damages as possible from occurring in the near future.

Taking Dou-gong brackets and mortise and tenon joints of Chinese traditional timber structure as objects, the ongoing research project of our team includes structure performance and anti-seismic mechanism of different joint connections between columns and beams, reinforcement technology of the weak parts, along with the utilization and analysis of modern engineering wood products as alternative materials in the repair and new construction of Chinese traditional timber constructions.

Material performance and structure behaviour researches of Chinese traditional wooden buildings are often based on specific emergency repairment and strengthening projects of historical buildings, which somewhat limits the systematicness and universality of the researches. On the other hand, taking convenience of cultural awareness and characteristic of oriental structural system into consideration, the results of relevant studies tend to be published domestically, which also increases the difficulty of international academic exchange and interaction. In consequence, the intention of this chapter is to collect and introduce relevant research status as well as phased achievements of my team systemically. And the publication of this book will be certain to generate a trend to study traditional wooden structure and encourage worldwide academic exchange and cooperation.

## 2. The structure and preservation of traditional Chinese wooden architecture

Represented by traditional Chinese wooden architecture, oriental wooden structure stands out in the architecture world, and after a long course of development and accretion, it has reached a high level of standard theoretically and practically. Take the example of the Yingxian Wooden Pagoda, the highest wooden tower existing worldwide. Besides the fact of being 67.1-m high, it has also survived several major earthquakes and therefore embodied the perfect combination of techniques and aesthetics of wooden structures as well as the intelligence of ancient Chinese people. Consulting two significant building standards from Song Dynasty and Qing Dynasty, this chapter introduces the development and structural evolution of traditional Chinese wooden structure, focusing on three classic structures and via the examples of well-known wooden structures such as the Yingxian Wooden Pagoda, and presents the condition of study and preservation of historic buildings in modern China.

### 2.1. A brief guide to the evolution of traditional oriental wooden structures

Due to different cultural backgrounds, ancient architecture used to have seven independent systems, of which some are extinct or never widely spread and thus had limited achievements and influences. That left Chinese architecture, European architecture and Islamic architecture to be considered the world’s three main architectural systems. And among them, Chinese architecture and European architecture are the most long-lasting, widely spread and successful ones. Ancient Chinese architecture had undergone primitive society, slave society and feudal society, among which the last one was the time when Chinese classic architecture developed the most.

1. Primitive society (7000 years ago to twenty-first century BC). The building types vary due to different climates, geographical features and materials. Among them, there are two typical types: wooden frame and mud wall buildings that emerged from cave houses in the Yellow River basin and the Ganlan-style buildings (wooden buildings that built on stilts) from nest houses in the Yangtze River basin. In the late stage of the primitive society, building sites already had trace of privatization and the walls and roofs of buildings were mostly interwoven branches or twigs with mud coating (see Ref. [1]).

2. Slave society (2070–476 BC). In the twenty-first century BC, the wooden frame and rammed earth construction and regular enclosed courtyard building groups came along, which showed great improvement in timber frame technology. The sixteenth century BC was the prime time for the development of the Chinese slave society and a time when documentary trace began. Based on the size of the rammed earth foundation of the palaces and temples, buildings at this point of the history had larger scale and stricter hierarchy and scale of cities, height of city walls, width of streets and other buildings of significance were required to be built according to their rank. In the Spring and Autumn periods (770–476 BC), the popularization of tiles and appearance of high-platform buildings for imperial and ducal palaces were the most important improvements. High-platform building means building a platform of tamped earth underneath the palace. As the leuds sought more magnificent palaces, the decoration and painting of ancient architecture were taken a step further (see Ref. [1]).

3. Feudal society (475 BC to 1911 AD). With the collapse of slavery, agriculture and handicraft rapidly grew and the utilization of ironware accelerated the improvement of structure technology and wooden structure's construction quality. Fireplaces, heated brick beds and cellars can be seen at this period of time. The Han Dynasty was a thriving time for classic Chinese architecture when the nowadays commonly seen beam-lifted frame and through-type frame wooden structures were formed. And at the same time, the traditional roof of Chinese buildings also flourished. Since then, the introduction of Buddhism greatly boosted the development of Buddhist architecture, one of the most important types of classic Chinese architecture. The Tang Dynasty was a time when the techniques and artistic qualities of classic architect were developing the fastest. Tang-style architecture demonstrates the extremity of size and regulations, extremity in architectural complex layout and features of large expansion and large volume. And the construction form and material requirements of wooden structures especially Dou-gong brackets were standardized. Tang-style architecture also produced a far-reaching influence on countries such as Japan. Later in the Song Dynasty, modular system was adopted and the book building standards were officially published which set standard rule for buildings' measurements and basic moduli so that the size of wooden components could be properly defined.

In the late stage of feudal society, building forms were becoming more and more simplified and the entirety of the beam-column frame was enhanced. The buildings presented a serious and rigorous image with more ingrained decoration and painting. In Qing Dynasty, the ethnic diversity contributed to the blossoming of various residential building types. And the monomer building form of official architecture was set and therefore improved the standard of architectural complex design. The promulgated book construction practices enumerated 27 practices of monomer building and formulated new construction moduli, which contributed much to accelerate the design and construction process and controlling material consumption (see Ref. [2]).

### 2.2. The structural system and characteristics of traditional Chinese wooden structure

Based on different construction frames and geographic features, the traditional Chinese wooden structure frame system can be divided into three types: through-type frame, beam-lifted frame and log-cabin-type frame (see Refs. [3, 4]), as seen in Figure 1.

1. Through-type frame. The through-type frame is constructed of vertical connection with separated frame and mostly used in rural housing. There is no reference to this type in the official building standards. The common practice of this type is to connect the columns with square crossbeams along the length of the house, forming a truss and then use square crossbeams to connect every two trusses, forming the frame of the house. The characteristics of this type include using materials with small cross section that are easy to obtain, using multiple square crossbeams along the length of the house that can be assembled beforehand, enhancing the entirety and stability of the structure and rendering the installation of walls convenient and saving manpower and materials with its simple practice, direct force transmission and ever-evolving and adaptable nature.

2. Beam-lifted frame. This frame type formed in the Spring and Autumn period kept evolving and then became a settled practice. This frame type varies in material size and frame combination according to different social ranks, which was strictly set in regulations such as building standards in Song Dynasty and construction practices in Qing Dynasty. Beam-lifted frame is usually composed of the frame layer, the Dou-gong brackets layer and the roof layer. Usually, it is constructed by placing a beam head on top of a column and then on top of that, using a shorter column to hold a shorter beam and another beam head and another column and so forth. And eventually, the short column on the short beam holds the weight of the purlin. This type was widely used in large-scale buildings such as palaces and temples in northern China. The characteristics of beam-lifted frame are long distance between columns along the length of the house, enclosing larger interior space and aesthetically pleasing structural features.

3. Log-cabin type. Log-cabin type is an ancient structural type that dates back to the primitive society. In China, it was found to be used in building the outer coffin in Shang Dynasty tombs from over 3000 years ago and in the caved patterns on Han Dynasty relics found in Yunnan province in south-western China. It is referred as ’Mukeden’ in north-eastern China, meaning to pile up caved logs (often cut into semi-cylinders) to build houses. This type of structures is often seen in areas such as Inner Mongolia, forests in north-eastern China and mountain areas in Sichuan province and Yunnan province in south-western China. Its characteristics are as follows: it can regulate the room temperature to fit the fickle climate in mountain areas and can withstand earthquakes to some extent; it requires only simple materials and minimum manpower but possesses great diversity and mobility; however, to build this type of houses, a great amount of wood is required and the size and location of doors and windows are greatly limited so it is not as widely spread as the other two types.

### 2.3. The preservation and research status of two typical remaining historic wooden buildings in China

(1) Yingxian Wooden Pagoda. Yingxian Wooden Pagoda, originally known as the Yingxian Wooden Pagoda of Fogong Temple, was built in 1056 AD, Liao Dynasty, and is the largest and oldest high-rise wooden building in existence in the world (as seen in Figure 2). It is a 67.31-m tall pagoda of a multi-storied pavilion type with an octagonal cross section and nine floors that disguised as five. It has a diameter of 30.27 m, weighs 7400 tons and altogether consumed 3700 m3 of timber. With 54 types of Dou-gong brackets of different functions, shapes and sizes installed, it is often referred as a museum of Dou-gong bracket. However, as a consequence of multiple earthquakes during the recent thousand years, wars and unfit repair in modern times, the pagoda suffers from all kinds of problems such as a severe tilt of the main body and the twist of the column frame of the second and third floors. Based on the observation data of 2010, the overall slope was 1.25% and counting, especially of the second floor which accounted for 60–70% of the slope.

Since 1933, Liang et al. began to conduct detailed researches and measurement on Yingxian Wooden Pagoda. In 1966, the book Yingxian Wooden Pagoda was published, and in 1973 (see Ref. [5]), architectural experts such as Yang Tingbao began their 10 years of restoration of this architectural treasure after discussing the issue of its partial tilt and setting basic rules and solutions regarding the repair and reinforcement of the pagoda. The Committee of Yingxian Wooden Pagoda Restoration and Preservation Construction Management was found in the 1990s, and after the early-stage study, it started monitoring the structural soundness of the pagoda in 2008 and continued till this day. Since the 1990s, many scholars and their teams have studied the structural state (e.g. Ref. [6]), damage dispersion, seismic reaction analysis (e.g. Ref. [7]) and material deformation (e.g. Ref. [8]) features under external forces. Refined finite element (FE) models were established, respectively, based on the Dou-gong bracket joints and the whole structural system and load-bearing quality analyses were conducted under lateral load (e.g. Ref. [9]). And the ideal restoration model of the pagoda was established through computer-aided design (CAD) drawings and three-dimensional (3D) models (see Ref. [10]). Yet, there are still issues to address in terms of repair and preservation. In recent years, scholars came up with plans such as major repair of the framework, total support of the pagoda and raised support of the upper section. But because of the significance, structural complexity and uniqueness of the pagoda, the present plan is to reinforce and repair the tilted parts and damaged components on the second and third floors (see Ref. [11]).

(2) East palace of Foguang Temple. The palace is located in Wutai county, Shanxi province, in northern China and originally built in Northern Wei Dynasty (386–534 AD, one of the Northern Dynasties), as seen in Figure 3. With the remaining main hall rebuilt in 857 AD, Tang Dynasty, the palace is one of the remaining oldest Tong Dynasty wooden structures and acclaimed as ‘the primary national treasure of China’. With a building width of seven rooms and length of four, the roof, column frame and Dou-gong brackets all belong to the top rank and exhibit classic structural features of Tong Dynasty. The Dou-gong components have cross-sectional size of 210 × 300 cm, 10 times the size of the same type of components in Qing Dynasty. The eaves are 3.69 m long, and the triangle Y-shape support system in the beam frame is the first of its kind in China. In the palace, there are 61 m2 of Tang Dynasty wall paintings preserved and other treasures such as inscriptions from Tong Dynasty and painted sculptures.

As a classic example of the structural frame and construction technology of Tang Dynasty architecture, multi-dimensional studies were carried out on the East Palace of Foguang Temple regarding spatial form, structural bearing capacity, anti-seismic reinforcement and artistic characteristics (e.g. [12, 13]). As to the protection of the palace, surrounding residents were moved out in 1954 and repair and reinforcement began. In 1985, local government built dams around it to protect it from mountain torrents and stone walls, flashing and gutters to reduce humidity.

## 3. Properties study on traditional Chinese wooden structure

### 3.1. Study of physical properties on wood materials from historic buildings

In order to protect all the wooden buildings with hundreds of years of history across China, a research team was formed to carry out field study on the structure materials of historic buildings in 11 provinces, municipalities and autonomous regions. Experiments were carried out on the worn components after replacement and thus conclusions were drawn concerning the species and physical properties. Furthermore, a national mandatory standard Technical code for maintenance and strengthening of ancient timber buildings, see Ref. [14], was established.

#### 3.1.1. Researches of the species of wooden materials used in historic buildings

According to the field researches and some microstructure identifications, the main components in historic buildings such as beam, fang (a square pillar), column, purlin and rafter are mainly made of nanmu (Phoebe zhennan S. Lee), cypress (Cupressus funebris Endl.), China fir (Cunninghamia lanceolata (Lamb.) Hook.) and pinus (Pinus massoniana Lamb.) in southern China. In northern China, Chinese pine (P. tabulaeformis Carr.), larch (Larix gmelinii (Rupr.) Kuzen.) and pinus armandi (P. armandii Franch.) are widely used. And in common housing, poplar (PopulusL.) and elm (Ulmus pumila L.) are used while in large-scale historic buildings of great importance, there are wood materials such as nanmu from the south involved, which indicates that these buildings are mostly constructed with local materials except for important ones with higher standards. Buildings in Sichuan province in southwest China and Hubei province in the middle south are constructed of nanmu and cypress for there was a large reserve at the time. However, the value of this wood goes up as the reserve goes down nowadays.

#### 3.1.2. Studies on the physical properties of the components in historic buildings

The first concern of all the people working in the field of ancient architecture is the change pattern of the properties of load-bearing components. But studies concerning this topic or relevant ones have been hard to find. The leading difficulty lies in that the environmental conditions that the components are in play an important role in how their properties change and different species react largely differently to the environmental conditions. In addition, it is also difficult to manufacture viable specimens using modern materials as a control group due to the massive variation of wood materials.

In 1977, Chen G.Y carried out physical properties experiments on a worn component from the Yingxian Wooden Pagoda, see Ref. [15]. It was a column on the horizontal slot of the two-raftered roof beam on the second floor that was 900 years old according to C14 dating. The column was 2.7-m high, 33 × 23 cm in section size and made of north China larch (L. principis-rupprechtii Mayr). Being hidden inside the pagoda, the column was spared from erosion by wind and rain and thus showed no obvious erosional furrows and darkening but demonstrated some split (being hit by artillery shells). The experiment results are seen in Table 1. In 1982, Chen experimented on the middle column from the Jing Qing Gate in Jinci Temple, see Ref. [15]. The column was about 600 years old, 6-m high, 40 × 40 cm in section size, and made of poplar (Populus L.). The column was not eroded by rain and demonstrated darkening and different levels of split. It showed trace of weathering and was eroded into powder at approximately 1 m above the root, rendering the root conical and leaving the upper half relatively intact. The results are seen in Table 2.

ParametersOld wood in Yingxian Wooden PagodaNew woodOld/new (%)
Compress strength parallel to thegrain (kgf/cm2)467.757681
Chordwise compress strength perpendicular to the grain (kgf/cm2)15.88419
Radial compress strengthperpendicular to the grain (kgf/cm2)20.64645
Tensile strength parallel to the grain (kgf/cm2)651.7129950
Bending strength perpendicularto the grain (kgf/cm2)964.7113385
Chordwise shear strength parallelto the grain (kgf/cm2)#96.268110
Radial shear strength parallel to the grain (kgf/cm2)89.1385105
Chordwise impact hardness (kgf)127.7425.730
End-face impact hardness (kgf/cm2)433377115

### Table  1.

Comparison between old wood in Yingxian Wooden Pagoda and new wood in Ref. [15].

ParametersOld wood in Jingqing GateNew woodOld/new (%)
Compress strength parallel to the grain (kgf/cm2)539427126
Chordwise compress strength perpendicular to the grain (kgf/cm2)42.64987
Radial compress strength perpendicular to the grain (kgf/cm2)57.36588
Tensile strength parallel to the grain (kgf/cm2)450107042
Bending strength perpendicular tothe grain (kgf/cm2)26779634
Chordwise shear strength parallel to the grain (kgf/cm2)10873148
Radial shear strength parallel to the grain (kgf/cm2)10595110
Chordwise splitting strength (kgf/cm2)13.615.886
Chord plane hardness (kgf)372242154
End-face impact hardness (kgf)509306166

### Table  2.

Comparison between old wood in Jingqing Gate and new wood in Ref. [15].

Both experiments proved that after 600–900 years of load bearing, the tensile strength and compressive strength perpendicular to the grain of the material were weakened the most: the former by 50% and the latter by 80% in pinus and poplar, respectively. At the same time, the stiffness and shear strength were enhanced: the former by 11–16% and the latter by 15%. This indicates that old wood material has denser cell structure and therefore higher level of stiffness than new material. And due to the ageing of its internal structure, the material suffered from different level of degeneration concerning other physical properties. Properties relying on late-wood resistance such as compression strength parallel to the grain and bending strength degenerated less heavily and maintained good uniformity while properties relying on early-wood resistance such as tensile strength paralleled to grain degenerated more and maintained good uniformity as well. On the other hand, properties relying on both late wood and early wood such as splitting strength and impact hardness had much poorer uniformity. This points out that the timing takes a great toll on physical properties of wood material.

In 1994, Ni et al. ran chemical component analysis on the replaced columns from the main hall of Bei Yue Temple and Da Bei Lou building in Chang Ling, Hebei province, in northern China during renovation, see Ref. [16]. The two columns were, respectively, 900 and 200 years old and made of Chinese spruce (Picea asperata) and cypress (C. funebris Endl.). Samples in the experiments were taken from the intact part of the column. Results are seen in Table 3.

ComponentTree species
SpruceCypress
OldNewOld/new (%)OldNewOld/new (%)
Moisture content (%)6.656.02110.46.197.5781.8
Ash content (%)0.420.7853.80.580.41141.4
Cold water extract (%)5.531.42389.46.693.42195.6
Hot water extract (%)7.272.68271.27.984.56175.0
Phenethyl alcohol extract (%)6.601.63404.96.356.9092.0
1% NaOH extract (%)25.112.4202.423.517.1137.4
Pentosane (%)11.511.699.116.610.7155.1
Lignin (%)30.028.410633.132.4102.1
Holocellulose (%)58.666.288.556.664.987.2
α-Cellulose (%)36.241.587.234.939.189.2

### Table  3.

Comparison of chemical composition between old wood and new wood in Ref. [16].

It can be inferred from the data that various extract amounts from old wood showed different levels of increase while the amount of holocellulose and α-cellulose decreased, which showed that the main components of cell walls in old wood had degraded and had looser structure than newly lumbered ones. Cellulose is the main cause of high tensile strength parallel to the grain, and hemicellulose and lignin give the material elasticity and compression strength so the decrease of these three components microscopically explains the macrolevel mechanical properties degeneration.

### 3.2. Study on the decay pattern of physical properties, residual strength and longevity of wood material

Due to the special fact that ancient buildings are being reserved, old materials in studies are mostly the small components being replaced during renovation, which severely restrained the study on the strength of wooden structures. And the fact that the strength alters differently under different load conditions makes it even more difficult to study the decay of physical properties of old wood structures.

In 2006, Liu et al. did a study on the relevance between chemical components and bending strength and degree of decay on the old materials from the Wu Ying Palace in the Forbidden City, see Ref. [17]. The experiment samples were from the beam and made of larch. And the decay degrees were determined according to GB/T 13942.2-92, see Ref. [18]. The relationship between decay degree and cellulose and the content of 1% NaOH extracts can be seen in Figure 4. Due to the limited amount of old wood materials, chemical components analysis was carried out on healthy wood with a bending strength of 90, 100 and 110 MPa. The results of the relevance between bending strength and cellulose and the content of 1% NaOH extracts are shown in Figure 5. As the results showed, as the decay degree elevates, 1% NaOH extracts content evidently rises. Positive proportional relation can also be observed between 1% NaOH extracts and bending strength. The study showed that not only can the alkali extracts be used to determine the preliminary decay degree but they can also be used to determine visually healthy materials' physical properties.

To address the issue that in physical property experiments on ancient buildings, old materials are rare and the material qualities of new materials are different from those of the old ones, Xu et al. came up with the solution of accelerating the decay process via inoculation of fungus, see Ref. [19]. The process is to infect the wood with single fungus under suitable environment to accelerate the decay. This study provides the physical properties of wood from different decay degrees and the decay patterns of physical properties of wood from different decay degrees. And it offers a new way of thinking about the quantification of wood decay degree.

### 3.3. Study on modern engineering materials' application in traditional wooden structure

In modern China, all the constructions of new palaces and temples involve reconstruction of pre-existing historic buildings or reference to classic elements. This requires similar construction method as well as high-quality materials. Among the new engineering wood materials, glued-laminated timber (glulam) shows all kinds of advantages such as natural wood texture, high quality of anti-corrosion, high usage and stable physical properties. In addition, glulam also has great plasticity and special expressive ability that can rival steel structure. Being well liked both worldwide and here in China, glulam has been applied to the construction of traditional structures, see Ref. [20].

Xiangji Temple is a historically famous temple in Hangzhou, Zhejiang province, in south-eastern China. First built in 1016 AD, the original building was destroyed in a fire and was rebuilt in 2010 AD. The major structures of the temple's bell tower, drum tower and the Kinnara hall were built in steel while the monastery, the guest house and the dorm rooms were in log structure and the rest were in glulam structure. Glulam combined with traditional roof made a column-free room possible. With the traditional multi-overhanging eaves, the main hall demonstrates a splendid momentum as well as openness and brightness, as seen in Figure 6(a).

In the White Lotus Lore Temple in Shanghai, the Buddha hall has a glulam body. Different from the traditional temples, this temple represents its own era (as seen in Figure 6(b)). Built up high, with large overhanging eaves and mild-slope roof, it was totally built according to the proportion of buildings in Tang Dynasty. It is completely made of glulam and structured with grid structure to make a column-free indoor space.

The Yu Xi Temple Tower in Chao Mountain in Hangzhou, Zhejiang province, in south-eastern China is a pavilion-style tower with an octagonal section and a pillar in the centre. The tower has five floors with four additional floors hidden inside. It was made of glulam and the hidden floors were of structural reinforcing purpose just like those in the Yingxian Wooden Pagoda. The Laojun tower in Qingcheng Mountain, Sichuan province, in south-western China is another wooden structure building built on top of a mountain. After reconstruction, it is 28.05-m high, with a reinforced concrete base. The first and second floors are made of concrete and glulam and from the third through ninth floors are made of glulam, with Douglas fir.

Thanks to the variety of materials and connection types, traditional wooden structures are more frequently combined in modern construction. On the one hand, wood is combined with glass, concrete and steel, resulting in more flexibility in wooden structure design. On the other hand, wooden structure borrowed the steel system such as the grid structure in the White Lotus Lore Temple and the truss system in Kai Yuan Temple which extend the building scale. What's more, traditional mortise and tenon joints are combined with metal joints and adhesives. Through structural innovation and optimization, with advanced construction techniques, contemporary traditional wooden structures will be perfect in structural logic, creativity and details.

## 4. Anti-seismic performance study on traditional Chinese wooden structure

Wooden structures have an outstanding advantage over other forms of structures when it comes to anti-seismic performance. Traditional Chinese wooden buildings have a unique form of structure that allows them to withstand earthquakes with remarkable stability, hence the saying ‘The building stands even though all its walls collapse’. One of the most significant features of traditional Chinese wooden structure is that it ‘emphasizes structural members rather than joints’, so the mechanical properties of joints take a huge toll on the performance of the whole building. This chapter shows studies on anti-seismic performance of key joints and whole buildings.

### 4.1. The anti-seismic structure and mechanics of ancient Chinese wooden structures

After analysing the damage that past earthquakes did on existing ancient wooden structures, experts found that ancient Chinese wooden structures have their unique features in design concepts, structural layout and building techniques. Special building techniques such as the floated joint between a column and the stylobate, the semi-rigid mortise and tenon joint between a beam and a column and the tilt columns and raised columns of the column frame along with the Queti, a kind of trimming joists at the end of a beam, the Dou-gong bracket and the ‘grand roof’, make classic wooden buildings distinct from modern reinforced concrete structures regarding anti-seismic performance.

With relatively high ratio of strength to weight, wooden material can maintain a certain level of resilience and ability to recover from deformation when external forces are applied. The mostly used joint formation between wooden components is semi-rigid mortise and tenon joint which not only improves the resilience of the whole structure but also effectively cancels the horizontal thrust and consumes a notable share of energy generated by the friction and rotation of mortises and tenons. Besides, classic Chinese wooden structure can also consume and absorb seismic energy through the auto-deformation of its load-bearing frame system. Looking at the small components of the structure, it can be found that the connection between the column and the floor is often smooth and horizontal with no embedment or adhesion, which allows the upper section of the building to slide independently and stably as a whole during an earthquake without collapsing. A tilt column means to make the bottom of a column into a gentle slope, resulting in the top of it tilting slightly inward, the mortises and tenons above pressed together and the deadweight of the mortises and tenons providing the original bending moment of the joint. It can also act as an effective limitation on the movement of the upper beam frame. As the transitional layer between the column frame layer and the beam frame layer, the Dou-gong bracket layer is constructed of many small components interlaced, forming an upside-down triangle by using less and less components from top to bottom. It functions as a spring cushion and reduces the earthquake effect. And because of the transition and separation of the Dou-gong bracket layer, the roof and the beam frame as a whole can be analysed as a rigid entirety with slopes, as seen in Figure 7.

Before the 1990s, out of the purpose of reserving cultural heritage, studies on ancient buildings mostly highlighted their historical and artistic qualities rather than scientifically analysing their structures. In 1991, Wang T's analysis (see Ref. [21]) of the static load performance of the critical components, joints and the whole structure of ancient buildings marked the beginning of structural studies on ancient buildings. And studies on ancient Chinese structures have thrived so far. Focusing on the outstanding anti-seismic quality of classic wooden structures, Fan from the Harbin Institute of Technology, Yu and Xue from the Xi'an Jiaotong University, Zhao and Zhang from the Xian University of Architecture and Technology and Fang from the Tsinghua University conducted a large amount of experiments and theoretical analyses on the dynamic features, anti-seismic behaviours, destruction assessment and joint reinforcement. Li from the Taiyuan University of Technology and Zhou from the Peking University, respectively, conducted years of anti-seismic and reinforcing restoration experiments and studies on the Yingxian Wooden Pagoda and ancient buildings in the Forbidden City, as seen in Refs. [2225], for example. Currently, the most commonly used methods of analysing the anti-seismic behaviours of classic wooden structures are static procedure, response spectrum analysis, dynamic-timing analysis and nonlinear static procedure. After years of studying, scholars at home and abroad have come up with methods of building analytical modules such as the semi-rigid calculation module of mortise and tenon joints, the combination module of beam units, the single degree of freedom (SDOF) system module and the mechanics module.

### 4.2. The anti-seismic performance study on mortise and tenon joints and Dou-gong brackets

#### 4.2.1. Mortise and tenon joints

Mortise and tenon joints are often used in classic buildings to join beams and columns. These joints can bear some lateral load and joint-bending moment and allow some rotation and relative slide between the beam and the column. These are all ‘semi-rigid’ features that this type of joints demonstrates, which can consume part of the energy and reduce structural reaction to earthquakes.

As to experiments, Gao et al., see Ref. [26], conducted lateral low-cyclic reversed-loading tests on three wooden structure models with Queti of the watchtower in Xi'an, Shaanxi province, in north-western China. They analysed the deformation features and destruction pattern of joints and found after calculation that the ductility coefficient changes within the range of 1.58–3.99. Xie et al., see Ref. [27], conducted the same experiments on dovetail joint models and discussed the effect on the anti-seismic performance of joints of vertical load, Queti, Pupai-fang components and the module size effect. As to calculation module, Wang simplified mortise and tenon joints as hinges and Queti as cantilevers with load focused on the tips in static calculation of wooden structures and double-checked the load-bearing capacity of components, as seen in Ref. [19]. Fang and Yu et al. built an FE model fit for ancient wooden buildings by defining 3D variable semi-rigid joints that reflect features of the Dou-gong bracket and mortise and tenon, based on studies on structural features of ancient wooden buildings, as seen in Ref. [28] and Figure 8. The module was first used in the calculation of the unequal settlement of the base of the watchtower in Xi'an and then used in the mechanics performance analysis of ancient buildings such as the drum tower in Xi'an, the Baoguo Temple in Ningbo and Zhejiang province, and performed quite a good job. Feng and Zhang et al. (see Ref. [29]) combined the shaking table test on the column frame unit model formed by four columns in the palace hall structure in building standards of Song Dynasty and low-cyclic reversed-loading tests on the model and numerical simulation, conducted lateral vibration analysis and random destruction theoretical analysis on the Dou-gong brackets and studied the features of semi-rigid mortise and tenon joints. And came up with the rigidity formula for mortise and tenon joints and the equivalent viscous damping coefficient.

#### 4.2.2. Dou-gong brackets

Dou-gong bracket, a special connection component between the column and the beam, plays a pivotal role in both structural force transmission and decorative function. Composed by many cantilever joists (named as Gong) staked one on top of another on crossed direction and connected by Dou members, Dou-gong bracket as a whole could just be regarded as a beam pad. This special structure forms as an inverted fixed-hinged support which has compression deflection and rotary movement on vertical plan as well as slip movement on horizontal plan. In respect of structural performance, because of the overhanging on two directions, Dou-gong bracket shortens the span and enhances the load-carrying capacity of upper beams; meanwhile, it helps to adjust the depth of eaves, making it more graceful and harmonious. On the other hand, instead of sticking together, all the Dou and Gong elements are connected by mortise and tenon joints. With the addition of its unique shape with overlapping cantilevers, Dou-gong bracket becomes a ductile connection to dissipate energy between column and beam, especially under lateral forces such as earthquakes.

Chinese scholars mainly conducted studies on two types of Dou-gong brackets: the Song style and the Qing style. During the restoration project of the tower of the east city gate in Xi'an in 1996, with the help of the repair team, Yu et al. conducted and performed static and dynamic experiments on the two types of Dou-gong brackets, see Ref. [30]. Gao et al. performed six 1:3.52 models of the bottom two pieces of Song style 8 layers Dou-gong brackets with second-class material according to the regulations in building standards and came up with load-displacement calculation module, mass-spring-damper model and lateral force-displacement-restoring force model under vertical load via vertical monotonic-loading tests and lateral low-cyclic reversed-loading tests. They also calculated the vertical seismic transmission coefficient and the lateral energy consumption, which showed great two directional anti-seismic performance of the Dou-gong brackets, see Ref. [31]. Sui et al. drew the conclusion of a restoring force model that reflected the restoring features and stiffness variation regulation of Dou-gong through low-cyclic reversed-loading tests on singular-layer, double-layer and quadruple-layer Dou-gong models, see Ref. [32]. As to other transitional types of Dou-gong brackets in the transition periods, our team of the Nanjing Forestry University conducted shaking table tests on full-scale models made of Douglas fir and China fir based on the Dou-gong brackets in the Ming Dynasty Tian Wang Palace of Bao Sheng Temple in Luzhi and analysed factors such as the between-layer displacement reaction features, the contribution ratio of the rotation and slide deformation of the components and the structurally weak-part assessment as seen in Ref. [33] and Figure 9.

As to numerical simulation, Wei, see Ref. [34], studied the non-linear variation patterns of the connection rigidity, calculated the ductility coefficient and the equivalent viscous-damping coefficient and compared results between the axial compression tests and the low-cyclic reversed-loading tests via ANSYS simulation based on the operating mechanism, destruction form and anti-seismic performance of Dou-gong. Du studied the Yingxian Wooden Pagoda, built the simplified models of the rigid connection and hinges in a Dou-gong bracket using the dynamic equivalent features method and calculated the range of the dynamic features though the two simplified models and then applied them to the calculation of the whole tower, see Ref. [35].

## 5. Conservation and reinforcement techniques of historic wooden buildings in China

### 5.1. The principles of historic architecture restoration

Since 1920s, China began to attach importance to the conservation of historic wooden buildings. In 1928, the Central Commission for the Preservation of Antiquitieswas established. In 1929, Zhu et al. founded the Society of the Study of Chinese Architecture. In 1930, the government issued the Regulation of Antiquities Conservation, which symbolized the start of legal management of antiquities. The Law of the People's Republic of China on the Protection of Cultural Relicswas promulgated in 1982, including the protection of antiquities in the law, which symbolized the standardization and internationalization of historic wooden buildings protection. At present, the protection of historic wooden buildings in China mainly follows the International Charter for the Conservation and Restoration of Monuments and Sites, Law of the People's Republic of China on the Protection of Cultural Relicsand the standard GB 50165-92. Maintenance and reinforcement construction comprises regular maintenance project, major project of historic preservation and maintenance, partial restoration project, relocation project and emergency project, and abides by the principle of maintaining the buildings’ original state, including (1) original architectural form such as plane layout, modelling, construction characteristic, artistic style and so on, (2) original building structure, (3) original building materials and (4) processing technology (see Ref. [18]).

### 5.2. Traditional reinforcement techniques of historic wooden buildings

#### 5.2.1. Common damages of historic wooden structures

The common damages of historic wooden structures include (1) component deformation under compression: column yielding such as splitting of column tips under compression, decay on the bottom of columns due to long-term exposure to humidity and splitting along the grain on the body of columns; bending and splitting of girders and square beams between column and Dou-gong brackets; breaking and splitting of subcomponents of Dou-gong brackets. (2) Components under tension: square beams through the columns on the top or the bottom usually get adrift or break off at the mortise and tenon joints. (3) Components under shear strength: the force analyses at the mortise and tenon joints are more complex and the joints tend to detach under long-term shearing action, as seen in Ref. [15].

#### 5.2.2. Traditional reinforcement techniques of ancient wooden buildings

Regarding the whole-beam frame of wooden structures, reinforcement methods include major repair of the structure (disassembling the wooden frame completely of partially, repairing or replacing the damaged components and reassembling it while reinforcing the structure), restoration with external support (adding external support and restoring the tilted, twisted or detached components while reinforcing the structure without disassembling the frame) and overall reinforcement (direct reinforcement of the whole structure of projects with minimum structural deformation).

Reinforcement methods are as follows (Figure 10):

1. Partial or complete replacement: (a) patching and reinforcing. It can be patched up with wooden powder and waterproof adhesives when the splits or corrosion of beams and columns are slight. (b) Reattachment of columns: Replace the rotten part of the column with new materials when the rotten part takes up more than a quarter of the height. The spot where reattachment is conducted is often reinforced with a semi-tenon and an iron hoop. (c) When the damage depth of the beam at both sides takes up more than a third of the height, it is appropriate to use the clamp connection method but when the depth takes up more than three-fifths, a replacement of the beam head is necessary.

2. Mechanical reinforcement: (a) Ironware reinforcement: Using flat iron to reinforce beams and columns or to connect joints between beams and columns. This way, the flat iron can improve the mechanical properties of components by bearing part of the tensile, compressing, bending and shearing forces. (b) When the deflection of beams and square pillars transcends normal limitation or the load-bearing capacity is insufficient or splits are found, it is appropriate to use tensile bars to form now load-bearing components.

3. Chemical reinforcement: Since the 1970s, unsaturated polyester resin filling was widely used in historic building restoration. Via the filling, soaking, patching or painting of chemicals, not only can the strength of the damaged wood be improved but the stability and antirot capacity can also be enhanced. In the restoration of the main palace of Nanchan Temple in Wutai, Shanxi province, 782 AD in 1974, epoxy resin was filled in the splits of two main beams and iron hoops were fixed on the beams. In the 1975 restoration of the main palace of Baoguo Temple in Ningbo, Zhejiang province, 1013 AD, without disassembling the wooden frame, the termite-ridden columns were filled with chemicals and wrapped in fibre-reinforced plastic (FRP). According to calculation, despite the larger expenses of chemical fillings, at least 30% of the budget was saved because disassembling the whole frame was avoided, see Ref. [36].

There are some disadvantages while using the above traditional reinforcement techniques. The ironware is usually applied inside the components and easily corroded so the appearance of the structure may be affected. The antirot chemicals greatly harm the health of the management staff. When using the reattaching method or the tensile bars, the original appearance of the building is inevitably damaged.

### 5.3. The study on and application of FRP reinforcement techniques in historic wooden structures

Fibre-reinforced polymers (FRP) have advantages such as large tensile capacity and are light weight. It can also endure erosion, heat and freezing. Besides, it is highly plastic, easy to apply and inexpensive. As a result, it is widely used in the restoration of reinforced concrete and brick structures. The study on FRP started in the 1990s and has matured in the theory of reinforced concrete restoration. In the field of wooden structure reinforcement, FRP utilization especially carbon fibre-reinforced polymers (CFRP) and glass fibre-reinforced polymers (GFRP) utilization are becoming a heated study topic. Based on relevant studies and projects, FRP reinforcement can reduce several variation coefficients and strength indices of mechanical properties of wooden components. Variation coefficients after reinforcement are limited by 15%. FRP reinforcement can also improve the bearing capacity and reduce the long-term creep of wooden components, optimize the cross-section size and enhance the fire-resisting and antirot capacity.

FRP reinforcement can improve the anti-seismic capacity of mortise-tenon joints. Zhou et al. from The Palace Museum made a special frame model with four beams and four columns at the ratio of 1:8 using the Korean Pine and tenon-mortise connections based on the actual size of the partial frame of the Hall of Great Harmony in the Imperial Palace and conducted exploratory experiments using CFRP fabric. Through low-cyclic reversed-loading tests, load-displacement hysteretic curves were drawn and skeleton curves, energy dissipation capability and stiffness degradation of the structure were analysed. Results show that although the structural energy dissipation capacity decreased slightly after the model is strengthened by CFRP sheets on tenon-mortise location, the cross-section size of the tenon that will pull out of the joint reduces. Its lateral stiffness and load-bearing capacity both improve and with slight stiffness degradation, the frame still has good deformation capacity. Besides, the team also considered to conduct performance comparison among mortise-tenon joint models using nails, iron hoops and CFRP reinforcement. The results showed good deformation capacity preservation in all three scenarios. CFRP fabric excels in joint-bearing capacity and energy dissipation capability but showed the most stiffness degradation. So, it is recommended to use CFRP in reinforcement of medium to small wooden structures (see Ref. [37]).

Huang deducted the calculation of FRP anti-sheering reinforcement using basic materials mechanics formulas. Yang analysed the influence of CFRP and GFRP on the bend-resistant capacity and came up with the formula of ultimate bearing capacity for the analysing method based on failure strain. A team from the Xi'an University of Architecture and Technology did much work on the analysis of and tests on RFP reinforcement in historic building component units and structural joints. Case in point, Xie (see Ref. [38]) tested the bend-resistant capacity of square beams with CFRP reinforcement and compressive strength of cylinder columns and established the calculation of shear strength of beams and compressive strength of columns in different damage forms. Besides, he built scale models of the column frame according to the classic ancient architecture rules in Song Dynasty, 960–1270 AD and conducted low-cyclic reversed-loading tests on the original structure, CFRP sheets-reinforced structure and flat steel-reinforced structure, based on which the restoring force model of wooden structure was established. Hang et al. (see Ref. [39]) analysed the load-bearing performance of damaged joints reinforced with CFRP based on the above-mentioned-reinforcing approach and damage form of the joints, and came up with the calculation of the bend-resistant strength of the joints based on relevant experiments and calculation presumptions.

In the field of construction application, CFRP wrap combined with traditional wooden structure reinforcement methods has already been used on historic buildings such as the Tiananmen Gate tower and explored in a practical manner. In the emergency restoration of Yingxian Wooden Pagoda, in Fogong Temple, Shanxi province, 1056 AD, experts recommended FRP materials to maintain its original appearance. Combined with the characteristics of Chinese wooden structures, FRP reinforcement’s performance in fire-resistant capacity and structural assessment under long-term load awaits further study.

## 6. Conclusions

Chinese traditional wooden architecture, well known as a unique and independent system of the architecture world, has formed its typical structural styles and construction technology after over 7000 years’ development. Besides the research on and conservation and reinforcement status of many precious historical architectural heritages, this chapter is also focused on the analysis of structural features, anti-seismic behaviour and utilization of new materials in traditional wooden architecture based on a large number of studies in recent years.

To better protect ancient wooden structure, many researchers have carried out a large amount of physical properties experiments on wood materials from historic buildings, and a method for predicting the degeneration pattern of physical properties, residual strength and longevity of wood material through studying wood decay has been proposed. In addition to traditional reinforcement techniques such as mechanical reinforcement and partial or complete replacement, new reinforcement materials and techniques have already been explored, among which FRP is becoming a heated academic topic.

The superior seismic performance of Chinese traditional wooden architecture, owing to many unique characteristics of the structural design and constructional technique, has generated a great deal of interest at home and abroad. The objects and models of anti-seismic behaviour study also show characteristics of miniaturization and diversification. In addition to researches on historical wooden buildings, attempts of using new engineering wood products in the modern wooden architectures of traditional style are becoming a great upsurge nowadays.

At present, researches of Chinese traditional wooden structures have made some headway, yet there are also some remaining issues. First, material performance and structural behaviour study of historical wooden buildings are often based on specific emergent repairment and strengthening projects of historical buildings, which somewhat limits the systematization and universality of the researches. Second, attentions have been focused on historic and artistic aspects for a long time, and limited number of fundamental studies on the structural performance of Chinese traditional wooden structure and its typical connections types can be found. What’s more, combine the excellent features of traditional construction technologies with modern materials, techniques, and then inherit and improve them, there is still much work for us to do.

## Acknowledgments

This work was supported by the Special Fund of Top-Notch Academic Programs Project of Jiangsu Higher Education Institutions (TAPP) and National ‘Twelfth Five-Year’ Plan for Science & Technology Support (2015BAD14B0503).

chapter PDF
Citations in RIS format
Citations in bibtex format

## More

© 2017 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

## How to cite and reference

### Cite this chapter Copy to clipboard

Ze-li Que, Zhe-rui Li, Xiao-lan Zhang, Zi-ye Yuan and Biao Pan (March 1st 2017). Traditional Wooden Buildings in China, Wood in Civil Engineering, Giovanna Concu, IntechOpen, DOI: 10.5772/66145. Available from:

### chapter statistics

1Crossref citations

### Related Content

#### Wood in Civil Engineering

Edited by Giovanna Concu

Next chapter

#### Experimental Analyses and Numerical Models of CLT Shear Walls under Cyclic Loading

By Valeria Awad, Linda Giresini, Mikio Koshihara, Mario Lucio Puppio and Mauro Sassu

#### Timber Buildings and Sustainability

Edited by Giovanna Concu

First chapter

#### Introductory Chapter: Timber and Sustainability in Construction

By Giovanna Concu

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.


text:
# Random projectile motion problems.

1. Sep 8, 2009

### Jebus_Chris

1. Trajectory of a projectile is modeled by
$$r(t) = x(t)i+y(t)j$$
$$x(t) =at^2+bt$$
$$x(t) =ct+d$$
It asks for the displacement between t = 1 and t=3 s.
And I got
$$x(t)=8a+2b$$
$$y(t)=2c$$
If it is asking for the displacement would the answer be$$x+y$$ or $$\sqrt{x^2+y^2}$$?

2. The ball falls down from height h (above incline) on incline with angle 45. Calculate how far from striking point, ball will hit incline again if collision is perfectly elastic.

So the velocity it gains from falling would be $$\sqrt{2gh}$$. That would be the initial velocity of when it reflects at 0 degrees. Then you could create the projectile motion equations for it.
$$x=\sqrt{2gh}t$$
$$y=\frac{1}{2}gt^2$$
It will land when the x and y distances are equal. So after replacing the y with x, solving for t in terms of x, and substituting I got x=4h=y. So then the displacement would be $$\sqrt{8}h$$. That right?
Now I originally did this as the ball reflecting at 45(><) and i got $$x=hcos^2\theta (tan^2\theta - 1)$$ That gives you zero but you know that it would eventually hit the ground, why is that?

Last edited: Sep 8, 2009


text:
# Question about calculating the area bounded by a polar curve

Calculate the area bounded by $r = 1 - 2 \sin\theta$ and the axes of Cartesian plane.

I have the solution to the problem. But I was wondering about how we find the $\theta$ boundaries of the area. Finding the $\theta$ intercepts doesn't seem to help much. Is it by trial and error? I am just trying to see what the author of my textbook did to come up with the required $\theta$ intervals.

• Are you looking for areas of the six individual non-overlapping regions? Dec 12 '16 at 20:23

We know that on one cycle from $0$ to $2\pi$, the curve passes through the origin when $\theta=\frac{\pi}{6}$ and when $\theta=\frac{5\pi}{6}$ by setting $1-2\sin\theta=0$.
It crosses an axis when $\theta=0,\frac{\pi}{2},\pi$,and $\frac{3\pi}{2}$.
So the first interval is $0\le\theta\le\frac{\pi}{6}$, the second is $\frac{\pi}{6}\le\theta\le\frac{\pi}{2}$, we can skip the next two regions as "repeats." The next region having distinct area is $\frac{5\pi}{6}\le\theta\le\frac{3\pi}{2}$.