{"action":"created","comment":{"url":"https://api.github.com/repos/chebfun/chebfun/pulls/comments/40564509","id":40564509,"diff_hunk":"@@ -0,0 +1,61 @@\n+function varargout = constructODEsol(solver, odefun, tspan, uinit, varargin)\r\n+%CONSTRUCTODESOL   Call one of Matlab's ODE solvers and return a CHEBFUN\r\n+%   Y = CHEBFUN.CONSTRUCTODESOL(SOLVER, ODEFUN, D, ...) calls one of the the\r\n+%   built-in MATLAB methods SOLVER to solve an initial-value problem on the\r\n+%   domain D. The result is then converted to a piecewise-defined CHEBFUN with\r\n+%   one column per solution component.\r\n+%\r\n+%   CHEBFUN.CONSTRUCTODESOL has the same calling sequence as Matlab's standard\r\n+%   odesolvers (ode113, ode15s, ode45) following the first argument.\r\n+%\r\n+%   One can also write [T, Y] = CONSTRUCTODESOL(...), in which case T is a\r\n+%   linear CHEBFUN on the domain D.\r\n+%\r\n+%   It is possible to pass a MATLAB ODESET struct to this method for specifying\r\n+%   options. The CHEBFUN overloads of the MATLAB ODE methods allow an extra\r\n+%   option, 'restartSolver', which if set to TRUE, will restart the ODE solver\r\n+%   at every breakpoint encountered. This is the default behaviour\r\n+%\r\n+% See also ODESET, ODE113, ODE15s, ODE45.\r\n+\r\n+% Copyright 2015 by The University of Oxford and The Chebfun Developers. \r\n+% See http://www.chebfun.org/ for Chebfun information.\r\n+\r\n+\r\n+% If varargin{1} (which correspond to options) does not have a field called\r\n+% RESETSOLVER, or options don't get passed in, this throws an error, which is\r\n+% resolved in the catch statement to go to the default behaviour of resetting.\r\n+try\r","path":"@chebfun/constructODEsol.m","position":28,"original_position":28,"commit_id":"bebc9d5cfbd18aea61f0fa9b80c8a030b0549554","original_commit_id":"bebc9d5cfbd18aea61f0fa9b80c8a030b0549554","user":{"login":"aaustin141","id":3380006,"avatar_url":"https://avatars.githubusercontent.com/u/3380006?v=3","gravatar_id":"","url":"https://api.github.com/users/aaustin141","html_url":"https://github.com/aaustin141","followers_url":"https://api.github.com/users/aaustin141/followers","following_url":"https://api.github.com/users/aaustin141/following{/other_user}","gists_url":"https://api.github.com/users/aaustin141/gists{/gist_id}","starred_url":"https://api.github.com/users/aaustin141/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaustin141/subscriptions","organizations_url":"https://api.github.com/users/aaustin141/orgs","repos_url":"https://api.github.com/users/aaustin141/repos","events_url":"https://api.github.com/users/aaustin141/events{/privacy}","received_events_url":"https://api.github.com/users/aaustin141/received_events","type":"User","site_admin":false},"body":"As far as I'm concerned, `try` blocks are great tools for error/exception handling, but using one as a substitute for proper input-parsing logic like it's done here is not a good idea...","created_at":"2015-09-28T15:18:37Z","updated_at":"2015-09-28T15:18:37Z","html_url":"https://github.com/chebfun/chebfun/pull/1612#discussion_r40564509","pull_request_url":"https://api.github.com/repos/chebfun/chebfun/pulls/1612","_links":{"self":{"href":"https://api.github.com/repos/chebfun/chebfun/pulls/comments/40564509"},"html":{"href":"https://github.com/chebfun/chebfun/pull/1612#discussion_r40564509"},"pull_request":{"href":"https://api.github.com/repos/chebfun/chebfun/pulls/1612"}}},"pull_request":{"url":"https://api.github.com/repos/chebfun/chebfun/pulls/1612","id":46034516,"html_url":"https://github.com/chebfun/chebfun/pull/1612","diff_url":"https://github.com/chebfun/chebfun/pull/1612.diff","patch_url":"https://github.com/chebfun/chebfun/pull/1612.patch","issue_url":"https://api.github.com/repos/chebfun/chebfun/issues/1612","number":1612,"state":"open","locked":false,"title":"Fix chebop short pulses","user":{"login":"asgeirbirkis","id":3543429,"avatar_url":"https://avatars.githubusercontent.com/u/3543429?v=3","gravatar_id":"","url":"https://api.github.com/users/asgeirbirkis","html_url":"https://github.com/asgeirbirkis","followers_url":"https://api.github.com/users/asgeirbirkis/followers","following_url":"https://api.github.com/users/asgeirbirkis/following{/other_user}","gists_url":"https://api.github.com/users/asgeirbirkis/gists{/gist_id}","starred_url":"https://api.github.com/users/asgeirbirkis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asgeirbirkis/subscriptions","organizations_url":"https://api.github.com/users/asgeirbirkis/orgs","repos_url":"https://api.github.com/users/asgeirbirkis/repos","events_url":"https://api.github.com/users/asgeirbirkis/events{/privacy}","received_events_url":"https://api.github.com/users/asgeirbirkis/received_events","type":"User","site_admin":false},"body":"This closes #1512 . The trick is to restart the ODE solvers at each breakpoint encountered, which ensures that short pulses are detected. This PR introduces a new option for cheboppref, which allows turning off this new default behaviour.\r\n\r\nA small experiment indicates that this will not cause a performance hit for piecewise problem, but on the contrary, improve timings slightly. Again, here is our favourite piecewise problem from #1599:\r\n```\r\nL = chebop(0,8); L.lbc = 0;\r\nL.op = @(t,y) diff(y) + y;\r\nt = chebfun('t',[0 8]);\r\n% Smooth RHS\r\ng = sin(t.^2); \r\ntic, \r\nfor i =1:5\r\n    y1 = L\\g;\r\nend\r\ntime = toc; fprintf('smooth: %4.3fs.\\n', time)\r\n% Piecewise RHS\r\ng = sign(sin(t.^2));\r\ntic\r\nfor i=1:5\r\n    y2 = L\\g;\r\nend\r\ntime = toc; fprintf('piecewise: %4.2fs.\\n', time)\r\n```\r\n\r\nOn development, running 2015b, I get:\r\n```\r\nsmooth: 0.599s.\r\npiecewise: 4.41s.\r\n```\r\n\r\nOn this branch, I get:\r\n```\r\nsmooth: 0.602s.\r\npiecewise: 4.06s.\r\n```","created_at":"2015-09-25T17:01:54Z","updated_at":"2015-09-28T15:18:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80a716854cd693a909e11a368769a942eec8420d","assignee":null,"milestone":{"url":"https://api.github.com/repos/chebfun/chebfun/milestones/5","html_url":"https://github.com/chebfun/chebfun/milestones/v5.3","labels_url":"https://api.github.com/repos/chebfun/chebfun/milestones/5/labels","id":945403,"number":5,"title":"v5.3","description":"New features and speeding up Chebfun.\r\n\r\nPotential new features:\r\n* Removal of epslevels and .vscale properties.\r\n* Improvements to Chebfun constructor\r\n* Trigonometrical spectral discretization\r\n* chebfun2/explain movie\r\n* firpm\r\n* NH has observed that for periodic boundary conditions we can use _any_ of the MATLAB ode solvers (for non-periodic conditions we need ODE15S or ODE23T because  they support singular mass matrices).","creator":{"login":"asgeirbirkis","id":3543429,"avatar_url":"https://avatars.githubusercontent.com/u/3543429?v=3","gravatar_id":"","url":"https://api.github.com/users/asgeirbirkis","html_url":"https://github.com/asgeirbirkis","followers_url":"https://api.github.com/users/asgeirbirkis/followers","following_url":"https://api.github.com/users/asgeirbirkis/following{/other_user}","gists_url":"https://api.github.com/users/asgeirbirkis/gists{/gist_id}","starred_url":"https://api.github.com/users/asgeirbirkis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asgeirbirkis/subscriptions","organizations_url":"https://api.github.com/users/asgeirbirkis/orgs","repos_url":"https://api.github.com/users/asgeirbirkis/repos","events_url":"https://api.github.com/users/asgeirbirkis/events{/privacy}","received_events_url":"https://api.github.com/users/asgeirbirkis/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":16,"state":"open","created_at":"2015-01-21T15:43:20Z","updated_at":"2015-09-25T17:02:23Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/chebfun/chebfun/pulls/1612/commits","review_comments_url":"https://api.github.com/repos/chebfun/chebfun/pulls/1612/comments","review_comment_url":"https://api.github.com/repos/chebfun/chebfun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chebfun/chebfun/issues/1612/comments","statuses_url":"https://api.github.com/repos/chebfun/chebfun/statuses/bebc9d5cfbd18aea61f0fa9b80c8a030b0549554","head":{"label":"chebfun:fix-chebop-shortPulses","ref":"fix-chebop-shortPulses","sha":"bebc9d5cfbd18aea61f0fa9b80c8a030b0549554","user":{"login":"chebfun","id":3082993,"avatar_url":"https://avatars.githubusercontent.com/u/3082993?v=3","gravatar_id":"","url":"https://api.github.com/users/chebfun","html_url":"https://github.com/chebfun","followers_url":"https://api.github.com/users/chebfun/followers","following_url":"https://api.github.com/users/chebfun/following{/other_user}","gists_url":"https://api.github.com/users/chebfun/gists{/gist_id}","starred_url":"https://api.github.com/users/chebfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chebfun/subscriptions","organizations_url":"https://api.github.com/users/chebfun/orgs","repos_url":"https://api.github.com/users/chebfun/repos","events_url":"https://api.github.com/users/chebfun/events{/privacy}","received_events_url":"https://api.github.com/users/chebfun/received_events","type":"Organization","site_admin":false},"repo":{"id":7893220,"name":"chebfun","full_name":"chebfun/chebfun","owner":{"login":"chebfun","id":3082993,"avatar_url":"https://avatars.githubusercontent.com/u/3082993?v=3","gravatar_id":"","url":"https://api.github.com/users/chebfun","html_url":"https://github.com/chebfun","followers_url":"https://api.github.com/users/chebfun/followers","following_url":"https://api.github.com/users/chebfun/following{/other_user}","gists_url":"https://api.github.com/users/chebfun/gists{/gist_id}","starred_url":"https://api.github.com/users/chebfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chebfun/subscriptions","organizations_url":"https://api.github.com/users/chebfun/orgs","repos_url":"https://api.github.com/users/chebfun/repos","events_url":"https://api.github.com/users/chebfun/events{/privacy}","received_events_url":"https://api.github.com/users/chebfun/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chebfun/chebfun","description":"Chebfun is an open-source software system for numerical computing with functions.","fork":false,"url":"https://api.github.com/repos/chebfun/chebfun","forks_url":"https://api.github.com/repos/chebfun/chebfun/forks","keys_url":"https://api.github.com/repos/chebfun/chebfun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chebfun/chebfun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chebfun/chebfun/teams","hooks_url":"https://api.github.com/repos/chebfun/chebfun/hooks","issue_events_url":"https://api.github.com/repos/chebfun/chebfun/issues/events{/number}","events_url":"https://api.github.com/repos/chebfun/chebfun/events","assignees_url":"https://api.github.com/repos/chebfun/chebfun/assignees{/user}","branches_url":"https://api.github.com/repos/chebfun/chebfun/branches{/branch}","tags_url":"https://api.github.com/repos/chebfun/chebfun/tags","blobs_url":"https://api.github.com/repos/chebfun/chebfun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chebfun/chebfun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chebfun/chebfun/git/refs{/sha}","trees_url":"https://api.github.com/repos/chebfun/chebfun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chebfun/chebfun/statuses/{sha}","languages_url":"https://api.github.com/repos/chebfun/chebfun/languages","stargazers_url":"https://api.github.com/repos/chebfun/chebfun/stargazers","contributors_url":"https://api.github.com/repos/chebfun/chebfun/contributors","subscribers_url":"https://api.github.com/repos/chebfun/chebfun/subscribers","subscription_url":"https://api.github.com/repos/chebfun/chebfun/subscription","commits_url":"https://api.github.com/repos/chebfun/chebfun/commits{/sha}","git_commits_url":"https://api.github.com/repos/chebfun/chebfun/git/commits{/sha}","comments_url":"https://api.github.com/repos/chebfun/chebfun/comments{/number}","issue_comment_url":"https://api.github.com/repos/chebfun/chebfun/issues/comments{/number}","contents_url":"https://api.github.com/repos/chebfun/chebfun/contents/{+path}","compare_url":"https://api.github.com/repos/chebfun/chebfun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chebfun/chebfun/merges","archive_url":"https://api.github.com/repos/chebfun/chebfun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chebfun/chebfun/downloads","issues_url":"https://api.github.com/repos/chebfun/chebfun/issues{/number}","pulls_url":"https://api.github.com/repos/chebfun/chebfun/pulls{/number}","milestones_url":"https://api.github.com/repos/chebfun/chebfun/milestones{/number}","notifications_url":"https://api.github.com/repos/chebfun/chebfun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chebfun/chebfun/labels{/name}","releases_url":"https://api.github.com/repos/chebfun/chebfun/releases{/id}","created_at":"2013-01-29T13:59:55Z","updated_at":"2015-09-22T16:54:52Z","pushed_at":"2015-09-28T10:53:46Z","git_url":"git://github.com/chebfun/chebfun.git","ssh_url":"git@github.com:chebfun/chebfun.git","clone_url":"https://github.com/chebfun/chebfun.git","svn_url":"https://github.com/chebfun/chebfun","homepage":"http://www.chebfun.org/","size":39865,"stargazers_count":74,"watchers_count":74,"language":"Matlab","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":165,"forks":15,"open_issues":165,"watchers":74,"default_branch":"development"}},"base":{"label":"chebfun:development","ref":"development","sha":"a04a576619f6b5325368c039757855ac2e26e8cb","user":{"login":"chebfun","id":3082993,"avatar_url":"https://avatars.githubusercontent.com/u/3082993?v=3","gravatar_id":"","url":"https://api.github.com/users/chebfun","html_url":"https://github.com/chebfun","followers_url":"https://api.github.com/users/chebfun/followers","following_url":"https://api.github.com/users/chebfun/following{/other_user}","gists_url":"https://api.github.com/users/chebfun/gists{/gist_id}","starred_url":"https://api.github.com/users/chebfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chebfun/subscriptions","organizations_url":"https://api.github.com/users/chebfun/orgs","repos_url":"https://api.github.com/users/chebfun/repos","events_url":"https://api.github.com/users/chebfun/events{/privacy}","received_events_url":"https://api.github.com/users/chebfun/received_events","type":"Organization","site_admin":false},"repo":{"id":7893220,"name":"chebfun","full_name":"chebfun/chebfun","owner":{"login":"chebfun","id":3082993,"avatar_url":"https://avatars.githubusercontent.com/u/3082993?v=3","gravatar_id":"","url":"https://api.github.com/users/chebfun","html_url":"https://github.com/chebfun","followers_url":"https://api.github.com/users/chebfun/followers","following_url":"https://api.github.com/users/chebfun/following{/other_user}","gists_url":"https://api.github.com/users/chebfun/gists{/gist_id}","starred_url":"https://api.github.com/users/chebfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chebfun/subscriptions","organizations_url":"https://api.github.com/users/chebfun/orgs","repos_url":"https://api.github.com/users/chebfun/repos","events_url":"https://api.github.com/users/chebfun/events{/privacy}","received_events_url":"https://api.github.com/users/chebfun/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chebfun/chebfun","description":"Chebfun is an open-source software system for numerical computing with functions.","fork":false,"url":"https://api.github.com/repos/chebfun/chebfun","forks_url":"https://api.github.com/repos/chebfun/chebfun/forks","keys_url":"https://api.github.com/repos/chebfun/chebfun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chebfun/chebfun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chebfun/chebfun/teams","hooks_url":"https://api.github.com/repos/chebfun/chebfun/hooks","issue_events_url":"https://api.github.com/repos/chebfun/chebfun/issues/events{/number}","events_url":"https://api.github.com/repos/chebfun/chebfun/events","assignees_url":"https://api.github.com/repos/chebfun/chebfun/assignees{/user}","branches_url":"https://api.github.com/repos/chebfun/chebfun/branches{/branch}","tags_url":"https://api.github.com/repos/chebfun/chebfun/tags","blobs_url":"https://api.github.com/repos/chebfun/chebfun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chebfun/chebfun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chebfun/chebfun/git/refs{/sha}","trees_url":"https://api.github.com/repos/chebfun/chebfun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chebfun/chebfun/statuses/{sha}","languages_url":"https://api.github.com/repos/chebfun/chebfun/languages","stargazers_url":"https://api.github.com/repos/chebfun/chebfun/stargazers","contributors_url":"https://api.github.com/repos/chebfun/chebfun/contributors","subscribers_url":"https://api.github.com/repos/chebfun/chebfun/subscribers","subscription_url":"https://api.github.com/repos/chebfun/chebfun/subscription","commits_url":"https://api.github.com/repos/chebfun/chebfun/commits{/sha}","git_commits_url":"https://api.github.com/repos/chebfun/chebfun/git/commits{/sha}","comments_url":"https://api.github.com/repos/chebfun/chebfun/comments{/number}","issue_comment_url":"https://api.github.com/repos/chebfun/chebfun/issues/comments{/number}","contents_url":"https://api.github.com/repos/chebfun/chebfun/contents/{+path}","compare_url":"https://api.github.com/repos/chebfun/chebfun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chebfun/chebfun/merges","archive_url":"https://api.github.com/repos/chebfun/chebfun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chebfun/chebfun/downloads","issues_url":"https://api.github.com/repos/chebfun/chebfun/issues{/number}","pulls_url":"https://api.github.com/repos/chebfun/chebfun/pulls{/number}","milestones_url":"https://api.github.com/repos/chebfun/chebfun/milestones{/number}","notifications_url":"https://api.github.com/repos/chebfun/chebfun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chebfun/chebfun/labels{/name}","releases_url":"https://api.github.com/repos/chebfun/chebfun/releases{/id}","created_at":"2013-01-29T13:59:55Z","updated_at":"2015-09-22T16:54:52Z","pushed_at":"2015-09-28T10:53:46Z","git_url":"git://github.com/chebfun/chebfun.git","ssh_url":"git@github.com:chebfun/chebfun.git","clone_url":"https://github.com/chebfun/chebfun.git","svn_url":"https://github.com/chebfun/chebfun","homepage":"http://www.chebfun.org/","size":39865,"stargazers_count":74,"watchers_count":74,"language":"Matlab","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":165,"forks":15,"open_issues":165,"watchers":74,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/chebfun/chebfun/pulls/1612"},"html":{"href":"https://github.com/chebfun/chebfun/pull/1612"},"issue":{"href":"https://api.github.com/repos/chebfun/chebfun/issues/1612"},"comments":{"href":"https://api.github.com/repos/chebfun/chebfun/issues/1612/comments"},"review_comments":{"href":"https://api.github.com/repos/chebfun/chebfun/pulls/1612/comments"},"review_comment":{"href":"https://api.github.com/repos/chebfun/chebfun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chebfun/chebfun/pulls/1612/commits"},"statuses":{"href":"https://api.github.com/repos/chebfun/chebfun/statuses/bebc9d5cfbd18aea61f0fa9b80c8a030b0549554"}}}}