Re: [Scilab-users] Corona modelling

2020-05-20 Thread Samuel Gougeon

Le 20/05/2020 à 17:40, Chin Luh Tan a écrit :
I can confirm this, this also happened in Scilab 6.1 Windows 10, 
however, it runs smooth in Scilab 6.0.2 same machine.


Thanks.
The issue is now reported here: 
http://bugzilla.scilab.org/show_bug.cgi?id=11852#c9


Samuel


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-05-20 Thread Chin Luh Tan
I can confirm this, this also happened in Scilab 6.1 Windows 10, however, it 
runs smooth in Scilab 6.0.2 same machine. 



rgds,
CL


 On Wed, 20 May 2020 21:50:04 +0800 Samuel Gougeon  wrote 



Hello,



Thank you Stéphane for this nice
  example of applied GUI.

The screenshot of the Xcos model from
  Hervé is also quite stimulating.



About the GUI run on Scilab 6.1.0, i
  have noticed that the Scilab filebrowser is blinking when using
  any of both sliders, as if it was updated/redisplayed for each
  slider step. It continues to blink for a while even after stopping
  using the control, likely until all queued steps are performed.
  This behavior can be seen when sliding with the mouse, as well as
  with arrows, but not with page_up and page_down keys. So,
  apparently only performing small steps triggers it.


Does anyone confirm this behavior, or is it only on my PC on
  Windows7 ?

Best regards
 Samuel



Le 30/03/2020 à 08:13, Stéphane
  Mottelet a écrit :

Hello Heinz,

Here is an interactive version (made for my children last
week...) :

// Confinement COVID-19 !
// Stephane MOTTELET, UTC
// Tue Mar 24 08:55:03 CET 2020
// 
function dydt=sir(t, y, bet, gam, N)
dydt=[-bet/N*y(1)*y(2)
   bet/N*y(1)*y(2)-gam*y(2)  
   gam*y(2)];
endfunction

function draw(bet, gam)
t=0:1:360;
N=6e7;
if exists("gcbo") && is_handle_valid(gcbo)
sb = gcbo;
if sb.tag=="beta"
bet=sb.value;
gam=findobj("gamma").value
else
gam=sb.value;
bet=findobj("beta").value
end
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
curves = findobj("curves");
curves.children(1).data(:,2)=y(3,:);
curves.children(2).data(:,2)=y(2,:);
curves.children(3).data(:,2)=y(1,:);
else
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
scf(0)
clf
plot(t,y)
gce().tag="curves";
gce().children.thickness=2;
legend("Susceptible","Infected","Recovered",-1)

sb1 = uicontrol("style","slider",...
"units","normalized",...
"Position", [0.85,0.2,0.05,0.48],...
"BackgroundColor", [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0.15,"max",0.3,"value",bet,...
"Callback","draw","tag","beta");

uicontrol("style","text",...
"string","$\beta$",...
"units","normalized",...
"Position", [0.85,0.125,0.05,0.08],...
"BackgroundColor", [1,1,1],...
"HorizontalAlignment","center");

sb1 = uicontrol("style","slider",...
"units","normalized",...
"Position", [0.90,0.2,0.05,0.48],...
"BackgroundColor", [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0,"max",1/15,"value",gam,...
"Callback","draw","tag","gamma");

uicontrol("style","text",...
"string","$\gamma$",...
"units","normalized",...
"Position", [0.9,0.125,0.05,0.08],...
"BackgroundColor", [1,1,1],...
"HorizontalAlignment","center");

end
end

clf

draw(0.3,1/15)






___
users mailing list 
users@lists.scilab.org 
http://lists.scilab.org/mailman/listinfo/users___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-05-20 Thread Perrichon
Dear,

I understand Samuel, but not sure that this kind of example on C-19 is the most 
representative of a GUI with Scilab.

Confusion is done on what is on the screen, and ridiculus analysis when experts 
are always studing in the whole word !

Where is the message : scilab solve C-19 ??? I dream.

So this is is a bad example.

 

 

De : users  De la part de Samuel Gougeon
Envoyé : mercredi 20 mai 2020 15:50
À : users@lists.scilab.org
Objet : Re: [Scilab-users] Corona modelling

 

Hello,

 

Thank you Stéphane for this nice example of applied GUI.

The screenshot of the Xcos model from Hervé is also quite stimulating.

 

About the GUI run on Scilab 6.1.0, i have noticed that the Scilab filebrowser 
is blinking when using any of both sliders, as if it was updated/redisplayed 
for each slider step. It continues to blink for a while even after stopping 
using the control, likely until all queued steps are performed. This behavior 
can be seen when sliding with the mouse, as well as with arrows, but not with 
page_up and page_down keys. So, apparently only performing small steps triggers 
it.


Does anyone confirm this behavior, or is it only on my PC on Windows7 ?


Best regards
Samuel

 

Le 30/03/2020 à 08:13, Stéphane Mottelet a écrit :

Hello Heinz,

Here is an interactive version (made for my children last week...) :

// Confinement COVID-19 !
// Stephane MOTTELET, UTC
// Tue Mar 24 08:55:03 CET 2020
// 
function dydt=sir(t, y, bet, gam, N)
dydt=[-bet/N*y(1)*y(2)
   bet/N*y(1)*y(2)-gam*y(2)  
   gam*y(2)];
endfunction
 
function draw(bet, gam)
t=0:1:360;
N=6e7;
if exists("gcbo") && is_handle_valid(gcbo)
sb = gcbo;
if sb.tag=="beta"
bet=sb.value;
gam=findobj("gamma").value
else
gam=sb.value;
bet=findobj("beta").value
end
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
curves = findobj("curves");
curves.children(1).data(:,2)=y(3,:);
curves.children(2).data(:,2)=y(2,:);
curves.children(3).data(:,2)=y(1,:);
else
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
scf(0)
clf
plot(t,y)
gce().tag="curves";
gce().children.thickness=2;
legend("Susceptible","Infected","Recovered",-1)

sb1 = uicontrol("style","slider",...
"units","normalized",...
"Position", [0.85,0.2,0.05,0.48],...
"BackgroundColor", [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0.15,"max",0.3,"value",bet,...
"Callback","draw","tag","beta");

uicontrol("style","text",...
"string","$\beta$",...
"units","normalized",...
"Position", [0.85,0.125,0.05,0.08],...
"BackgroundColor", [1,1,1],...
"HorizontalAlignment","center");

sb1 = uicontrol("style","slider",...
"units","normalized",...
"Position", [0.90,0.2,0.05,0.48],...
"BackgroundColor", [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0,"max",1/15,"value",gam,...
"Callback","draw","tag","gamma");
 
uicontrol("style","text",...
"string","$\gamma$",...
"units","normalized",...
"Position", [0.9,0.125,0.05,0.08],...
"BackgroundColor", [1,1,1],...
"HorizontalAlignment","center");
 
end
end
 
clf
 
draw(0.3,1/15)
 

 

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-05-20 Thread Samuel Gougeon

Hello,

Thank you Stéphane for this nice example of applied GUI.
The screenshot of the Xcos model from Hervé is also quite stimulating.

About the GUI run on Scilab 6.1.0, i have noticed that the Scilab 
filebrowser is blinking when using any of both sliders, as if it was 
updated/redisplayed for each slider step. It continues to blink for a 
while even after stopping using the control, likely until all queued 
steps are performed. This behavior can be seen when sliding with the 
mouse, as well as with arrows, but not with page_up and page_down keys. 
So, apparently only performing small steps triggers it.


Does anyone confirm this behavior, or is it only on my PC on Windows7 ?

Best regards
Samuel

Le 30/03/2020 à 08:13, Stéphane Mottelet a écrit :


Hello Heinz,

Here is an interactive version (made for my children last week...) :

// Confinement COVID-19 !
// Stephane MOTTELET, UTC
// Tue Mar 24 08:55:03 CET 2020
//
function  dydt=sir(t, y, bet, gam, N)
 dydt=[-bet/N*y(1)*y(2)
bet/N*y(1)*y(2)-gam*y(2)   
gam*y(2)];

endfunction

function  draw(bet, gam)
 t=0:1:360;
 N=6e7;
 if  exists("gcbo")  &&  is_handle_valid(gcbo)
 sb  =  gcbo;
 if  sb.tag=="beta"
 bet=sb.value;
 gam=findobj("gamma").value
 else
 gam=sb.value;
 bet=findobj("beta").value
 end
 y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
 curves  =  findobj("curves");
 curves.children(1).data(:,2)=y(3,:);
 curves.children(2).data(:,2)=y(2,:);
 curves.children(3).data(:,2)=y(1,:);
 else
 y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
 scf(0)
 clf
 plot(t,y)
 gce().tag="curves";
 gce().children.thickness=2;
 legend("Susceptible","Infected","Recovered",-1)
 
 sb1  =  uicontrol("style","slider",...

 "units","normalized",...
 "Position",  [0.85,0.2,0.05,0.48],...
 "BackgroundColor",  [1,1,1],...
 "Callback_Type",12,...
 "sliderstep",[1/1000,1/10],...
 "min",0.15,"max",0.3,"value",bet,...
 "Callback","draw","tag","beta");
 
 uicontrol("style","text",...

 "string","$\beta$",...
 "units","normalized",...
 "Position",  [0.85,0.125,0.05,0.08],...
 "BackgroundColor",  [1,1,1],...
 "HorizontalAlignment","center"); 
 
 sb1  =  uicontrol("style","slider",...

 "units","normalized",...
 "Position",  [0.90,0.2,0.05,0.48],...
 "BackgroundColor",  [1,1,1],...
 "Callback_Type",12,...
 "sliderstep",[1/1000,1/10],...
 "min",0,"max",1/15,"value",gam,...
 "Callback","draw","tag","gamma");

 uicontrol("style","text",...
 "string","$\gamma$",...
 "units","normalized",...
 "Position",  [0.9,0.125,0.05,0.08],...
 "BackgroundColor",  [1,1,1],...
 "HorizontalAlignment","center"); 


 end
end

clf

draw(0.3,1/15)


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-05-07 Thread Heinz Nabielek
And how does it compare with Johns Hopkins?
Heinz



> On 07.05.2020, at 13:49, hdf  wrote:
> 
> and here are the results, with parameters given:  
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
> Nabble.com.
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-05-07 Thread hdf
Hello Heinz,
Before comparing with John Hopkins' data and try to identify the different
parameters I wanted to 'improve' the model. I have read several interesting
articles on the web.  One of them
 
, written by David Madore, explains (in french) that the recovery model
would be better at a "constant recovery time" instead of using an
"exponential distribution of probability whose expected value is 1/γ" like
in the traditional SIR model. 
I agree with him because I could recognized a "simple time delay" in his
explanations 
So in the below diagram I replaced the gamma (γ) feedback on the infected
integrator by a variable delay and add a super function diagram  to model
the healthcare system with:
 - One input: infected people per day.
 - Two outputs: Recovered and unfortunately dead people per day.
The other parameters are percentages of 'symtomatic', 'hospitabized',
'Reanimated' and 'dead' people on one hand and delays before being 'healed',
'hopitalized' and 'reanimated', but also 'incubation' time on the other
hand.
 
Here are some of my results:

 
Funny 'infected' curve and its derive right ?
I am thinking of studying the FFT of the real John Hopkings' curves to
identify the delays to put inside my healthcare system model.
But I'm running out of time before I have to work back next monday.
Hervé de Foucault




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-05-07 Thread hdf
and here are the results, with parameters given:

 



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-05-07 Thread hdf
Hello,My contribution, I've done it with Xcos:

where you can play with other parameters like a limited immunization
(delta), deaths (Mu) etc ...I'm thinking to modelize the healthcare system
showing the number of beds saturation effect. But time is missing ...



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread RolandB
As there have already been some cases where persons have been infected twice,
you would have to take into account that only a finite percentage of
infected people become immune and that this immunity might also only last
some finite time.

Another thought experiment would be to randomly test some percentage of
people every some days and remove them by isolation in case they are
infected.

Further, after someone becomes ill or is tested positive, you could
determine the people he was in contact with (to a certain percentage,
because they would not remember everyone they had been in contact with) and
have them tested too. 

Aside from the mathematical problem, I think in order to be able to return
to a somewhat normal life without a high risk of provoking another wave
(maybe several of them), we need tests that detect the virus directly
(antigen or DNA tests, as antibodies take too long to rise) and we need them
ridiculously cheap. We need to be able to test everyone at least twice a
week, preferably every other day or even every day.
I think I have seen Influenza rapid antigen tests for about 3,5 Euro in some
tens quantities. If one were to produce them in hundreds of millions per day
(you know how fast the Chinese can ramp up factories if there is a demand),
such a test should be able to be produced for less than an Euro.
Combined with an app that tracks everyone's path (I know, protection of
privacy is important, but there should be a way to ensure privacy while
allowing to be able to detect if one has been in close vicinity of an
infected person), that should allow us to avoid an oscillating cycle of
reinfection waves.



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread Heinz Nabielek
> On 30.03.2020, at 20:37, Tim Wescott  wrote:
> 
> Someone was tagging "R" as "removed", which works if it's the aggregate
> of "live and no longer contagious" and "dead".
> 
> Actually assessing the proportion of R depends on the local health
> system, and, to some extent, the size of the peak -- the main reason
> we're quarantining is to bring the peak down by broadening it.


The usual display of the INFECTED population as a series of normal 
distributions is not quite right, but a good enough approximation.

It is correct, that the reduction of the transmission coefficient delays the 
peak and makes it smaller..
Heinz
















>  The
> percentage of 'R' that's dead people is going to depend on how burdened
> the health care system is in any locality.
> 
> In cold-blooded mathematical terms it's just another dimension to the
> modeling, but it's on the output side of the differential equation; it
> doesn't have a great impact (as modeled) on the actual dynamics of
> those three variables.
> 
> On Mon, 2020-03-30 at 17:12 +0300, Vesela Pasheva wrote:
>> Hello colleagues,
>> 
>> I would like to know whether the variable D of dead persons could be 
>> included in the model considered. Up till now the model considers
>> the 
>> variables S - susceptible, I - infected and R - recovered. Where do
>> the 
>> Dead persons D go.
>> Of course i such case the system will be of four differential
>> equations.
>> 
>> Best regards
>> 
>> Vesela
>> 
>> На 30-03-2020 15:38, Heinz Nabielek написа:
 On 30.03.2020, at 08:13, Stéphane Mottelet
  wrote:
 Hello Heinz,
 
 Here is an interactive version (made for my children last
 week...) :
 
 // Confinement COVID-19 !
 // Stephane MOTTELET, UTC
 // Tue Mar 24 08:55:03 CET 2020
>>> 
>>> Great many thanks:
>>> 
>>> o The SIR model is great and can be readily understood.
>>> 
>>> o Scilab is great: one line of code where big EXCEL sheet produced
>>> a
>>> mess.
>>> 
>>> o Scilab friends and colleagues are great: instantaneous and real
>>> help.
>>> 
>>> If the modelling is anywhere near to right, it will soon be over in
>>> Austria (cyan circles are recorded infections). But this is likely
>>> over-optimistic.
>>> Heinz
>>> 

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread Tim Wescott
Someone was tagging "R" as "removed", which works if it's the aggregate
of "live and no longer contagious" and "dead".

Actually assessing the proportion of R depends on the local health
system, and, to some extent, the size of the peak -- the main reason
we're quarantining is to bring the peak down by broadening it.  The
percentage of 'R' that's dead people is going to depend on how burdened
the health care system is in any locality.

In cold-blooded mathematical terms it's just another dimension to the
modeling, but it's on the output side of the differential equation; it
doesn't have a great impact (as modeled) on the actual dynamics of
those three variables.

On Mon, 2020-03-30 at 17:12 +0300, Vesela Pasheva wrote:
> Hello colleagues,
> 
> I would like to know whether the variable D of dead persons could be 
> included in the model considered. Up till now the model considers
> the 
> variables S - susceptible, I - infected and R - recovered. Where do
> the 
> Dead persons D go.
> Of course i such case the system will be of four differential
> equations.
> 
> Best regards
> 
> Vesela
> 
> На 30-03-2020 15:38, Heinz Nabielek написа:
> > > On 30.03.2020, at 08:13, Stéphane Mottelet
> > >  wrote:
> > > Hello Heinz,
> > > 
> > > Here is an interactive version (made for my children last
> > > week...) :
> > > 
> > > // Confinement COVID-19 !
> > > // Stephane MOTTELET, UTC
> > > // Tue Mar 24 08:55:03 CET 2020
> > 
> > Great many thanks:
> > 
> > o The SIR model is great and can be readily understood.
> > 
> > o Scilab is great: one line of code where big EXCEL sheet produced
> > a
> > mess.
> > 
> > o Scilab friends and colleagues are great: instantaneous and real
> > help.
> > 
> > If the modelling is anywhere near to right, it will soon be over in
> > Austria (cyan circles are recorded infections). But this is likely
> > over-optimistic.
> > Heinz
> > 
> > __
> > Dr Heinz Nabielek
> > Schüttelstrasse 77A/11
> > A-1020 Wien, Österreich
> > Tel +43 1 276 56 13
> > cell +43 677 616 349 22
> > heinznabie...@me.com
> > ___
> > users mailing list
> > users@lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
-- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread P M
R = recovered = people who can not infect others anymore...this includes
the dead people...  (or not?)

there are some nice introducton videos at YouTube about thiseven
showing the mentioned model...

numberphile:  https://www.youtube.com/watch?v=k6nLfCbAzgo
3brown1blue:  https://www.youtube.com/watch?v=gxAaO2rsdIs

Best regards,
Philipp


Am Mo., 30. März 2020 um 18:57 Uhr schrieb Heinz Nabielek <
heinznabie...@me.com>:

> It is generally assumed that 1% of the infected will die. But that would
> not be part of the modelling, depends mainly on local health services.
>
> Heinz
>
> > On 30.03.2020, at 16:12, Vesela Pasheva  wrote:
> >
> > Hello colleagues,
> >
> > I would like to know whether the variable D of dead persons could be
> included in the model considered. Up till now the model considers the
> variables S - susceptible, I - infected and R - recovered. Where do the
> Dead persons D go.
> > Of course i such case the system will be of four differential equations.
> >
> > Best regards
> >
> > Vesela
> >
> > На 30-03-2020 15:38, Heinz Nabielek написа:
> >>> On 30.03.2020, at 08:13, Stéphane Mottelet
> >>>  wrote:
> >>> Hello Heinz,
> >>> Here is an interactive version (made for my children last week...) :
> >>> // Confinement COVID-19 !
> >>> // Stephane MOTTELET, UTC
> >>> // Tue Mar 24 08:55:03 CET 2020
> >> Great many thanks:
> >> o The SIR model is great and can be readily understood.
> >> o Scilab is great: one line of code where big EXCEL sheet produced a
> >> mess.
> >> o Scilab friends and colleagues are great: instantaneous and real
> >> help.
> >> If the modelling is anywhere near to right, it will soon be over in
> >> Austria (cyan circles are recorded infections). But this is likely
> >> over-optimistic.
> >> Heinz
> >> __
> >> Dr Heinz Nabielek
> >> Schüttelstrasse 77A/11
> >> A-1020 Wien, Österreich
> >> Tel +43 1 276 56 13
> >> cell +43 677 616 349 22
> >> heinznabie...@me.com
> >> ___
> >> users mailing list
> >> users@lists.scilab.org
> >> http://lists.scilab.org/mailman/listinfo/users
> > ___
> > users mailing list
> > users@lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
>
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread Heinz Nabielek
It is generally assumed that 1% of the infected will die. But that would not be 
part of the modelling, depends mainly on local health services.

Heinz

> On 30.03.2020, at 16:12, Vesela Pasheva  wrote:
> 
> Hello colleagues,
> 
> I would like to know whether the variable D of dead persons could be included 
> in the model considered. Up till now the model considers the variables S - 
> susceptible, I - infected and R - recovered. Where do the Dead persons D go.
> Of course i such case the system will be of four differential equations.
> 
> Best regards
> 
> Vesela
> 
> На 30-03-2020 15:38, Heinz Nabielek написа:
>>> On 30.03.2020, at 08:13, Stéphane Mottelet
>>>  wrote:
>>> Hello Heinz,
>>> Here is an interactive version (made for my children last week...) :
>>> // Confinement COVID-19 !
>>> // Stephane MOTTELET, UTC
>>> // Tue Mar 24 08:55:03 CET 2020
>> Great many thanks:
>> o The SIR model is great and can be readily understood.
>> o Scilab is great: one line of code where big EXCEL sheet produced a
>> mess.
>> o Scilab friends and colleagues are great: instantaneous and real
>> help.
>> If the modelling is anywhere near to right, it will soon be over in
>> Austria (cyan circles are recorded infections). But this is likely
>> over-optimistic.
>> Heinz
>> __
>> Dr Heinz Nabielek
>> Schüttelstrasse 77A/11
>> A-1020 Wien, Österreich
>> Tel +43 1 276 56 13
>> cell +43 677 616 349 22
>> heinznabie...@me.com
>> ___
>> users mailing list
>> users@lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread Rafael Guerra
Hi,

In Wikipedia article " Mathematical modelling of infectious disease " it says 
that people counted in R have been infected and removed from the disease due to 
immunization or death. 

I am not an expert but the fatality ratio could be defined as a percentage of 
the people infected 'I'.

Regards,
Rafael

-Original Message-
From: users  On Behalf Of Vesela Pasheva
Sent: Monday, March 30, 2020 5:13 PM
To: Users mailing list for Scilab 
Subject: Re: [Scilab-users] Corona modelling

Hello colleagues,

I would like to know whether the variable D of dead persons could be 
included in the model considered. Up till now the model considers the 
variables S - susceptible, I - infected and R - recovered. Where do the 
Dead persons D go.
Of course i such case the system will be of four differential equations.

Best regards

Vesela

На 30-03-2020 15:38, Heinz Nabielek написа:
>> On 30.03.2020, at 08:13, Stéphane Mottelet
>>  wrote:
> 
>> Hello Heinz,
>> 
>> Here is an interactive version (made for my children last week...) :
>> 
>> // Confinement COVID-19 !
>> // Stephane MOTTELET, UTC
>> // Tue Mar 24 08:55:03 CET 2020
> 
> Great many thanks:
> 
> o The SIR model is great and can be readily understood.
> 
> o Scilab is great: one line of code where big EXCEL sheet produced a
> mess.
> 
> o Scilab friends and colleagues are great: instantaneous and real
> help.
> 
> If the modelling is anywhere near to right, it will soon be over in
> Austria (cyan circles are recorded infections). But this is likely
> over-optimistic.
> Heinz
> 
> __
> Dr Heinz Nabielek
> Schüttelstrasse 77A/11
> A-1020 Wien, Österreich
> Tel +43 1 276 56 13
> cell +43 677 616 349 22
> heinznabie...@me.com
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread Vesela Pasheva

Hello colleagues,

I would like to know whether the variable D of dead persons could be 
included in the model considered. Up till now the model considers the 
variables S - susceptible, I - infected and R - recovered. Where do the 
Dead persons D go.

Of course i such case the system will be of four differential equations.

Best regards

Vesela

На 30-03-2020 15:38, Heinz Nabielek написа:

On 30.03.2020, at 08:13, Stéphane Mottelet
 wrote:



Hello Heinz,

Here is an interactive version (made for my children last week...) :

// Confinement COVID-19 !
// Stephane MOTTELET, UTC
// Tue Mar 24 08:55:03 CET 2020


Great many thanks:

o The SIR model is great and can be readily understood.

o Scilab is great: one line of code where big EXCEL sheet produced a
mess.

o Scilab friends and colleagues are great: instantaneous and real
help.

If the modelling is anywhere near to right, it will soon be over in
Austria (cyan circles are recorded infections). But this is likely
over-optimistic.
Heinz

__
Dr Heinz Nabielek
Schüttelstrasse 77A/11
A-1020 Wien, Österreich
Tel +43 1 276 56 13
cell +43 677 616 349 22
heinznabie...@me.com
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread Heinz Nabielek
> On 30.03.2020, at 08:13, Stéphane Mottelet  wrote:
> 
> Hello Heinz,
> 
> Here is an interactive version (made for my children last week...) :
> 
> // Confinement COVID-19 !
> // Stephane MOTTELET, UTC
> // Tue Mar 24 08:55:03 CET 2020


Great many thanks:

o   The SIR model is great and can be readily understood.

o   Scilab is great: one line of code where big EXCEL sheet produced a mess.

o   Scilab friends and colleagues are great: instantaneous and real help.

If the modelling is anywhere near to right, it will soon be over in Austria 
(cyan circles are recorded infections). But this is likely over-optimistic.
Heinz



__
Dr Heinz Nabielek
Schüttelstrasse 77A/11
A-1020 Wien, Österreich
Tel +43 1 276 56 13
cell +43 677 616 349 22
heinznabie...@me.com___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread Rafael Guerra
Merci Stéphane, for the very interesting code and Heinz for the reference to 
the math behind the epidemy “curve”, or one of its models.



From: users  On Behalf Of Stéphane Mottelet
Sent: Monday, March 30, 2020 9:14 AM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] Corona modelling


Hello Heinz,

Here is an interactive version (made for my children last week...) :



// Confinement COVID-19 !

// Stephane MOTTELET, UTC

// Tue Mar 24 08:55:03 CET 2020

//

function dydt=sir(t, y, bet, gam, N)

dydt=[-bet/N*y(1)*y(2)

   bet/N*y(1)*y(2)-gam*y(2)

   gam*y(2)];

endfunction



function draw(bet, gam)

t=0:1:360;

N=6e7;

if exists("gcbo") && is_handle_valid(gcbo)

sb = gcbo;

if sb.tag=="beta"

bet=sb.value;

gam=findobj("gamma").value

else

gam=sb.value;

bet=findobj("beta").value

end

y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));

curves = findobj("curves");

curves.children(1).data(:,2)=y(3,:);

curves.children(2).data(:,2)=y(2,:);

curves.children(3).data(:,2)=y(1,:);

else

y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));

scf(0)

clf

plot(t,y)

gce().tag="curves";

gce().children.thickness=2;

legend("Susceptible","Infected","Recovered",-1)



sb1 = uicontrol("style","slider",...

"units","normalized",...

"Position", [0.85,0.2,0.05,0.48],...

"BackgroundColor", [1,1,1],...

"Callback_Type",12,...

"sliderstep",[1/1000,1/10],...

"min",0.15,"max",0.3,"value",bet,...

"Callback","draw","tag","beta");



uicontrol("style","text",...

"string","$\beta$",...

"units","normalized",...

"Position", [0.85,0.125,0.05,0.08],...

"BackgroundColor", [1,1,1],...

"HorizontalAlignment","center");



sb1 = uicontrol("style","slider",...

"units","normalized",...

"Position", [0.90,0.2,0.05,0.48],...

"BackgroundColor", [1,1,1],...

"Callback_Type",12,...

"sliderstep",[1/1000,1/10],...

"min",0,"max",1/15,"value",gam,...

"Callback","draw","tag","gamma");



uicontrol("style","text",...

"string","$\gamma$",...

"units","normalized",...

"Position", [0.9,0.125,0.05,0.08],...

"BackgroundColor", [1,1,1],...

"HorizontalAlignment","center");



end

end



clf



draw(0.3,1/15)


Le 30/03/2020 à 02:14, Heinz Nabielek a écrit :

Colleagues:



is there an straightforward Scilab approach for solving the three coupled 
nonlinear differential equations of first order given by the Standard Model of 
Epidemics?





S= number Susceptible:  S'=-aSI

I=  number Infected:I'=aSI - bI

R= number Recovered:R'=bI

whereby 'a' is the transmission coefficient, 'b' the recovery factor (after 
Reed-Frost 1928).

Initial values for S, I, R are available.



Thank you

Heinz

___

users mailing list

users@lists.scilab.org<mailto:users@lists.scilab.org>

https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users

--

Stéphane Mottelet

Ingénieur de recherche

EA 4297 Transformations Intégrées de la Matière Renouvelable

Département Génie des Procédés Industriels

Sorbonne Universités - Université de Technologie de Compiègne

CS 60319, 60203 Compiègne cedex

Tel : +33(0)344234688

http://www.utc.fr/~mottelet
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-30 Thread Stéphane Mottelet

Hello Heinz,

Here is an interactive version (made for my children last week...) :

// Confinement COVID-19 !
// Stephane MOTTELET, UTC
// Tue Mar 24 08:55:03 CET 2020
//
function  dydt=sir(t, y, bet, gam, N)
dydt=[-bet/N*y(1)*y(2)
   bet/N*y(1)*y(2)-gam*y(2)   
   gam*y(2)];

endfunction

function  draw(bet, gam)
t=0:1:360;
N=6e7;
if  exists("gcbo")  &&  is_handle_valid(gcbo)
sb  =  gcbo;
if  sb.tag=="beta"
bet=sb.value;
gam=findobj("gamma").value
else
gam=sb.value;
bet=findobj("beta").value
end
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
curves  =  findobj("curves");
curves.children(1).data(:,2)=y(3,:);
curves.children(2).data(:,2)=y(2,:);
curves.children(3).data(:,2)=y(1,:);
else
y=ode('stiff',[N-1;1;0],0,t,list(sir,bet,gam,N));
scf(0)
clf
plot(t,y)
gce().tag="curves";
gce().children.thickness=2;
legend("Susceptible","Infected","Recovered",-1)

sb1  =  uicontrol("style","slider",...

"units","normalized",...
"Position",  [0.85,0.2,0.05,0.48],...
"BackgroundColor",  [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0.15,"max",0.3,"value",bet,...
"Callback","draw","tag","beta");

uicontrol("style","text",...

"string","$\beta$",...
"units","normalized",...
"Position",  [0.85,0.125,0.05,0.08],...
"BackgroundColor",  [1,1,1],...
"HorizontalAlignment","center"); 

sb1  =  uicontrol("style","slider",...

"units","normalized",...
"Position",  [0.90,0.2,0.05,0.48],...
"BackgroundColor",  [1,1,1],...
"Callback_Type",12,...
"sliderstep",[1/1000,1/10],...
"min",0,"max",1/15,"value",gam,...
"Callback","draw","tag","gamma");

uicontrol("style","text",...
"string","$\gamma$",...
"units","normalized",...
"Position",  [0.9,0.125,0.05,0.08],...
"BackgroundColor",  [1,1,1],...
"HorizontalAlignment","center"); 


end
end

clf

draw(0.3,1/15)

Le 30/03/2020 à 02:14, Heinz Nabielek a écrit :

Colleagues:

is there an straightforward Scilab approach for solving the three coupled 
nonlinear differential equations of first order given by the Standard Model of 
Epidemics?


S= number Susceptible:  S'=-aSI
I=  number Infected:I'=aSI - bI
R= number Recovered:R'=bI
whereby 'a' is the transmission coefficient, 'b' the recovery factor (after 
Reed-Frost 1928).
Initial values for S, I, R are available.

Thank you
Heinz
___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Corona modelling

2020-03-29 Thread Tim Wescott
This will be a straightforward application of the ODE solver.

Type "help ode" for more detail.

You'll make a function that takes the vector x = [S; I; R] as an
argument and returns [S'; I'; R'].  Then you'll call that function with
some starting x and let it play out.

You can speed up computation if you provide the Jacobian of f as a
function -- if you don't, the solver will calculate it at each time
step.

On Mon, 2020-03-30 at 02:14 +0200, Heinz Nabielek wrote:
> Colleagues:
> 
> is there an straightforward Scilab approach for solving the three
> coupled nonlinear differential equations of first order given by the
> Standard Model of Epidemics?
> 
> 
> S= number Susceptible:S'=-aSI
> I=  number Infected:  I'=aSI - bI
> R= number Recovered:  R'=bI
> whereby 'a' is the transmission coefficient, 'b' the recovery factor
> (after Reed-Frost 1928).
> Initial values for S, I, R are available.
> 
> Thank you
> Heinz
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
> 
> 
-- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users