35 lines
736 B
C++
35 lines
736 B
C++
#ifndef SIMULATOR_HPP
|
|
#define SIMULATOR_HPP
|
|
|
|
#include "Circuit.hpp"
|
|
#include "Matrix.hpp"
|
|
|
|
class Simulator
|
|
{
|
|
public:
|
|
Circuit circuit;
|
|
Matrix G;
|
|
Vector I;
|
|
Vector V;
|
|
double time_s;
|
|
int n;//NA矩阵的大小
|
|
int m;//MNA矩阵比NA矩阵多的行数
|
|
Simulator(Circuit c);
|
|
Vector dc_solve();
|
|
int time_solve( double dt, double tmax, std::string filename);
|
|
void add_lc(double dt);
|
|
void load_static_G();
|
|
void load_static_I();
|
|
void updata_I(double time);
|
|
void clear_log(std::string filename);
|
|
};
|
|
|
|
void test_r_i();
|
|
void test_r_v();
|
|
void test_diode();
|
|
void test_time();
|
|
void test_mosfet();
|
|
void test_vccs();
|
|
void test_l6b();
|
|
void test_vcr();
|
|
#endif // !
|