[Date Index] [Thread Index] [Author Index]
Re: Branching on error messages?
Look up Check. Carl Woll Wolfram Research On 4/8/2010 7:59 AM, Jack L Goldberg 1 wrote: > Hi Folks, > > In a module I have written I call Reduce and in the most common case, > Reduce does exactly what I want. In some rarer cases, however, Reduce > returns the error message > > Reduce::nsmet: ... (basically, Reduce doesn't know how to simplify > transcendental equations.) > > Suppose in Line L6 of my module I have this code > > L6 = Reduce[L5, var, Reals]; > > I want something like this instead, > > L6 = If[ Reduce[L5, var, Reals] generates no error message, > Reduce[L5,var,Reals], Module[ ... ]; > > So if there is an error message, we go to Module[...] which I hope > corrects things by introducing numerical methods. > > An alternative is this: Define newReduce which acts like Reduce when > no error message of the type Reduce::nsmet occurs and uses my > numerical techniques otherwise. > > I am unsure how to code L6 or whether to explore defining my own newReduce? > Any guidance is appreciated, as usual. > > Jack > > > >