Skip to content

Instantly share code, notes, and snippets.

@mido3ds
Created January 25, 2017 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mido3ds/5239d4ddd363252611964d4686d96f79 to your computer and use it in GitHub Desktop.
Save mido3ds/5239d4ddd363252611964d4686d96f79 to your computer and use it in GitHub Desktop.
/* Extended */
/* add this to Solving.h */
// current in given element
double Get_Current(const Circuit*& circiut, const Element*& element);
// current in element due to another element
// (the current that due_to_element caused in element)
double Get_Current(const Circuit*& circiut, const Element*& element, const Element*& due_to_element);
// positive when dissipated, negative when supplied
double Get_Power(const Circuit*& circuit, const Element*& element);
// get power that due_to_elemnt caused in element
double Get_Power(const Circuit*& circuit, const Element*& element, const Element*& due_to_element);
// voltage difference between node1 & node2
// given the ids' of them, it searched for them in circuit
// given ids' are expected to be valid (in the circuit)
double Get_VoltDiff(const Circuit*& circuit, const int node1_id, const int node2_id);
// voltage differnt between two nodes that due_to_element caused
double Get_VoltDiff(const Circuit*& circuit, const int node1_id, const int node2_id, const Element*& due_to_element);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment