Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: how to define and analyze function with multiple parts

  • To: mathgroup at smc.vnet.net
  • Subject: [mg130558] Re: how to define and analyze function with multiple parts
  • From: Prabhu Janakiraman <pjanakir1978 at gmail.com>
  • Date: Sat, 20 Apr 2013 05:47:50 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20130419051727.00BE06B14@smc.vnet.net>

Hi, Thanks to all for the replies. Piecewise is the right option I was
looking for.

Prabhu


On Fri, Apr 19, 2013 at 8:49 PM, Tomas Garza <tgarza10 at msn.com> wrote:

> In[1]:= f[x_] := Piecewise[{{x^2, x < 0}, {x, x > 0}}]
>
>
> In[2]:= NIntegrate[f[x], {x, -1, 1}]
>
> Out[2]= 0.833333
>
>
> -Tomas
>
>
>
>
> > From: pjanakir1978 at gmail.com
> > Subject: how to define and analyze function with multiple
> parts
> > To: mathgroup at smc.vnet.net
> > Date: Fri, 19 Apr 2013 01:17:26 -0400
>
> >
> > Hi, I have a function on the plane that has 2 different formulation for
> 2 different regions. Let x = (x1, ..., xn). I want to define it as
> >
> > U(x) = U_1(x) if x is in region 1
> > = U_2(x) if x is in region 2
> >
> > Then I want to analyze such a defined function, like find its max, etc,
> using NMaximize, or put in some other expressions in place of x, to see
> behavior of U.
> >
> > Essentially, how does one define a multipart function, so that we can
> analyze it in the same way we may analyze a single part function or
> polynomial?
> >
> > Thanks.
> >
> > Prabhu
> >
>




  • Prev by Date: Re: how to define and analyze function with multiple
  • Next by Date: Re: Sample Workbooks - Suggested sources to get a newbie going?
  • Previous by thread: Re: how to define and analyze function with multiple
  • Next by thread: Re: how to define and analyze function with multiple parts