Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.5K Views
|
8 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Custom function is not working

Posted 2 years ago

I have defined a function with some variable. When I am giving the value of those variables it is not giving me the value. What is the reason ?enter image description here

Attachment

Attachments:
POSTED BY: Indranil Maiti
8 Replies
Posted 2 years ago

Thanks, everyone for your time and help!

POSTED BY: Indranil Maiti
Posted 2 years ago
POSTED BY: Indranil Maiti
Posted 2 years ago
POSTED BY: Eric Rimbey
Posted 2 years ago

I have corrected that part but the problem has not resolve yet. Here I am sending the code you can check from there.

Attachments:
POSTED BY: Indranil Maiti
Posted 2 years ago

here I am giving the code.

f[Subscript[Y, 0, A] _, Subscript[Y, 0, B] _, Subscript[\[Eta], A] _, 
  Subscript[\[Eta], 
    B] _, \[Lambda]_  ] = (1 - ((1 - 
       Subscript[Y, 0, A])/(1 + 
        Subscript[\[Eta], A]*\[Lambda])^2) - ((1 - 
       Subscript[Y, 0, B])/(1 + 
        Subscript[\[Eta], B]*\[Lambda])^2) + ((1 - 
       Subscript[Y, 0, A])*(1 - 
        Subscript[Y, 0, B])/(1 + Subscript[\[Eta], A]*\[Lambda] + 
         Subscript[\[Eta], B]*\[Lambda] - 
         Subscript[\[Eta], A]*Subscript[\[Eta], B]*\[Lambda])^2))
Attachments:
POSTED BY: Indranil Maiti

Also, when you define a function like f[x_] := 2 x, the variable x must be a simple symbol, not a composite expression like Subscript[Y,0,A].

POSTED BY: Gianluca Gorni
Posted 2 years ago
POSTED BY: Rohit Namjoshi
Posted 2 years ago

You define the function f to have 5 parameters

but when you use the function f you only give it 4 parameters

so Mathematica thinks that f with 4 parameters is a different unknown function.

And there is no _ following your λ in your function definition

POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard