cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with ODEsolve

Re: Problem with ODEsolve

Here is the solving block. This system of equation describes evaporation process of spherical drop. The first equation is about changing its temperature during evaporation. The second one is about changing its radius during evaporation. The third is about changing of humidity. So phi in this last equation is relative humidity. The phi is the relative humidity far away from water droplet and it is constant and phiк(tau) is the relative humidity near droplet it is unknown value and i need to find it. I wanna have it like the function of tau (time). So i think i should somehow rewrite the third equation as Zero-order differential equation if it possible.

Снимок.JPG

Re: Problem with ODEsolve

Attach is an absolutely unsatisfactory solution by turning phik into a function in an extra solve block.

I had to limit tau1 because of a strange error if its too large and the phi solve block takes quite long to calculate for higher values of tau.

Maybe its a tolerance problem because of too hight or too low values - when I set TOL to a lower value liek 10^-9 the odesolveblock fails for lower values of tau1, too.

Hope somebody has a better idea to tackle with that system.

Re: Problem with ODEsolve

Thanks for help, but I need something little bit different. The main idea is to get a function of phik(tau) from the third equation to insert it in two previous equations. So I will get function of temperature and radius related to changing relative humidity (phik).

Re: Problem with ODEsolve

F.M. wrote:

I would say that not all the units are written in text boxes, on the contrary, many are written as if they were variables. The first (° C) for sure.

I wrote, that the units are placed  "in a textbox or separate math region". For the °C the latter applies. None of the units you see are in play in the calculations!

Re: Problem with ODEsolve

F.M. wrote:

I was attaching:

Why? We have the sheet from the OP and I guess adding the units did not solve the problem the OP is facing, right?

On contrary - adding units makes it worse as odesolve will not work, even if if the rest would be OK.

You may give it a try: Use his sheet 9.xmcd, which is working OK, add the units where you think there should be units and see, if the odesolve-block still works OK.

Re: Problem with ODEsolve

Not sure. I noticed it, too, but left it in place because phi is a defined variable (0.5). So I guessed its there on purpose. But chances are that this phi simply is left over from the simpler version in sheet 9 and really shoul be the function. I'll see if my unsatisfactory solution performs better with that change.

The OP will clear the questions.

EDIT: Making the change you suggest makes the solve blocks perform much better and faster, but RT and TK now are constant functions 😉

Re: Problem with ODEsolve

Снимок1.JPG

your solution doesn't seems to work fine for me(((

Re: Problem with ODEsolve

Vladimir Novikov wrote:

your solution doesn't seems to work fine for me(((

Yes, The solution sure is unsatisfactory. I guess that you had changed the value of the system variable TOL from the default 10^-3 to something smaller. Try TOL:=10^-3 at the top of your sheet.

You may also set tau1 to a value lower than the 250 which worked for me.

But as your original sheet demanded to solve up to tau1=2000 (or was it even 20000?) I guess this would not be a satisfactory option.

Re: Problem with ODEsolve

Yes, if my solution would work OK, which it obviously doesn't, you could, after solving for TK and RT, define phi_k(tau):=phik(TK(tau),RT(tau)) and you have the demanded for function. A bit inefficient, as the every call to this function phi_k would call the odesolveblock twice.

Here is what I get with tau1=250 AND TOL=CTOL=10^-3.

Setting CTOL to 10^-4 or lower and/or TOL to 10^-6 or lower makes the block fail (lower values for tau1 work OK). This may indicate a convergence problem. Cause could be values near the limits (too large or to low) or a problem with the equations used.

There seems to be an abrupt jump right at the beginning.

Not sure if thats what you expect. If not, you may wish to check your equations.

For whatever it may be worth I attach the sheet with the settings for CTOL and TOL which work for me and added phi_k at the end.