Droplet Profile in Matlab- ODE stability

In summary, the conversation discusses the process of modeling a droplet's profile using MATLAB. The speaker has coded differential equations and applied a solver, but the result shows a continuous spiral. They mention trying different solvers and limiting the time span, but they want to find a stable solution. They plan to try a boundary value approach after exploring the initial value approach. The equations used for solutions and the droplet ODE function are also mentioned, along with a potential solution for the NaN issue that arises when using the proper initialization.
  • #1
Kudaros
18
0
Hello,

I'm currently modeling the profile of a droplet (sessile drop, axisymmetric) in matlab. I've coded differential equations, applied the solver, and I get a reasonable result, except that it spirals continuously.

The ODE's in question are:
[tex]
\frac{dx}{ds}=cos(\theta)
[/tex]
[tex]
\frac{dz}{ds}=sin(\theta)
[/tex]
[tex]
\frac{d\theta}{ds}=2b+cz-\frac{sin(\theta)}{x}.
[/tex]

ode23/45, etc produce similar results. I could limit my tspan so that the spiral doesn't continue, but I would like it to hit on a stable solution. I have yet to try a boundary value approach, but, while I am familiar with MATLAB in other areas, I have never used it to solve ODEs, so I would like to try this initial value approach first.

For solutions I use:
[s,x]=ode23(@(s,x)drpivp(s,x,p),sspan,x0);

where p contains two parameters and x0 contains initial angle theta, x, z values.
droplet ODE function:
function drpivp = drpivp(s,x,p);
%x(1)=theta
%x(2)=x
%x(3)=z
%r0 is curvature at apex
%c is capillarity constant
r0=p(1);
c=p(2);
drpivp=[2/p(1)+p(2)*x(3)-sin(x(1))/x(2); cos(x(1)); sin(x(1))];
%if you put an 'end' it reduces the required number of arguments - why?

Thanks!
 

Attachments

  • spiral.jpg
    spiral.jpg
    32.3 KB · Views: 521
Last edited:
Physics news on Phys.org
  • #2
Thinking about this further, I realized I initialized with [itex] [\theta x z]=[1 1 1] [/itex] just to avoid the NaN issue that rises when using the proper initialization of [0 0 0]. The set of equations is parametrized with respect to the arc length. At [itex] s=0 ,x=z=\theta=0.[/itex]

To avoid this NaN issue, I need to change [itex] \frac{d\theta}{ds}=b,[/itex] as this is the condition at [itex]s=0[/itex]. It isn't clear to me how to have the first ODE be something different for a particular value of s, though.
 

FAQ: Droplet Profile in Matlab- ODE stability

What is a droplet profile in Matlab?

A droplet profile in Matlab refers to the representation of a droplet's shape and characteristics using a mathematical model. This model is used to simulate the behavior of a droplet over time and can provide insights into its stability and other properties.

What is an ODE in Matlab?

An ODE (Ordinary Differential Equation) in Matlab is a mathematical equation that describes the relationship between a function and its derivatives. It is commonly used to model dynamic systems and can be solved using numerical methods.

How do I determine the stability of a droplet using Matlab?

The stability of a droplet can be determined by solving the ODEs that govern its behavior in Matlab. This involves simulating the droplet's profile over time and observing its behavior. A stable droplet will maintain its shape, while an unstable droplet will deform or break up.

What factors can affect the stability of a droplet in Matlab?

The stability of a droplet in Matlab can be affected by various factors, such as surface tension, viscosity, gravity, and external forces. These factors can be incorporated into the ODEs to accurately simulate the droplet's behavior.

Can I use Matlab to optimize the stability of a droplet?

Yes, Matlab can be used to optimize the stability of a droplet by adjusting the parameters in the ODEs and running simulations. This allows for the identification of the most stable droplet profile under different conditions.

Similar threads

Replies
5
Views
2K
Replies
2
Views
3K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
8
Views
2K
Back
Top