Skip to main content
1-Visitor
April 17, 2017
Question

Problem with ODEsolve

  • April 17, 2017
  • 2 replies
  • 6375 views

Hello everyone!

I have a question, how can I solve a system of equation, which is consists of three equation (two of them are Differential and other one is not) using ODEsolve or there is some other way?


So I had a system of two differential equation and everything worked just fine, but then I need to add one more equation and this equation is not differential. So I don't know are the ODESOLVE able to solve this kind of systems or not. It keeps telling me, that I have too few initial conditions. File 9 is a file where only 2 equation are solved.


Thanks for your help

2 replies

21-Topaz II
April 18, 2017

Hi Vladimir Novikov,

first of all you should do the following changes:

vnovikov.jpg

21-Topaz II
April 18, 2017

vnovikov2.jpg

vnovikov1-VisitorAuthor
1-Visitor
April 18, 2017

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

25-Diamond I
April 18, 2017

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.

vnovikov1-VisitorAuthor
1-Visitor
April 18, 2017

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).

25-Diamond I
April 19, 2017

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.