Giter VIP home page Giter VIP logo

1d-hydrogel-modelling's Introduction

1d-hydrogel-modelling

This repository hosts the work made towards my summer research internship at the University of Birmingham studying 1d thermo-responsive hydrogels. Here you can find my final report (entitled Shrinking and Swelling Dynamics in 1D Thermo-Responsive Hydrogels) and a numerical scheme used to solve the non-linear PDE for porosity in a 1d gel.

There are 3 main .m files:

equilibriumCurve.m: this produces a plot of $(T,\lambda)$ phase-space with the equilibrium curve, spinodal and coexistence regions.

uniformTempDynamics.m: this runs the solver for scenario where the temperature is abruptly and uniformly changed throughout the gel. Try to keep temperatures in range 300-320 K, as otherwise fsolve often won't work. Need to pass the struct contained in params.mat as an argument to this function for it to work, together with the number of spatial steps, the time step, time range to solve for, the frequency of measurements of fluid fraction and gel length, whether you want a graphical output or not, and what file name to save under.

plotUniformTempDynamics.m: this produces a 3d surface plot with time on the x-axis, position on the y-axis and porosity on the z-axis.

All other files are utility functions and should be self-explanatory:

boundaryPhi.m evaluates the porosity at the right-hand-boundary that satisfies the BC there.

equilibriumT.m calculates the equilibrium temperature for a given porosity.

firstDerivative.m returns the first spatial derivative of an array, calculated using finite differences to a given accuracy - i'd suggest using accuracy=2.

params.mat is the mat file which contains the parameters for the gel, e.g. the chi function $\chi(T)$, $\Omega$ etc.

polymerVolume.m is a file for evaluating the error in the calculated amount of polymer in the gel at any given instant, used for validation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.