Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,361 Was thanked: 822 time(s) in 520 post(s)
|
Originally Posted by: uni It is possible to solve the system in this way, i.e. integrating each equation separately. But here you need to be very careful. ...
Hi Viacheslav. Please, explain me with more details about what do you do. I have two questions: 1. Original equations are decupled? Sorry, I don't check that, I ask it because I assume you see this problem in depth and it's easy for you answer this. 2. Is your setup general for solve an ode with a large interval of integration? This is, I know that if the domain for an ode is too large, numerical methods can be implemented "by parts", with small portions of it, but actually never use that in the practice, or remember practical examples of it. Best regards. Alvaro.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 19/11/2020(UTC) Posts: 34 Location: Ireland Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: uni Euler is still good. Viacheslav, thanks a lot for this advice. Now I try to see if I can make it all work. |
Veniamo da molto lontano e andiamo molto lontano! Palmiro Togliatti |
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
Originally Posted by: Razonar Hi Viacheslav. Please, explain me with more details about what do you do. I have two questions:
1. Original equations are decupled? Sorry, I don't check that, I ask it because I assume you see this problem in depth and it's easy for you answer this. No. I showed the same method, only written differently. For this example both algorithms do almost the same thing. Originally Posted by: Razonar 2. Is your setup general for solve an ode with a large interval of integration? This is, I know that if the domain for an ode is too large, numerical methods can be implemented "by parts", with small portions of it, but actually never use that in the practice, or remember practical examples of it. Yes, you can split a large interval into small portions. The solvers themselves do this. Usually inside the solver there is a loop in which a so-called step-function is called for each portion. This step-function can also split the portion into small parts depending on the complexity or accuracy of the method. I didn’t point out correctly that it can be integrated separately. I meant that you can split the vector of derivatives D(t,x) into separate parts and integrate each element separately. Since the equations are dependent on each other, then this should be done as I showed. I did this to make it easier to add elements to the vector of derivatives. Instead of one huge program block, you get many small expressions. This may not always be done, but if the derivatives are smooth over a given interval, then you can even use Euler's method. I just took the inner for-loop of the solver out and limited the solution to two points (one step). That's all. |
Russia ☭ forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
I have seen this type of construction from Viacheslav himself, long time ago. Just not directly implementable from the ODE library, maybe the last SS. 1. Fill-in all those '?' ... what are they ? 2. Compare solutions with the "paper PDF" 3. The compactum program adds confusion. 4. Always think in term of sanity check outside Smath, i.e: make it piece wise. Prova modello permeabilita Initial.sm (159kb) downloaded 7 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,361 Was thanked: 822 time(s) in 520 post(s)
|
Hi. Thanks Viacheslav for your answer. In the attached, the usual setup for the system of two equations with two unknowns, showing that uni's solution it's the same than the given by Rkadapt. I also can setup a good solution for a 4x4 ode system, but the r's coeffs must to be recalculated before the concentration of O & CO. If not we get a nonsense solution, and guess that this issue is why it's hard to setup a system with more variables, as efus comment that is required. So probably he must to study in which order the updates must to be evaluated for the physical situation. But what's more impressive to me, it's the Viacheslav intuition for the magistral setup that he do for solve the problem with a runge kutta method with ... one as the step!. Ok, he's the author of the solver plugin, maybe he know what it's talking about. Modeling respiration-transpiration in a modified atmosphere packaging system containing blueberry 2 (uni).sm (24kb) downloaded 6 time(s).Best regards. Alvaro.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
I wanted a compact and scalable algorithm. You, Alvaro, did it better. It should be remembered that the values of the variables r1 and r2 are implicitly passed to the expressions for derivatives. The solvers also support optional parameters after t and x. You can enter both variables r1 and r2: D( t,x,r1,r2 ). This will make the calculation of derivative values clearer. For those who are not familiar with numerical methods, it is difficult to describe the problem for the solver. I still can't finish a new solver, where the system can be written in a natural form, like a set of equations. This would make things easier for most typical cases. Edited by user 30 November 2020 21:26:43(UTC)
| Reason: Not specified |
Russia ☭ forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 19/11/2020(UTC) Posts: 34 Location: Ireland Was thanked: 1 time(s) in 1 post(s)
|
In any case, I have really to give a very big thank you to every one of you.
What I'm learning from all your post is really useful and interesting.
|
Veniamo da molto lontano e andiamo molto lontano! Palmiro Togliatti |
1 user thanked efus for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,361 Was thanked: 822 time(s) in 520 post(s)
|
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: efus What I'm learning from all your post is really useful and interesting. The ancestor of all these solvers is Euler [Fortran 1970], print stars instead of line. Your two system DE's can you make them Euler style ? ODE Euler Multitask.sm (130kb) downloaded 17 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 19/11/2020(UTC) Posts: 34 Location: Ireland Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Jean Giraud Originally Posted by: efus What I'm learning from all your post is really useful and interesting. The ancestor of all these solvers is Euler [Fortran 1970], print stars instead of line. Your two system DE's can you make them Euler style ? ODE Euler Multitask.sm (130kb) downloaded 17 time(s). To be honest, really I don't know if is possible, I can try and we will see what happens. The problem with these 5 ODE is that they aren't really stable and a lot of strange things happen if the order of resolution isn't correct. For sure isn't the best-case scenario to face for someone like me, that has basically zero experience with software/numerical methods. Now I'm sure that in R someone was able to implement and validate it...but really I would like to avoid it for the moment I will spend this week working on all your advice and trying various approaches, in a way or another some sort of result will come! |
Veniamo da molto lontano e andiamo molto lontano! Palmiro Togliatti |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: efus The problem with these 5 ODE is that they aren't really stable Why don't you stick with the two DE's from the paper ? In fact you just want to reproduce the paper, before getting lost in adventure. If all those things/coefficients aren't identified, may as well don't have. Presume some smart cat has done the project otherwise than Smath, looking at your proposal will discredit both in red cross all over. Why not first reproduce the paper 1/1, c/w the plotted solutions ? From there, if solutions deviate from lab test ... what is the cause. This is in fact the interest of the adventure, isn't ?
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
|
Russia ☭ forever Viacheslav N. Mezentsev |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 19/11/2020(UTC) Posts: 34 Location: Ireland Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Jean Giraud Originally Posted by: efus The problem with these 5 ODE is that they aren't really stable Why don't you stick with the two DE's from the paper ? In fact you just want to reproduce the paper, before getting lost in adventure. If all those things/coefficients aren't identified, may as well don't have. Presume some smart cat has done the project otherwise than Smath, looking at your proposal will discredit both in red cross all over. Why not first reproduce the paper 1/1, c/w the plotted solutions ? From there, if solutions deviate from lab test ... what is the cause. This is in fact the interest of the adventure, isn't ? Jean, unfortunately, the model on paper has more than these two ODE, so even for the comparing of results would be needed to implement all the other pieces. The respiration and transpiration rate are both temperature-dependent. In any case, the implementation of the system of two made by Viacheslav work really well and the results have a physical sense, so being more precise require do add more things. Someone suggest me to try to use lsoda for this problem...I have to try. You know "Audentes Fortuna iuvat" |
Veniamo da molto lontano e andiamo molto lontano! Palmiro Togliatti |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
ISODA is too much for me, I didn't see much maths/graphs. My friend next door used to transport raspberries from California => Montréal. Temperature control was fine. The most impressive was the opening of the cargo at destination. They had to wear mask of the Scot Pack style to avoid poisoning from the dreadful environment in the cargo. A DE's system of 7 is pretty big monster. It could probably be optimized via Mathcad ODEsolve, GivenMinerr, having the 7 sets of lab data. Up to 3 was done for different applications [Medical, Chemical ...] @ 1000 km per driver, California => Montréal is 3 days journey 2 drivers. Hurry to see the 7 parametric DE's system in piece wise mode. Cheers ... Jean
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,361 Was thanked: 822 time(s) in 520 post(s)
|
Originally Posted by: uni Originally Posted by: Razonar I did not know this feature of your plugin. Here, in case that this setup it's ok, it fails, I guess for the order in the updates too. This was mentioned here. ... Hi uni. I forgot this feature because I always thinks that it was the same as the matlab parameter placeholder, just to avoid to declare global variables for the local ones that usually appear in the m-script for define the function D. This could be more or less useless in SMath but here I think that you have an actual example of a mandatory use for this feature, because if not the RK procedure gives a bad solution if you don't pay attention to the order of the updates inside the D procedure, as first issue. I guess that there are more. Originally Posted by: uni ...
This is an optional feature. Everything works without explicitly specifying variables, but this is not always clear.
I bad implement this feature in my example, and you show how to implement it well. Just as comment, for no pass parameters as global values at all, this is a minor modification: Originally Posted by: efus ... In any case, the implementation of the system of two made by Viacheslav work really well and the results have a physical sense, so being more precise require do add more things. ... Thanks efus for this drawing describing the physical situation. Best regards. Alvaro Edited by user 01 December 2020 19:44:36(UTC)
| Reason: Not specified
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
.... that's what I meant by piece wise modular [a system of 8 DE's] Radau DE solver was designed by Mathsoft for this difficult example. dn_GearsBDF does 1/1 in native Smath. ODE HIRES.sm (68kb) downloaded 6 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 19/11/2020(UTC) Posts: 34 Location: Ireland Was thanked: 1 time(s) in 1 post(s)
|
Ok, starting from an example from Viacheslav (Thx really a lot for all your work) I was able to use lsoda for the two and the result is quite good, so I will try to work another little on this road and we will see if I will be able also to add the others pieces. Edit. Ok, probably how the system is written isn't the most elegant thing to see, but the loss of weight due to respiration seems to be well represented (green line). The effect of the humidity isn't, at the moment, represented, but with a little bit of work I think it will do. lsoda MAP.sm (44kb) downloaded 7 time(s).Quote:. that's what I meant by piece wise modular [a system of 8 DE's] Radau DE solver was designed by Mathsoft for this difficult example. dn_GearsBDF does 1/1 in native Smath. Thx a lot Jean, now I give it a look, I'm quite sure that I can learn useful stuff from it! Quote:Thanks efus for this drawing describing the physical situation.
Ah google come in my help for the pictures, but yes, it describes exactly what happened in the package. Edited by user 01 December 2020 22:36:18(UTC)
| Reason: Not specified |
Veniamo da molto lontano e andiamo molto lontano! Palmiro Togliatti |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,361 Was thanked: 822 time(s) in 520 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 19/11/2020(UTC) Posts: 34 Location: Ireland Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: Razonar The plugin is for sure interesting! I have intention in the future to face some problem related to respiration with a pure thermodynamic approach, so for sure it will be handy! Regarding "things happens" I have to make some confrontation in the results, but for sure know this is extremely important! So thank you a lot! Francesco. |
Veniamo da molto lontano e andiamo molto lontano! Palmiro Togliatti |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Franceso, What I understand, this particular project is Isoda Blueberries It can't be sanity check via one of the most, if not the most reputed Mathcad/Mathsoft. Not even from native original Smath ... any lab data set to sanity the plots ? We are not in phase in this project, sorry ... Cheers ... Jean gone.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.