MathGroup Archive 1998

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

Search the Archive

Re: Defining a Function??


  • To: mathgroup@smc.vnet.net
  • Subject: [mg11426] Re: Defining a Function??
  • From: "P.J. Hinton" <paulh@wolfram.com>
  • Date: Thu, 12 Mar 1998 01:33:03 -0500
  • Organization: Wolfram Research, Inc.
  • References: <6dv6lj$5qh@smc.vnet.net>

On 8 Mar 1998, Corey & Alicia Beaverson wrote:

> Below is a program that I have written, with much help from the critique
> on my last program...thanks everybody!. Anyway, if I define all of the
> varibles as global, the program runs and outputs the results. I want to
> set it up as a function though so I can use it for more than one case.
> I am not sure what I am doing wrong here but for some reason it does
> not seem to run, instead it just gives me the input back.....Thanks in
> advance!!!
> 
> In[29]:=
> 
> OneDPlaneWall[L_,rho_,k_,c_,Tinfo_,TinfL_,ho_,hL_,time_,T_,n_]:=

	[long segment of code omitted for brevity]

> In[32]:=
> OneDPlaneWall[0.25,1860,0.72,17,-6,100,60,0,17,11] 
>
> Out[32]=
> OneDPlaneWall[0.25,1860,0.72,17,-6,100,60,0,17,11]

The reason that Mathematica returns your output unchanged is that you
are supplying fewer arguments to the function OneDPlaneWall than what
it was designed to accept:

(* Your function is designed to work for a sequence of 11 arguments *)

In[1]:= Length @
OneDPlaneWall[L_,rho_,k_,c_,Tinfo_,TinfL_,ho_,hL_,time_,T_,n_]

Out[1]= 11

(* You supplied only 10 in your attept to use it *)

In[2]:= Length @ OneDPlaneWall[0.25,1860,0.72,17,-6,100,60,0,17,11]

Out[2]= 10

Try supplying the missing eleventh argument and see what happens.

--
P.J. Hinton
Mathematica Programming Group           paulh@wolfram.com Wolfram
Research, Inc.                  http://www.wolfram.com/~paulh/




  • Prev by Date: Question about Coefficient
  • Next by Date: Re: Problem with ->
  • Prev by thread: Re: Defining a Function??
  • Next by thread: defining precision (Q:)