Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


4 Pages<1234>
Options
Go to last post Go to first unread
Offline Razonar  
#41 Posted : 30 November 2020 15:46:59(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: uni Go to Quoted Post
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.
Offline efus  
#42 Posted : 30 November 2020 16:43:16(UTC)
efus


Rank: Advanced Member

Groups: Registered
Joined: 19/11/2020(UTC)
Posts: 34
Man
Italy
Location: Ireland

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: uni Go to Quoted Post
Euler is still good.

Modeling respiration-transpiration in a modified atmosphere packaging system containing blueberry 2 (uni).png


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
Offline uni  
#43 Posted : 30 November 2020 17:30:17(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: Razonar Go to Quoted Post
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 Go to Quoted Post
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
thanks 1 user thanked uni for this useful post.
on 30/11/2020(UTC)
Offline Jean Giraud  
#44 Posted : 30 November 2020 18:38:10(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

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).
Offline Razonar  
#45 Posted : 30 November 2020 20:33:17(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 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.
Offline uni  
#46 Posted : 30 November 2020 21:15:22(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

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
thanks 1 user thanked uni for this useful post.
on 30/11/2020(UTC)
Offline efus  
#47 Posted : 30 November 2020 22:21:22(UTC)
efus


Rank: Advanced Member

Groups: Registered
Joined: 19/11/2020(UTC)
Posts: 34
Man
Italy
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
thanks 1 user thanked efus for this useful post.
on 30/11/2020(UTC)
Offline Razonar  
#48 Posted : 30 November 2020 22:44:44(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: uni Go to Quoted Post
... 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.


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.

Modeling respiration-transpiration in a modified atmosphere packaging system containing blueberry 2 (uni).sm (52kb) downloaded 7 time(s).

Best regards.
Alvaro.
Offline Jean Giraud  
#49 Posted : 30 November 2020 22:45:29(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: efus Go to Quoted Post
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).
Offline efus  
#50 Posted : 01 December 2020 03:08:01(UTC)
efus


Rank: Advanced Member

Groups: Registered
Joined: 19/11/2020(UTC)
Posts: 34
Man
Italy
Location: Ireland

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: efus Go to Quoted Post
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 Rofl

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
Offline Jean Giraud  
#51 Posted : 01 December 2020 03:35:52(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: efus Go to Quoted Post
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 ?
Offline uni  
#52 Posted : 01 December 2020 08:59:33(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
Originally Posted by: Razonar Go to Quoted Post
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.

Modeling respiration-transpiration in a modified atmosphere packaging system containing blueberry 3 (uni).sm (19kb) downloaded 9 time(s).
Modeling respiration-transpiration in a modified atmosphere packaging system containing blueberry 3 (uni).pdf (80kb) downloaded 3 time(s).

Modeling respiration-transpiration in a modified atmosphere packaging system containing blueberry 4 (uni).sm (19kb) downloaded 7 time(s).
Modeling respiration-transpiration in a modified atmosphere packaging system containing blueberry 4 (uni).pdf (78kb) downloaded 4 time(s).

This is an optional feature. Everything works without explicitly specifying variables, but this is not always clear.

Modeling respiration-transpiration in a modified atmosphere packaging system containing blueberry 3 (uni).png Modeling respiration-transpiration in a modified atmosphere packaging system containing blueberry 4 (uni).png

Edited by user 01 December 2020 09:27:18(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline efus  
#53 Posted : 01 December 2020 13:34:38(UTC)
efus


Rank: Advanced Member

Groups: Registered
Joined: 19/11/2020(UTC)
Posts: 34
Man
Italy
Location: Ireland

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: efus Go to Quoted Post
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.

Capture.PNG

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" Biggrin
Veniamo da molto lontano e andiamo molto lontano! Palmiro Togliatti
Offline Jean Giraud  
#54 Posted : 01 December 2020 19:25:15(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

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
Offline Razonar  
#55 Posted : 01 December 2020 19:32:36(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: uni Go to Quoted Post
Originally Posted by: Razonar Go to Quoted Post
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 Go to Quoted Post

...

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:

Clipboard01.jpg

Originally Posted by: efus Go to Quoted Post
...
Capture.PNG

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

Offline Jean Giraud  
#56 Posted : 01 December 2020 20:05:26(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

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).
Offline efus  
#57 Posted : 01 December 2020 20:18:01(UTC)
efus


Rank: Advanced Member

Groups: Registered
Joined: 19/11/2020(UTC)
Posts: 34
Man
Italy
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).


Capture.PNG

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.


Biggrin 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
Offline Razonar  
#58 Posted : 01 December 2020 23:21:06(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi efus. Maybe you could be interested in the coolprop plugin.

Clipboard01.jpg

Help for humid air: http://www.coolprop.org/...properties/HumidAir.html
Collprop for SMath: https://en.smath.com/for...98_CoolProp-Wrapper.aspx

Also, I see your loda implementation, it's ok, and I don't know if the fact that you redefine the parameter "y" in the body of D() have any implication, but you must to know that in SMath if you pass parameters in that way "things happens":

Clipboard01.jpg

Best regards.
Alvaro.

Edited by user 01 December 2020 23:32:31(UTC)  | Reason: Not specified

Offline efus  
#59 Posted : 01 December 2020 23:50:32(UTC)
efus


Rank: Advanced Member

Groups: Registered
Joined: 19/11/2020(UTC)
Posts: 34
Man
Italy
Location: Ireland

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Razonar Go to Quoted Post
Hi efus. Maybe you could be interested in the coolprop plugin.

Help for humid air: http://www.coolprop.org/...properties/HumidAir.html
Collprop for SMath: https://en.smath.com/for...98_CoolProp-Wrapper.aspx

Also, I see your loda implementation, it's ok, and I don't know if the fact that you redefine the parameter "y" in the body of D() have any implication, but you must to know that in SMath if you pass parameters in that way "things happens":


Best regards.
Alvaro.


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" Laugh wild 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
Offline Jean Giraud  
#60 Posted : 02 December 2020 01:24:59(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

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.
Users browsing this topic
Guest
4 Pages<1234>
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.