What's the most efficient approach to fit diffusivity in a mass transfer PDE by using experiment​ally-deter​mined mass released as a target?

5 次查看(过去 30 天)
So I'm attempting to determine the diffusitivty of a substance diffusing out of a polymeric matrix. I've set up some code which describes the problem through Fick's second law. I've also got an experiment running which mirrors the code, where I measure mass of substance released at specified time points. My only unknown is the diffusivity (D) of the substance in the polymeric matrix. I'm wondering what the most efficient route is to fitting D to the experimental data.
What my code currently provides me with is concentration of my substance within a spherical matrix varying over r (for some arbitrary D). I then use trapz to estimate the mass of substance released at each time point.
Now that I have experimentally-sourced data for mass released, I'm wondering how best to determine D in my code. My initial thought was to iteratively swing D between two reasonable limits, determine mass released at each successive swing point through trapz (as described above), and stop when mass released matches its experimental value within some tolerance window.
I'm having doubts as to whether this is the most elegant way forward. Any thoughts?

回答(1 个)

Harsh Sanghai
Harsh Sanghai 2023-3-23
Hi,
This method may be computationally expensive, and the accuracy of the results may depend on the chosen initial range of diffusivity coefficients and the size of the steps between them.
An alternative approach is to use an optimization algorithm to fit the diffusivity coefficient to the experimental data. Optimization algorithms are designed to find the values of one or more parameters that minimize a given function (e.g., the difference between the experimental and computed mass released as a function of time).
Here are a few optimization algorithms that you could use to fit the diffusivity coefficient:
  1. Gradient descent: This is a simple optimization algorithm that iteratively adjusts the value of the diffusivity coefficient in the direction of the steepest descent of the objective function. The algorithm stops when the objective function reaches a minimum or a predefined number of iterations is reached.
  2. Nelder-Mead simplex algorithm: This is another iterative algorithm that searches for the minimum of a function, but it does not require the gradient of the objective function. Instead, it constructs a simplex (a set of points in the parameter space) and iteratively moves and reflects this simplex until the minimum is found.
You can implement these optimization algorithms using MATLAB's built-in optimization functions or by writing your own code. Before using any of these optimization algorithms, it is important to define an objective function that captures the difference between the experimental and computed mass released as a function of time. Once you have defined the objective function, you can use it as input to the optimization algorithm and iteratively adjust the diffusivity coefficient until the objective function is minimized.

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by