Message Boards Message Boards

GROUPS:

[?] Make a project about parallel RLC circuit gain and Q?

Posted 5 months ago
821 Views
|
4 Replies
|
1 Total Likes
|

Hello everybody. I have a series of Mathematica codes to plot the Gain of a Parallel RLC Circuit and the value of Q, etc. The codes are attached as a picture.

But, unfortunately, it does not draw a diagram.

Wondering if somebody could tell me the error.

Regards.enter image description here

4 Replies

Repost your code in a readable form.

Hi. This Mathematica file attached needs to be modified and corrected. Wondering if one could help find the errors. Best regards.

Attachments:

Mohammad,

You used lower case "c" in Gain definition but upper case "C" in the function. Change to

Gain[R_, L_, c_, f_] := 1/(
 R Sqrt[(1/R)^2 + (2 \[Pi] f c - 1/(2 \[Pi] f L))^2])

and it will work properly.

Also, It is generally a bad idea to start your definitions with upper case characters because you can interfere with the internals of Mathematica. For example "C" has special meaning in Mathematica, but "c" does not. I would make all your functions like "Gain" be "gain" etc because you will suddenly be surprised when you bump into an internal Mathematica function or variable.

Regards,

Neil

Dear Neil,

Thanks a lot for your help.

Mohammad.

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