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

Notification

Icon
Error

Login


6 Pages«<3456>
Options
Go to last post Go to first unread
Offline hanskl  
#81 Posted : 09 May 2018 17:59:42(UTC)
hanskl


Rank: Advanced Member

Groups: Registered
Joined: 25/10/2017(UTC)
Posts: 158
Norway

Was thanked: 7 time(s) in 5 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: hanskl Go to Quoted Post
But from the top of my head - the X-axis should represent time in minutes, not temperature.

Also, it took quite some time for the sheet to finish calculating.

Best regards,
Hans Kristian


1. You can leave it in native 't'
2. the default Integration accuracy is 100, set it 50
it will have no influence in this application but much faster.
1.7 min in my 1.66 GHz laptop runs 225 greedy maths.
3. Does your version bracket t:=[0,5..600] ?
rather than Smath 6179 t:=0,5..600

Temperaturforlop Compactum Copy.sm (54kb) downloaded 21 time(s).



For solution 1/part 1 of the DE the domain is from t=0 min to t=x min, and f(t=0)=20 degC to f(t=x)=600 degC

t=x such that f(x)=600 is the IC for solution 2/part 2. Similarly for solution 3 t=x such that f(x)=735 is the IC.

When I open your sheet t:= is in brackets, yes. Did I understand you correct?

Best regards,
Hans Kristian
Offline Jean Giraud  
#82 Posted : 10 May 2018 14:31:10(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: hanskl Go to Quoted Post
When I open your sheet t:= is in brackets, yes. Did I understand you correct ?

Thanks for confirming [ ... ] bracket conversion from 6179 => 6671.
Some external use were demonstrated for local use.
Within a "forLoop", can't see the use for ... crowds the code.
I asked for a demo that 6179 couldn't do ... still waiting !
=============================
Numerical maths work unitless on dummy scalar iterator.
You can post identify that the running Cartesian 'X' is '°C'
That's what I understand from your first comment.
============================
I visited several sources of that standard *.PDF
Zillions pages empty except for what is text.
Can't see the use of a web document all empty !
Maybe you can confirm the final graph solution.

Jean

Temperaturforlop Compactum Copy.sm (53kb) downloaded 30 time(s).

Offline hanskl  
#83 Posted : 30 October 2020 21:15:54(UTC)
hanskl


Rank: Advanced Member

Groups: Registered
Joined: 25/10/2017(UTC)
Posts: 158
Norway

Was thanked: 7 time(s) in 5 post(s)
After recently learing how to write for loops, this forgotten project popped back up in my mind again..

My newfound knowledge got me quite a bit further, to the point where i think this project is complete as well.

Just one question - is it possible to define a function quickswitchODEsolver(a,b,c,d,e)=ODEsolver(a,b,c,d,e) <-- This could be Rkadapt() for example, or maybe another solver.

Can the 8 different resolutions then be solved by quickswitchODEsolver()?

The goal is to have to change the solver function only one place rathere than 8, if I want to switch.

Cheers.

Temperaturforlop.sm (120kb) downloaded 17 time(s).
thanks 1 user thanked hanskl for this useful post.
on 31/10/2020(UTC)
Offline uni  
#84 Posted : 31 October 2020 03:37:36(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)
Russia ☭ forever
Viacheslav N. Mezentsev
Offline hanskl  
#85 Posted : 31 October 2020 18:05:03(UTC)
hanskl


Rank: Advanced Member

Groups: Registered
Joined: 25/10/2017(UTC)
Posts: 158
Norway

Was thanked: 7 time(s) in 5 post(s)
Originally Posted by: uni Go to Quoted Post


Thanks.

I have tried to apply that approach to selectiong solvers, but my results does not come out correct..

Also, I have tried manipulating ZedGraph setting with the setprop(), but I cant get it to work with existing plots.. only new plots.. any ideas?

Best regards,

Temperaturforlop_test.sm (191kb) downloaded 13 time(s).
Offline uni  
#86 Posted : 31 October 2020 19:16:19(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: hanskl Go to Quoted Post
Also, I have tried manipulating ZedGraph setting with the setprop(), but I cant get it to work with existing plots.. only new plots.. any ideas?

setprop() is experimental and I will add differ method to control region properties (using math variables as values for them). Yes, now it works only for new plots with 'zGraph' name. But you can't save this value with the document. This is because region has binary content in xml file and for now I can't change it by adding new properties.
I am not the author of the component, so it is difficult for me to modify it.

As for the solver I hope someone can suggest a solution.

Russia ☭ forever
Viacheslav N. Mezentsev
Offline hanskl  
#87 Posted : 31 October 2020 22:42:57(UTC)
hanskl


Rank: Advanced Member

Groups: Registered
Joined: 25/10/2017(UTC)
Posts: 158
Norway

Was thanked: 7 time(s) in 5 post(s)
Originally Posted by: uni Go to Quoted Post
Originally Posted by: hanskl Go to Quoted Post
Also, I have tried manipulating ZedGraph setting with the setprop(), but I cant get it to work with existing plots.. only new plots.. any ideas?

setprop() is experimental and I will add differ method to control region properties (using math variables as values for them). Yes, now it works only for new plots with 'zGraph' name. But you can't save this value with the document. This is because region has binary content in xml file and for now I can't change it by adding new properties.
I am not the author of the component, so it is difficult for me to modify it.

As for the solver I hope someone can suggest a solution.



Thanks for clarifying. Looking forward to this feature in the future.

Offline Jean Giraud  
#88 Posted : 01 November 2020 03:07:33(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Few comments:
1. As soon as you can plot something, plot ... this is a must.
2. RK solvers are known to over-shoot [Mathematica, Mathcad/Mathsoft ]
3. The Simpson "Premise" is all correct in there.
4. Use solve(,,,,) instead of your other junction.
5. Red top to bottom in SS 6179

Temperaturforlop_test [1].sm (35kb) downloaded 11 time(s).
Offline mkraska  
#89 Posted : 01 November 2020 03:38:52(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
Originally Posted by: hanskl Go to Quoted Post
After recently learing how to write for loops, this forgotten project popped back up in my mind again..

My newfound knowledge got me quite a bit further, to the point where i think this project is complete as well.

Just one question - is it possible to define a function quickswitchODEsolver(a,b,c,d,e)=ODEsolver(a,b,c,d,e) <-- This could be Rkadapt() for example, or maybe another solver.

Can the 8 different resolutions then be solved by quickswitchODEsolver()?

The goal is to have to change the solver function only one place rathere than 8, if I want to switch.

Cheers.

Temperaturforlop.sm (120kb) downloaded 17 time(s).


There might be smoother ways but this works. Note that I had to replace the sliders because the old regions don't seem to work any more with new SMath versions.

Section Math ODE precision.png
Section Math ODE precision.sm (24kb) downloaded 11 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline hanskl  
#90 Posted : 01 November 2020 11:44:28(UTC)
hanskl


Rank: Advanced Member

Groups: Registered
Joined: 25/10/2017(UTC)
Posts: 158
Norway

Was thanked: 7 time(s) in 5 post(s)
Originally Posted by: mkraska Go to Quoted Post
There might be smoother ways but this works. Note that I had to replace the sliders because the old regions don't seem to work any more with new SMath versions.


Thanks. I already had a go at this approach as uni directed me towards it.

It works fine when I apply it to ODE itself, but when I wrap the ODE into a for loop (a necessity to establish boundary conditions for the whole set of ODEs) something goes wrong..

Cheers
Offline hanskl  
#91 Posted : 01 November 2020 13:19:24(UTC)
hanskl


Rank: Advanced Member

Groups: Registered
Joined: 25/10/2017(UTC)
Posts: 158
Norway

Was thanked: 7 time(s) in 5 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Few comments:
1. As soon as you can plot something, plot ... this is a must.
2. RK solvers are known to over-shoot [Mathematica, Mathcad/Mathsoft ]
3. The Simpson "Premise" is all correct in there.
4. Use solve(,,,,) instead of your other junction.
5. Red top to bottom in SS 6179



Thanks for putting me on a different track.

Solve() also serves the purpose of finding the boundary conditions for DE2-4, although I guess the way I have set it up (might be other ways) does make the ODEs compute a lot of unecessary results (they all go all the way up to t.final, but they only have to go up to t.lim - hence the for loop).

This way the mkraska method of switching solvers work, and it is quite interessting to see the discrepancy in computational times. dn_AdamsMoulton takes way longer to compute, and actually runs into trouble when the tolerances are high..

Any ideas on a setup that stops the DE's when they reach t.lim rather than t.final while still being able to choose the solver?

Cheers.

Temperaturforlop_test_2.sm (93kb) downloaded 8 time(s).
Offline hanskl  
#92 Posted : 01 November 2020 13:47:01(UTC)
hanskl


Rank: Advanced Member

Groups: Registered
Joined: 25/10/2017(UTC)
Posts: 158
Norway

Was thanked: 7 time(s) in 5 post(s)
Another question regarding stiffness and solvers.

What does it say about the stiffness of a ODE if both a stiff solver and a nonstiff solver is able to solve?

And for this particular set of ODEs, I have seen several articles discussing how to solve using the MS ExCeL method using a set timestep of dt=5s. If that is a proven method to solve this problem, that would confirm the system is nonstiff, right?

Edited by user 01 November 2020 13:51:08(UTC)  | Reason: Not specified

Offline Jean Giraud  
#93 Posted : 01 November 2020 17:47:24(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: hanskl Go to Quoted Post
but when I wrap the ODE into a for loop (a necessity to establish boundary conditions for the whole set of ODEs) something goes wrong..

1. The for loop not needed
2. something goes wrong argument must be scalar
't' is not a free running scalar in your for loop.

TemperaturDoctored.PNG
Offline Jean Giraud  
#94 Posted : 01 November 2020 18:08:38(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: mkraska Go to Quoted Post
There might be smoother ways but this works. Note that I had to replace the sliders because the old regions don't seem to work any more with new SMath versions.

Thanks Martin for that superb ClassRoom demo ! Works well SS 6179.

Offline Jean Giraud  
#95 Posted : 01 November 2020 19:59:22(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: hanskl Go to Quoted Post
Another question regarding stiffness and solvers.

What does it say about the stiffness of a ODE if both a stiff solver and a nonstiff solver is able to solve?

And for this particular set of ODEs, I have seen several articles discussing how to solve using the MS ExCeL method using a set timestep of dt=5s. If that is a proven method to solve this problem, that would confirm the system is nonstiff, right?

You can exercise all 17 Smath native ODE solvers.
From the look, your first D1 is not stiff.
Assume the Premise Algo is some kind of yard stick, exercise the 17 ODE solvers.
After all, all those represent experimental data, not exact anyway.

Integrate ClassRoom Premise_Maple.sm (58kb) downloaded 9 time(s).

Offline Jean Giraud  
#96 Posted : 01 November 2020 20:40:14(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
... visit Fehlberg .
The code sources agree: Mathematica & Mathcad 11 Smath as well .

ODE Fehlberg Integrator-Interpolate.sm (78kb) downloaded 11 time(s).
Offline hanskl  
#97 Posted : 02 November 2020 00:40:03(UTC)
hanskl


Rank: Advanced Member

Groups: Registered
Joined: 25/10/2017(UTC)
Posts: 158
Norway

Was thanked: 7 time(s) in 5 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
You can exercise all 17 Smath native ODE solvers.
From the look, your first D1 is not stiff.
Assume the Premise Algo is some kind of yard stick, exercise the 17 ODE solvers.
After all, all those represent experimental data, not exact anyway.


Jean, I'm not sure I get your reference to the "Premise Algo"...
Offline Jean Giraud  
#98 Posted : 03 November 2020 19:16:17(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: hanskl Go to Quoted Post
Jean, I'm not sure I get your reference to the "Premise Algo"...

Ignore as it was given. I couldn't find the trick to scale appropriately.
Some interesting visit attached... Jean

ODE Valery Reaction.sm (19kb) downloaded 10 time(s).
Integrate ClassRoom Fehlberg.sm (53kb) downloaded 5 time(s).
ODE HIRES.sm (68kb) downloaded 6 time(s).
Offline Jean Giraud  
#99 Posted : 03 November 2020 19:22:33(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
... refused to upload this one

Integrate ClassRoom Premise Algo [kernel(f,a,b,n)].sm (46kb) downloaded 10 time(s).





Offline hanskl  
#100 Posted : 07 November 2020 20:01:53(UTC)
hanskl


Rank: Advanced Member

Groups: Registered
Joined: 25/10/2017(UTC)
Posts: 158
Norway

Was thanked: 7 time(s) in 5 post(s)
Turns out the ODE solvers cant handle if() in the D argument, which led me down the path of creating a system of ODEs.

I just found out the ODE solvers can deal with cases(), which means there is no reason to separate the ODEs in the first place.

No need for for loop or solve function to find where one ODE ends and another start anymore....
Users browsing this topic
6 Pages«<3456>
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.