Electrical Circuit Analysis with C++ Issues

AI Thread Summary
The discussion focuses on challenges faced in a C++ project for Electrical Circuit Analysis, particularly issues with mouse driver integration and determining connections between circuit lines. The user expresses uncertainty about establishing mouse connections and whether to use an array to track line endpoints. Suggestions include consulting documentation for GUI libraries and considering a dynamic list for tracking connections. Participants emphasize the importance of compiling code and offer resources for further assistance. Overall, the thread highlights the need for guidance in programming fundamentals and problem-solving strategies in C++.
bishwa
Messages
8
Reaction score
0
I was working on a project work on Electrical Circuit Analysis with c++(bgi mode) and now I'm having problems with the mouse drivers and the connecting cables .

Would anyone help me with this?
 
Physics news on Phys.org
I'll try

Whats your problem? Is it software or hardware related? Or is it problems within your program itself either way let e know maybe I can help you?

Dx :wink:
 
circuit analysis : redifinition of the problem

Whats your problem? :

the main problem is software related.First of all i don't know how to establish connections of my program with the mouse(note: I'm a beginner for c++).

And the second problem is : how can i make the program know whether there is a connection between the lines(representing the circuit) or not. Should i record all the coordinates of the end points of the lines in an array and then check them one by one?
 
You oughtta make a note that this thread is about figuring out how to program something and not how to analyze circuits.. I shied away from it at first in a deeply-rooted fear reaction to the word "circuit"

DAMN YOU, HONORS ELECTROMAGNETICS CLASS! AAAAHHHHRRRRGgglll

As for getting mouse input in your program.. it depends

What sort of GUI libraries are you using? I'd recommend talking to your professor for help on something that specific, or going to the documentation/forums of whatever programmin' libraries you're using

How to record connections between dots, eh? I'd say to just have a dynamic list of which dots are connected, but I think that someone would need more specific information to give you any really useful advice
 


Originally posted by bishwa
the main problem is software related.First of all i don't know how to establish connections of my program with the mouse(note: I'm a beginner for c++).

And the second problem is : how can i make the program know whether there is a connection between the lines(representing the circuit) or not. Should i record all the coordinates of the end points of the lines in an array and then check them one by one?

Hello,
Your using MVC++, you want to create a program. Dont panic its simple ok. 1st; you click file then new, alright. 2nd; Name your program e.g., what_ever_it_is.cpp, ok. 3rd; the software will make a blank sheet for you to write your code on. Finally, when you want to run yor program you must first compile it so that the computer will transform our english lang to computer lang for the computer to understand. Have you taken C, yet? I prefer C++ to C anyways. a lot easier for me.

Next help with your code! I personally would use either an array like your doing or the struct method but plotting all points will probably take up some of your time. Thats ok, with programming all you have is time so youll do just fine. May i suggest to visit this site http://www.cprogramming.com/links.html and post your code there, those guys are C/C++/C## nerds and can help you probably more than I can. Dont forget when posting your code to use the html tags
Code:
your_mouse_code[code/] they like that makes your program easier to read and they makes them feel special, lol.
If you need more help or none of those nerds don't help you then post your code here and we'll figure it out together.
Later 
Dx :wink:
 
Last edited by a moderator:
TL;DR Summary: I came across this question from a Sri Lankan A-level textbook. Question - An ice cube with a length of 10 cm is immersed in water at 0 °C. An observer observes the ice cube from the water, and it seems to be 7.75 cm long. If the refractive index of water is 4/3, find the height of the ice cube immersed in the water. I could not understand how the apparent height of the ice cube in the water depends on the height of the ice cube immersed in the water. Does anyone have an...
Thread 'Variable mass system : water sprayed into a moving container'
Starting with the mass considerations #m(t)# is mass of water #M_{c}# mass of container and #M(t)# mass of total system $$M(t) = M_{C} + m(t)$$ $$\Rightarrow \frac{dM(t)}{dt} = \frac{dm(t)}{dt}$$ $$P_i = Mv + u \, dm$$ $$P_f = (M + dm)(v + dv)$$ $$\Delta P = M \, dv + (v - u) \, dm$$ $$F = \frac{dP}{dt} = M \frac{dv}{dt} + (v - u) \frac{dm}{dt}$$ $$F = u \frac{dm}{dt} = \rho A u^2$$ from conservation of momentum , the cannon recoils with the same force which it applies. $$\quad \frac{dm}{dt}...
Back
Top