Mercurial > repos > public > sbplib
annotate +anim/setup_time_quantity_plot.m @ 774:66eb4a2bbb72 feature/grids
Remove default scaling of the system.
The scaling doens't seem to help actual solutions. One example that fails in the flexural code.
With large timesteps the solutions seems to blow up. One particular example is profilePresentation
on the tdb_presentation_figures branch with k = 0.0005
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 18 Jul 2018 15:42:52 -0700 |
parents | 2ffa82fb5172 |
children |
rev | line source |
---|---|
0 | 1 function [update_data, plot_handles] = setup_time_quantity_plot(yfun) |
2 default_arg('yfun',@(y)y); | |
3 | |
69
f87003695677
Moved drawno out of plot update functions for huge performance boost.
Jonatan Werpers <jonatan@werpers.com>
parents:
0
diff
changeset
|
4 if isa(yfun,'function_handle') |
f87003695677
Moved drawno out of plot update functions for huge performance boost.
Jonatan Werpers <jonatan@werpers.com>
parents:
0
diff
changeset
|
5 yfun = {yfun}; |
f87003695677
Moved drawno out of plot update functions for huge performance boost.
Jonatan Werpers <jonatan@werpers.com>
parents:
0
diff
changeset
|
6 end |
f87003695677
Moved drawno out of plot update functions for huge performance boost.
Jonatan Werpers <jonatan@werpers.com>
parents:
0
diff
changeset
|
7 |
0 | 8 t = []; |
9 for i = 1:length(yfun) | |
72
942cb3c53a47
Simplified implementation of time quantity plot.
Jonatan Werpers <jonatan@werpers.com>
parents:
70
diff
changeset
|
10 plot_handles(i) = animatedline(); |
0 | 11 end |
12 | |
13 axis_handle = gca; | |
14 | |
15 function update(t_now,varargin) | |
16 if ishandle(axis_handle) | |
72
942cb3c53a47
Simplified implementation of time quantity plot.
Jonatan Werpers <jonatan@werpers.com>
parents:
70
diff
changeset
|
17 % t = [t t_now]; |
0 | 18 for j = 1:length(yfun) |
771
2ffa82fb5172
Make setup_time_quantity_plot() accept sparse vectors
Jonatan Werpers <jonatan@werpers.com>
parents:
94
diff
changeset
|
19 addpoints(plot_handles(j),t_now,full(yfun{j}(varargin{:}))); |
0 | 20 end |
70
243c558dc3ae
Made end of animated quantity plot nicer.
Jonatan Werpers <jonatan@werpers.com>
parents:
69
diff
changeset
|
21 |
72
942cb3c53a47
Simplified implementation of time quantity plot.
Jonatan Werpers <jonatan@werpers.com>
parents:
70
diff
changeset
|
22 [t,~] = getpoints(plot_handles(1)); |
942cb3c53a47
Simplified implementation of time quantity plot.
Jonatan Werpers <jonatan@werpers.com>
parents:
70
diff
changeset
|
23 if t(1) < t(end) |
74
d0df12c03aac
Added missing axis_handle reference.
Jonatan Werpers <jonatan@werpers.com>
parents:
72
diff
changeset
|
24 xlim(axis_handle, [t(1) t(end)]); |
70
243c558dc3ae
Made end of animated quantity plot nicer.
Jonatan Werpers <jonatan@werpers.com>
parents:
69
diff
changeset
|
25 end |
0 | 26 end |
27 end | |
28 update_data = @update; | |
29 end |