From: goh on 14 Jan 2010 08:41 Hi. I've built a radially symmetric 3D diffusion model using pdepe in MatlabR12. My source term is highly discontinuous (fluctuates up and down at multiples of 20 (source = 0 or 20 or 40 or ...) several times over the tspan. The help file says that "discontinuities in (the source) due to material interfaces are permitted provided that a mesh point is placed at each interface." To me, this seems to be refering to discontinuities along the distance axis. My computing skills are not good enough to know if they are also (implicitly) referring to the time axis. I'm wondering if anyone here understands why discontinuities in the source require a mesh point at the point of discontinuity and if the help file was refering to the xmesh or the tspan or both. Thanks a lot for your wonderful help. :) Warm regards, Goh.
From: Torsten Hennig on 14 Jan 2010 16:29 > Hi. > > I've built a radially symmetric 3D diffusion model > using pdepe in MatlabR12. My source term is highly > discontinuous (fluctuates up and down at multiples of > 20 (source = 0 or 20 or 40 or ...) several times over > the tspan. > > The help file says that "discontinuities in (the > source) due to material interfaces are permitted > provided that a mesh point is placed at each > interface." > > To me, this seems to be refering to discontinuities > along the distance axis. My computing skills are not > good enough to know if they are also (implicitly) > referring to the time axis. > > I'm wondering if anyone here understands why > discontinuities in the source require a mesh point at > the point of discontinuity and if the help file was > refering to the xmesh or the tspan or both. > > Thanks a lot for your wonderful help. :) > > Warm regards, > Goh. If your source term is piecewise continuous in time (e.g. constant over certain time intervals), you should interrupt integration at the points of discontinuity and make a restart there. Then continue integration with the source term for the new time interval. Best wishes Torsten.
From: Goh on 18 Jan 2010 07:34 Thanks for your reply, Torsten. I'm a bit confused by your answer. You mention "interrupting the integration." I presume you mean chopping up my tspan in the function pdepe(...,tspan) so that I have no discontinuities in any single tspan, and then running the code piecewise over all the relevant tspans. Unfortunately, that's asking for more than the help file seems to ask for (help file only wanted me to include the discontinuities in my tspan). My problem is that the discontinuities happen "at random". More precisely, sources occur at random times. Each time a source occurs, it spits out a constant source for 0.25 seconds, then suddenly stops. It's possible that 2 sources will be spitting stuff out at the same time. It's also possible that they overlap slightly. For example, if a source begins to spit stuff out at time t=0 it will stop at time t=0.25. If another source begins at time t=0.1326 it will stop 0.25s later. In this example, the total source is the sum of the two so that initially, the total source will be 20, then 40, then 20 and back to zero. This happens, like, several thousand times in my code. Each time I run my code, the sources will behave differently. I was wondering if any of this changes the suggestion given to me previously by Torsten? Will chopping up my tspans that finely and that many times lead to errors in Matlab? Without resorting to any tricky stuff, I can already get my code to run, but there's just no way of telling if the answer it spits out is correct. My aim, I guess, is to be confident enough to be able to stand in front of The President and say "this code is correct!" I'm willing to take a hard road if it will result in greater accuracy of the result. Thanks! Goh.
From: Torsten Hennig on 18 Jan 2010 16:37 > Thanks for your reply, Torsten. > > I'm a bit confused by your answer. You mention > "interrupting the integration." I presume you mean > chopping up my tspan in the function pdepe(...,tspan) > so that I have no discontinuities in any single > tspan, and then running the code piecewise over all > the relevant tspans. > > Unfortunately, that's asking for more than the help > file seems to ask for (help file only wanted me to > include the discontinuities in my tspan). My problem > is that the discontinuities happen "at random". > > More precisely, sources occur at random times. Each > time a source occurs, it spits out a constant source > for 0.25 seconds, then suddenly stops. It's possible > that 2 sources will be spitting stuff out at the same > time. It's also possible that they overlap slightly. > For example, if a source begins to spit stuff out at > time t=0 it will stop at time t=0.25. If another > source begins at time t=0.1326 it will stop 0.25s > later. In this example, the total source is the sum > of the two so that initially, the total source will > be 20, then 40, then 20 and back to zero. > > This happens, like, several thousand times in my > code. Each time I run my code, the sources will > behave differently. > > I was wondering if any of this changes the suggestion > given to me previously by Torsten? Will chopping up > my tspans that finely and that many times lead to > errors in Matlab? Without resorting to any tricky > stuff, I can already get my code to run, but there's > just no way of telling if the answer it spits out is > correct. > > My aim, I guess, is to be confident enough to be able > to stand in front of The President and say "this code > is correct!" I'm willing to take a hard road if it > will result in greater accuracy of the result. > > Thanks! > Goh. Even if the sources are activated at random times, they must be known for the complete timespan of integration _before_ you call pdepe. So write the times where the sources change in an array in increasing order and call pdepe such that you have no discontinuities in any single tspan. Best wishes Torsten.
|
Pages: 1 Prev: ocr matlab Next: Regarding Image Processing in Matlab..Urgent...please help |