Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/gifs #93

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d2da41d
added base for gif generation
elswit May 30, 2023
149a514
added gui boxes for movie generation
elswit Jun 2, 2023
bcf85cb
removed junk files
elswit Jun 2, 2023
97d87a3
fixed movie size bug
elswit Jun 2, 2023
bf1e840
fine tunning the script
elswit Jun 4, 2023
9abff9b
up animations script, adding a test webm
elswit Jun 26, 2023
50227b3
testing webm embedding
elswit Jun 26, 2023
50dd4e0
testin animation embeddings
elswit Jun 26, 2023
bc32cb5
testing gif embeddings
elswit Jun 26, 2023
05e1aca
testing animations
elswit Jun 26, 2023
f1702c6
added nbody animation
elswit Jun 26, 2023
aaa84f1
added nbody animation
elswit Jun 26, 2023
86eec50
added more animations
elswit Jun 26, 2023
65f4059
added more animations
elswit Jun 26, 2023
910fe86
Update README.md
elswit Jun 26, 2023
6a43fdb
rebased gifs branch from master
elswit Jun 26, 2023
ea0b2b0
Update README.md
elswit Jun 26, 2023
06467c3
Update README.md
elswit Jun 26, 2023
362de7e
Update README.md
elswit Jun 27, 2023
3c5ec81
added loop to all gifs
elswit Jun 27, 2023
545eb45
up script
elswit Jun 27, 2023
b1e4754
Update README.md
elswit Jun 28, 2023
fd10495
Update README.md
elswit Jun 28, 2023
a4a02ab
added QG gif
elswit Jun 29, 2023
6723354
Merge branch 'feature/gifs' of https://github.com/ComputationalScienc…
elswit Jun 29, 2023
f06b3db
removed large gif
elswit Jun 29, 2023
336dae9
Update README.md
elswit Jul 7, 2023
fc46d7f
Update README.md
elswit Jul 7, 2023
23365e1
Update README.md
elswit Jul 7, 2023
c52ce9d
Merge branch 'feature/gifs' of https://github.com/ComputationalScienc…
elswit Jul 8, 2023
a09c087
moved animations to sub dir in images
elswit Jul 8, 2023
9b20b25
moved animations to sub dir in images
elswit Jul 8, 2023
956e640
Update README.md
elswit Jul 12, 2023
737cfee
up movie script
elswit Oct 25, 2023
9135d66
added webm files
elswit Oct 25, 2023
8e68ff5
Update README.md
elswit Oct 25, 2023
d84aba7
Merge branch 'master' into feature/gifs
elswit Sep 23, 2024
e2d1c5f
Update README.md
elswit Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
# ODE Test Problems


<img src="images/logo.png" width="200" alt='ODE Test problems Logo' /> <img src="images/animations/nbody-OuterSolarSystem.gif" width="200" alt='KPR problem' loop=infinite /> <img src="images/animations/lorenz63-Canonical.gif" width="200" alt='Pendulum problem' loop=infinite />

<img src="images/animations/bouncingball-RandomTerrain.gif" width="200" alt='Bouncing ball problem' loop=infinite /> <img src="images/animations/pendulum-Canonical.gif" width="200" alt='Lorenz63 problem' loop=infinite /> <img src="images/animations/kpr-Canonical.gif" width="200" alt='Lorenz63 problem' loop=infinite />



ODE Test Problems (<code>OTP</code>) is an object-oriented Matlab/Octave package offering a broad range of initial value problems in the form of ordinary and differential-algebraic equations that can be used to test numerical methods such as time integration or data assimilation. It includes problems that are linear and nonlinear, homogeneous and nonhomogeneous, autonomous and nonautonomous, scalar and high-dimensional, stiff and nonstiff, and chaotic and nonchaotic. Many are real-world problems in fields such as chemistry, astrophysics, meteorology, and electrical engineering. <code>OTP</code> also supports partitioned ODEs for testing split, multirate, and other multimethods. Functions for plotting solutions and creating movies are available for all problems, and exact solutions are included when available. <code>OTP</code> is designed for ease of use &#8212;meaning that working with and modifying problems is simple and intuitive. <code>OTP</code> is actively under development. We are currently writing full documentation in order to release version <code>1.0.0</code>. </p>

<table border="0";>
<tbody>
<tr>
<td> <img src="images/logo.png" width="5000" alt='ODE Test problems Logo' /></td>
<td>
<p> ODE Test Problems (<code>OTP</code>) is an object-oriented Matlab/Octave package offering a broad range of initial value problems in the form of ordinary and differential-algebraic equations that can be used to test numerical methods such as time integration or data assimilation. It includes problems that are linear and nonlinear, homogeneous and nonhomogeneous, autonomous and nonautonomous, scalar and high-dimensional, stiff and nonstiff, and chaotic and nonchaotic. Many are real-world problems in fields such as chemistry, astrophysics, meteorology, and electrical engineering. <code>OTP</code> also supports partitioned ODEs for testing split, multirate, and other multimethods. Functions for plotting solutions and creating movies are available for all problems, and exact solutions are included when available. <code>OTP</code> is designed for ease of use &#8212;meaning that working with and modifying problems is simple and intuitive.
<code>OTP</code> is actively under development. We
are currently writing full documentation in order to release version <code>1.0.0</code>. </p>
</td>
</tr>
</tbody>
</table>

![Version](https://img.shields.io/github/v/release/ComputationalScienceLaboratory/ODE-Test-Problems?label=Version)
![GitHub](https://img.shields.io/github/license/ComputationalScienceLaboratory/ODE-Test-Problems)
Expand Down Expand Up @@ -66,7 +61,7 @@ New feature requests, and bug reports can be made through
We also accept pull requests that adhere to our
[contributing guide](docs/contrib.rst).


An interactive tutorial on the main features of `OTP` is available in a Jupyter notebook [in the repository](/notebooks)

Further discussion of the main contributions of this open-source package can be found in our [paper](/paper/paper.md).

Binary file added images/animations/bouncingball-RandomTerrain.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/animations/kpr-Canonical.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/animations/lorenz63-Canonical.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/animations/nbody-OuterSolarSystem.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/animations/pendulum-Canonical.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions images/makeMovie.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
close all

problemName = 'kpr';
presetName = 'Canonical';
outputFormat = 'gif';
targetTime = 10;
size = [400,400];


set(0,'DefaultAxesXMinorTick','on','DefaultAxesYMinorTick','on')
set(0,'DefaultAxesLineWidth', 2,'DefaultAxesFontName','Times',...
'DefaultAxesFontSize',20,'DefaultAxesBox','on')

ffmpegPath = {'/opt/homebrew/bin/ffmpeg'};


mkdir('animations')
filename = strcat('animations/', problemName,'-', presetName);


string = strcat(['otp.', problemName,'.presets.', presetName] );
problem = eval(string);
problem.TimeSpan = [0,30];

%

sol = problem.solve('RelTol', 1e-8);
mov = problem.movie(sol, 'Save', filename, ...
'TargetDuration',targetTime, ...
'Size', size, ...
'FrameRate', 15, ...
'view', [0,90]);


% convert vido format if neccessary
switch outputFormat
case 'avi'

case 'gif'

args = strcat(['-i ' ...
filename,'.avi ' ...
' -vf "fps=10,scale=400:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0' ...
' '...
filename,'.gif']);


case 'webm'

args = strcat(['-i ' ...
filename,'.avi ' ...
'-c:v libvpx -crf 10 -b:v 1M -c:a libvorbis '...
filename,'.webm']);

end

command = strjoin(strcat([ffmpegPath,' ' , args]));
system(command);










2 changes: 1 addition & 1 deletion toolbox/+otp/+utils/+movie/Movie.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function record(obj, t, y)

fig = figure;
if ~isempty(obj.Config.Size)
fig.Position = [0; 0: obj.Config.Size(:)];
fig.Position = [0; 0; obj.Config.Size(:)];
end

obj.init(fig, state);
Expand Down