Message Boards Message Boards

0
|
485 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Not a valid variable in mahtematica

Posted 2 months ago

Hi, I want to diffrentiate the eA1 by y. there is a lambda in the eA1, the lambda is sqrt(x^2+y^2) with some numbers. I got error named "D::ivar: (B Sqrt[x^2+y^2])/(2 c[HBar]) is not a valid variable." How can I fix it? Thanks.

Clear All
\[Lambda] = B*Sqrt[x^2 + y^2]/(2 c\[HBar])
H[\[Lambda]]
D[log[H[\[Lambda]]], \[Lambda]]
H2[x_, y_] := log[H[B*Sqrt[x^2 + y^2]/(2 c\[HBar])]/(2 c\[HBar])]
eA1[x_, y_] = 
B^2*y/(4*c^2*\[Lambda][x, y]) D[H2[x, y], 
B*Sqrt[x^2 + y^2]/(2 c\[HBar])]
eA1[x, y]
eB = D[eA1[x, y], y]
POSTED BY: Minkyung Chun
Posted 2 months ago

Your code is too much of a mess to get an easy answer. I assume that Clear All should be ClearAll[]. I assume that log should be Log. As for D[log[H[\[Lambda]]], \[Lambda]], how do you expect that to evaluate to anything sensible if H is undefined? You get the error because \[Lambda] evaluates to a non-atomic expression involving several other symbols, and thus is not an appropriate variable to differentiate with. As for the fix, there's no way to tell until you provide some clean code--code that is otherwise working.

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

Group Abstract Group Abstract