Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5566

Help in function defination

From Mohan <mohanbochum@googlemail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Help in function defination
Date 2011-10-10 08:28 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j6uabo$f1a$1@smc.vnet.net> (permalink)

Show all headers | View raw


Hi, I have defined some functions, but when i substitute values i get
an error message, please check below.

Definition of a basic function
In[1]:= SFn1[p_] := (1/2)*(1 - p)

Definition of new function using the basic function
In[65]:= N1[p1_, p2_, p3_] := (SFn1[p1]*(p1))*SFn1[p2]*SFn1[p3]

Derivative of the new function
In[68]:= N1dx[p1_, p2_, p3_] := D[N1[p1, p2, p3], p1]

declaring function variables for the new derivative function
In[69]:= N1dx[x, y, z]

this is the output i want. its right
Out[69]= 1/8 (1 - x) (1 - y) (1 - z) - 1/8 x (1 - y) (1 - z)

**************************************************************************************************
If i substitute the value for the derivative function I get an error
as shown below...
please help me to find the right way to do it.
**************************************************************************************************
In[77]:= N1dx[1, 10, 10]

During evaluation of In[77]:= General::ivar: 1 is not a valid
variable. >>

Out[77]= \!\(
\*SubscriptBox[\(\[PartialD]\), \(1\)]0\)

Out[69]= 1/8 (1 - x) (1 - y) (1 - z) - 1/8 x (1 - y) (1 - z)

In[77]:= N1dx[1, 10, 10]

During evaluation of In[77]:= General::ivar: 1 is not a valid
variable. >>

Out[77]= \!\(
\*SubscriptBox[\(\[PartialD]\), \(1\)]0\)

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Help in function defination Mohan <mohanbochum@googlemail.com> - 2011-10-10 08:28 +0000

csiph-web