Clear Filters
Clear Filters

Why is my model not converging with ode45 solver ?

36 views (last 30 days)
ALOYS
ALOYS on 16 Aug 2024 at 11:52
Commented: Sam Chak on 17 Aug 2024 at 10:37
I am trying to simulate an electronical device that can be modeled by a mass-spring-damper system with an additional non-linear force. The equation at the equilibrium for the system is the following :
The goal of my MATLAB code is to solve this equation for $x$ and find the equilibrium. For this purpose, I use the `ode45` function like this (all coefficient are defined in my code but not shown here) :
x0 = 0;
[t, x] = ode45(@(t, x) odefun(t, x, eps0, a, V0, B, d0, K), tspan, x0);
function dxdt = odefun(t, x, eps, a, V, B, d0, K)
dxdt = ((eps * a * V^2) ./ (2 * B * (d0 - x).^2)) + ((K / B) .* x);
end
The equation is good according to my teachers and several papers but the solver never converges and I can't see why. All coefficient are defined according to the dimensions of a capacitive micromachined ultrasound transducer. The solution of ode45 is the following :
This is obviously wrong because the dimensions of a cmut are bellow millimeter.
Can you see any mistakes in the way I use the ode45 solver ?
Full code :
% DIMENSIONS DE LA MEMBRANE
e = 500e-9; % epaisseur [m]
r = 20e-6; % rayon [m]
d0 = 550e-9; % epaisseur de cavite [m]
a = pi * r^2; % surface de la membrane [m^2]
% PARAMETRES MECANIQUES
E = 200e9; % module d'Young du SiN [Pa]
nu = 0.25; % coefficient de poisson du SiN
eta = 18.5e-6; % viscosité dynamique de l'air [Pa.s]
p0 = 1e5; % pression exterieure [Pa]
rhoSiN = 3170; % densite du SiN [Kg/m^3]
m = rhoSiN * a * e; % masse membrane [Kg]
K = (16 * E * e^3) / (3 * (1 - nu^2) * r^2); % raideur [N/m]
B = (eta * pi * r^2) / e; % amortissement [N.s/m]
% PARAMETRES ELECTRIQUES
eps0 = 8.85e-12; % permittivité diélectrique du vide [F/m]
V0 = 10; % tension de polarisation [V]
% Conditions initiales et plage de temps
x0 = 0;
ti = 0; tf = 1e-3;
dt = 1e-6;
tspan = linspace(ti, tf, 1/dt);
% Résolution par RK4
[t, x] = ode45(@(t, x) odefun(t, x, eps0, a, V0, B, d0, K), tspan, x0);
plot(t,x,'-')
function dxdt = odefun(t, x, eps, a, V, B, d0, K)
dxdt = ((eps * a * V^2) ./ (2 * B * (d0 - x).^2)) + ((K / B) .* x);
end
References :
- Y. Wang, L. -M. He, Z. Li, W. Xu and J. Ren, "A computationally efficient nonlinear dynamic model for cMUT based on COMSOL and MATLAB/Simulink"
- T. Merrien, A. Boulmé and D. Certon, "Lumped-Parameter Equivalent Circuit Modeling of CMUT Array Elements"
I tried several solver from MATLAB and implemented my own Runge-Kutta algorithm based on the Wikipedia example. I also verified the coefficients according to my references.

Accepted Answer

Sam Chak
Sam Chak on 16 Aug 2024 at 12:21
My guess is that if the coefficient is a positive value, then the system will be unstable.
  5 Comments
ALOYS
ALOYS on 17 Aug 2024 at 9:47
Edited: ALOYS on 17 Aug 2024 at 9:47
You are right ! The sign on the K/B term was wrong. Now my model gives accurate predictions according to my tests on the real device. This will be the first part of my internship report.
Sam Chak
Sam Chak on 17 Aug 2024 at 10:37
Hi @ALOYS, I'm glad it worked out. If you find the solution helpful, please consider clicking 'Accept' ✔ on the answer and voting 👍 for it. Your support is greatly appreciated!
Thank you, @William Rose.

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!