Why is this program not running for full time span ?

4 views (last 30 days)
Hi I have a program for bubble dynamics, i.e. adiabatic expansion & compression of a bubble by solving Rayleigh Plesset equation. The pattached program solves RP equation. An event function exists to merely flag events and NOT stop the program. I was expecting the program to run up to the given time span of 100 microseconds but it is stopping once the bubble is compressed at ~ 60 microseconds. Why is this happenimg ?
My understanding is as follows : When the bubble is expanding the velocity of bubble wall is positive. When this becomes zero at end of expansion (an event is flagged) and compression of the bubble starts because of the applied sinusoidal ultrasonic pressure. When the bubble reaches the end of compression (at ~ 60 microsec) again the wall vel. (which is now negative) becomes zero and event is flagged. Now I am expecting the bubble to start expanding because of the internal pressure as well as the applied ultrasonic pressure (which is now negative) and the cycle to repeat till 100 micro sec. But this isn't happening. Will someone please explain ?
TIA

Answers (2)

Jan
Jan on 19 Jul 2015
If you omit the brute clearing header, you can use the debugger to inspect, what's going on:
clear all;
close all;
clc;
clear all removes all breakpoints from the debugger, what is a crude impeding of the programmer's work. Note that there are no local variables at the top of a function, such that the clearing does not have any benefit.
When I run your code I get a lot of warnings:
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =
1.539743e-034.
> In ode23s at 380
In qwe at 23
Warning: Failure at t=5.522703e-005. Unable to meet integration tolerances without reducing the
step size below the smallest value allowed (1.962058e-019) at time t.
Is this your "~60 micro s"?

Sreedhar
Sreedhar on 20 Jul 2015
Jas Simon Thank you for the reply. Yes t = 55 microsec is where it stops. But how do i get rid of the warnings ? Any help is appreciated
TIA

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!