CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: maths functions

  1. #1
    Join Date
    Jun 1999
    Location
    Malaysia
    Posts
    60

    maths functions

    i would like to create a program which can display electronic circuits and simulate it. i wish to know where should i place my mathematic calculations or functions?


  2. #2
    Join Date
    May 1999
    Location
    CA, USA
    Posts
    586

    Re: maths functions

    I would probably set up a parent class CComponents and derive all my different electronic components from that class... so you would have CResistor, CCapacitor, CInductor, etc all derived from your base class CComponents. Each of these classes would probably have their own member variables and functions to keep track of the number of pins, the package, resistance/capacitance/etc... and any spice functions that you'd need for each component... So each object (CResistor, CCapacitor, etc) would have a member function GetPhaseResponse(), GetCurrent(), GetVoltage()... etc.

    This is a really involved project and I wish you the best of luck, there are already packages out there that do this... but their prices are pretty high.

    Regards.

    Rail

    Recording Engineer/Software Developer
    Rail Jon Rogut Software
    [email protected]
    http://home.earthlink.net/~railro/

  3. #3
    Join Date
    Jul 1999
    Location
    Uitca, NY
    Posts
    120

    Re: maths functions

    This is a large project. You will need to create lots of classes and member functions. Create these as a separate class family starting with an abstract class as a base class. You may need more than one base class. Maybe start with Passive, Discrete, IC and Connection classes. The Connection class can keep track of your interconnects. Put your component objects in the Document class where you can load/save them easily. Put your calculations in the View class so that they don't take up document space. They can be recalculated when the view is updated. Remember to put #include <math.h> in the StdAfx.h file, so that complex math routines are availabe to all source code files. These are just quick suggestions.
    Good luck.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured