Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: measured boundary conditions with pde toolbox Date: Wed, 2 Apr 2014 19:33:09 +0000 (UTC) Organization: The MathWorks Inc Lines: 48 Message-ID: <lhholl$pur$1@newscl01ah.mathworks.com> References: <h5cmv4$lbc$1@fred.mathworks.com> <h5d0kd$419$1@fred.mathworks.com> <h5daso$lqr$1@fred.mathworks.com> <h5dpj7$atf$1@fred.mathworks.com> <h5psrj$8g9$1@fred.mathworks.com> <lhhm8o$j16$1@newscl01ah.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: rubyext-06-ls.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: newscl01ah.mathworks.com 1396467189 26587 172.20.102.182 (2 Apr 2014 19:33:09 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Wed, 2 Apr 2014 19:33:09 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2963969 Xref: news.mathworks.com comp.soft-sys.matlab:811896 "Dmitry" wrote in message <lhhm8o$j16$1@newscl01ah.mathworks.com>... > "Doug" wrote in message <h5psrj$8g9$1@fred.mathworks.com>... > > OK, I've answered my own question, and the answer is a boundary M-file. > > > > Though wbound makes a boundary M-file that is based on a simple formula, in exactly the same format as a boundary condition matrix, it's possible to write your own boundary M-file *any way you like*. As long as it takes (p,e,u,time) as inputs and returns [q,g,h,r] as outputs, it works fine with assempde. You just pass the filename of the boundary M-file as the first argument to assempde. So I've written a boundary M-file that takes the necessary inputs (p,e,u,time) but ignores them, instead constructing [q,g,h,r] from my measurements. And it works. Reading the help file for pdebound over and over was the key! > > Hi Doug, > Could you provide an example of this kind of usage please? > As I understood, you just loaded the variable in the boundary M-file like this: > > load('var.mat','var'); > and used it for construction of [q,g,h,r]. Am I right? > > I've done the same (for hyperbolic solver), but I can't check if it works because for some (another) reason the solver gives me the error: > >Error using pdeexpd (line 57) > >Number of variables mismatch between u and bl. > >Error in assemb (line 101) > > [q,g,h,r]=pdeexpd(p,e,u,time,bl); > >Error in pdeODEInfo/getMats (line 164) > > [Q,G,H,R]=assemb(self.b,self.p,self.e,u,time); > >Error in pdeODEInfo/checkFuncDepen (line 60) > > [MM0,K0,M0,F0,Q0,G0,H0,R0] = self.getMats(u0, t0); > >Error in pdeHyperbolicInfo (line 15) > > obj=obj.checkFuncDepen(u0, tlist); > >Error in hyperbolic (line 41) > > pdehyp=pdeHyperbolicInfo(u0,ut0,tlist,b,p,e,t,c,a,f,d); > >Error in main (line 49) > >u = hyperbolic(u0,ut0,tlist,b,p,e,t,c,a,f,d); > > In my case I have only dependence on time in boundary M-file, but the solver assumes that output of it depends on the solution u too > (it goes wrong way at pdeODEInfo/checkFuncDepen stage). > Don't know what to do... There appears to be something wrong with your pdebound function or with how you are passing the handle to it into hyperbolic. Did you follow the example here if you have a single pde: http://www.mathworks.com/help/pde/ug/boundary-conditions-for-scalar-pde.html or here if you have a system of pde: http://www.mathworks.com/help/pde/ug/boundary-conditions-for-pde-systems.html Is the value of "b" that you are passing into hyperbolic something like this? b = @myPdeBoundFunction; % myPdeBoundFunction is whatever you named your function Bill