MathGroup Archive 2001

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

Search the Archive

Re: Dumb question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27781] Re: [mg27772] Dumb question
  • From: Anesh Sooklal <anesh at fermi.udw.ac.za>
  • Date: Fri, 16 Mar 2001 04:37:36 -0500 (EST)
  • References: <200103140907.EAA00012@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Gustavo,

You first have to define a function P. Your definition of P results not in a
function but rather an assignment. Special functions like Sin(x) are written as
Sin[x]. Note the use of square brackets in order to denote the argument of the
function. Don't use square brackets in order to enclose an expression. Use ( and
). Here is something that works....

P[x_, a_, t_] := (Sin[(a - x)*t]/(a - x))^2

Plot[P[x, 2, 1], {x, 0, Pi}]

The first statement defines a function. Note the use of underscores in order to
define the variables as well as the colon before the = sign.

In the second statement, a = 2 and t = 1. this results in P becoming simply  a
function of  x now.

I hope that I have been of some help.

Anesh Sooklal
Research Assistant
University of Durban-Westville
Dept. of Physics
South Africa

Gustavo Seabra wrote:

> Hello. I know this may be a dumb question, and I apologize for doing that.
> But I am new to Mathematica, and I'm having a little trouble with this. I
> want to plot the equation:
>
> P=[sin(a-x)*t/(a-x)]^2
>
> with fixed t (say, 1) and fixed a (say, Pi/2), with x varying from 0 to Pi.
> I know there is a discontinuity at x=a. Is there a way to plot this? I mean,
> P(x) versus x?
>
> Thanks,
> --
> -----------------------------------------------------------------
> Gustavo Seabra - Graduate Student
> Chemistry Department
> Kansas State University
> -----------------------------------------------------------------



  • References:
  • Prev by Date: Re: Dumb question
  • Next by Date: Re: ReadList query
  • Previous by thread: Re: Dumb question
  • Next by thread: Re: Dumb question