Fitting PDE to estimate parameters

20 vues (au cours des 30 derniers jours)
James99
James99 le 8 Sep 2023
Commenté : James99 le 8 Sep 2023
Hello!
I am trying to fit my PDE to estimate two parameters. I've been using lsqnonlin and since it solves for the smallest SSE, the results are quite inadequate, for this case. Is there any other way to do this or am I going wrong somewhere.
  4 commentaires
Star Strider
Star Strider le 8 Sep 2023
MATLAB has PDE solvers (an entire toolbox designed for that, as well as the pdepe function) and bvp4c and bvp5c for boundary value problems.
What are your original differential equations?
James99
James99 le 8 Sep 2023
Modifié(e) : James99 le 8 Sep 2023
I am modelling fixed bed adsorption using linear driving force model.
The equations are:
(Mass balance in fixed bed) (1)
(Average adsorption in the particles of adsorbent) (2)
(Langmuir equilibrium equation) (3)
Note that the De (in my code) is the same as Dz, (3) is substituted in (2) which is substituted in (1).
The parameters I am estimating are Dz and k_LDF.
The initial and coundary conditions for (1) are:
IC
IC
BC1
BC2
By the way, if you just solve the ode using the initial guess as the missing parameters, it gives a good fit. I just wanted a more official answer.

Connectez-vous pour commenter.

Réponse acceptée

Star Strider
Star Strider le 8 Sep 2023
I see one problem:
residual = Ccalc - Cexp;
that is easily fixed by using the norm function (here calculating the square root of the sum of squares):
residual = norm(Ccalc - Cexp);
resulting in a significant improvement in the estimated parameters. That then produces:
De =
0.0081
kf =
0.0024
which is correct for ‘De’ however is off by a factor of for ‘kf’, since (as you mentioned) the original parameter estimates produce a good fit to the data, and the estimated value for ‘kf’ is 1000 times larger than the initial value for ‘kf’ that gives a good fit. I looked through your code, and I do not immediately see any error that could account for that discrepancy. I have to leave that to you.
.
  6 commentaires
Torsten
Torsten le 8 Sep 2023
Convection (u) dominates diffusion (D_z) so drastically that you won't be able to fit D_z whatever you supply as data basis.
And I see you now have an adsorption isotherm taken off the hat. Why didn't you use it for your model including particle diffusion ? Did you think it's superfluous there ?
James99
James99 le 8 Sep 2023
Hello @Torsten!
Are you referring to one of my previous questions?

Connectez-vous pour commenter.

Plus de réponses (1)

Shoresh Shokoohi
Shoresh Shokoohi le 8 Sep 2023
Fitting a partial differential equation (PDE) to estimate parameters can be a challenging task, especially when using traditional least-squares methods like `lsqnonlin` that minimize the sum of squared errors (SSE). PDE parameter estimation often involves non-linear, ill-posed problems, and the choice of optimization algorithm and initial parameter estimates is crucial. Here are some suggestions for improving your parameter estimation process:
1. Choose a Suitable Optimization Algorithm**: While `lsqnonlin` is a commonly used optimization function in MATLAB, it may not always be the best choice for PDE parameter estimation. Consider trying different optimization algorithms that are specifically designed for complex and non-linear problems. Some alternatives include:
- Particle Swarm Optimization (PSO)**: PSO is a population-based optimization algorithm that can handle non-linear problems effectively.
- Genetic Algorithms (GA)**: GAs are another population-based optimization technique that can be useful for parameter estimation in PDEs.
- Pattern Search**: The `patternsearch` function in MATLAB is designed for optimization problems with non-linear constraints.
2. Properly Regularize the Problem**: Regularization can help stabilize parameter estimation in ill-posed problems. Consider adding regularization terms to your objective function to encourage smooth or sparse parameter estimates, depending on your prior knowledge about the parameters.
3. Properly Define the Objective Function**: Ensure that your objective function accurately represents the error between the PDE model and your experimental data. It's essential to properly implement the numerical solution of the PDE with the current parameter estimates and compare it to the observed data.
4. Initial Parameter Estimates**: The choice of initial parameter estimates can significantly impact the optimization process. Try different initial values, and consider using your domain knowledge or sensitivity analysis to make informed guesses.
5. Constraint Handling**: If your parameters have physical bounds, ensure that you impose appropriate constraints during optimization to keep the estimates within realistic ranges.
6. Data Preprocessing**: Preprocess your experimental data appropriately by addressing outliers and noise. Smooth or filter the data if necessary.
7. Convergence Criteria**: Adjust the convergence criteria for your optimization algorithm to ensure that it has sufficient iterations to find a good solution.
8. Global Optimization**: Consider using global optimization techniques, such as the Genetic Algorithm or Particle Swarm Optimization, which can explore a broader parameter space to find global minima.
9. Parallel Computing**: Depending on the complexity of your PDE and the optimization problem, you might benefit from parallel computing to speed up the parameter estimation process.
10. Expert Consultation**: If the problem remains challenging, consider consulting with experts in numerical optimization or PDEs for guidance.

Community Treasure Hunt

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

Start Hunting!

Translated by