Animation of heath evolution

29 views
Skip to first unread message

Jorge Devoto

unread,
Aug 10, 2018, 10:47:20 AM8/10/18
to diagrams-discuss
Hello

I am trying to make a simulation of the evolution of the heath
using diagrams with animations. I can not find any example.

Could anybody tell me where can I find examples?

Any help is welcomed.

Thanks in advanced.

Jorge

Brent Yorgey

unread,
Aug 10, 2018, 11:39:29 AM8/10/18
to Jorge Devoto, diagrams-discuss
Hi Jorge,

I am not sure I understand what you mean by "evolution of the heath". Can you elaborate, or give an example?

-Brent

--
You received this message because you are subscribed to the Google Groups "diagrams-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diagrams-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brent Yorgey

unread,
Aug 10, 2018, 4:43:52 PM8/10/18
to Jorge Devoto, diagrams-discuss
Hi Jorge,

(I have sent this to diagrams-discuss again, let's keep the discussion on the mailing list so that others can also chime in if they have anything to add, or learn from whatever is said.)

I am still not quite sure I am understanding what you want to do.  What kind of function is H?  I guess t is a real number?  What type is x?  And what type does H return?  Maybe sending the python program as an attachment would be helpful (please also send clear instructions on how to run it).

-Brent

On Fri, Aug 10, 2018 at 2:56 PM Jorge Devoto <jorge.a...@gmail.com> wrote:
I have a function H t x, The variable t is time and the variable x denotes ponts. I want to make 
an animation taking a series of times t_0 < t_1, < .... etc and plotting the sequence of functions
H t_k x as functions of x. I have a program in python to do this but I would like to learn how to do
it in Haskell. I can send you the python program if this helps-

Thanks for the answer

Best 
Jorge


Jorge Devoto

unread,
Aug 11, 2018, 10:46:05 AM8/11/18
to diagrams-discuss
Hi

The function H t x takes two real numbers and return a real number. The python program is attached. You can run it with "python heatsim.py"and it produces
a mp4 file called "im5.mp4"

Thanks for the help

Jorge
heatsim.py

Brent Yorgey

unread,
Aug 11, 2018, 11:35:52 PM8/11/18
to Jorge Devoto, diagrams-discuss
Sorry, I cannot run the program since my Linux distro (Ubuntu bionic) does not seem to have 'avconv'.  But in any case I think I now have a better idea what you are trying to do.  For making animations in this case I recommend the simplest approach, which is to use the 'animatedGif' function from diagrams-rasterific: http://hackage.haskell.org/package/diagrams-rasterific-1.4.1/docs/Diagrams-Backend-Rasterific.html#v:animatedGif For drawing function plots, you can simply use https://diagrams.github.io/haddock/diagrams-lib/Diagrams-CubicSpline.html#v:cubicSpline on a list of points sampled from the function.

-Brent

Jorge Devoto

unread,
Aug 14, 2018, 5:29:02 AM8/14/18
to diagrams-discuss
I am now in the right track. Thanks for the help. By the way you can change avconv by ffmpeg.

Best
Jorge
Reply all
Reply to author
Forward
0 new messages