Commit a6602c4d authored by Georg Martin Reinke's avatar Georg Martin Reinke
Browse files

adjust VILLAS example

parent acfcd68e
......@@ -11,18 +11,19 @@ void DPsim::villasExample()
Logger log, llog, rlog;
std::vector<BaseComponent*> comps;
ExternalVoltageSource *evs = new ExternalVoltageSource("v1", 1, 0, 1);
ExternalVoltageSource *evs = new ExternalVoltageSource("v_s", 1, 0, 1);
comps.push_back(evs);
comps.push_back(new LinearResistor("r1", 1, 2, 1));
LinearResistor *r2 = new LinearResistor("r2", 2, 0, 1);
comps.push_back(r2);
comps.push_back(new LinearResistor("r_s", 1, 2, 1));
comps.push_back(new LinearResistor("r_line", 2, 3, 1));
comps.push_back(new Inductor("l_line", 3, 4, 1));
comps.push_back(new LinearResistor("r_load", 4, 0, 1000));
VillasInterface *villas = new VillasInterface("/villas1");
villas->registerVoltageSource(evs, 0, 1);
villas->registerExportedCurrent(evs, 0, 1);
// Set up simulation
Real timeStep = 0.01;
Simulation newSim(comps, 2.0*M_PI*50.0, timeStep, 0.1, log);
Real timeStep = 0.001;
Simulation newSim(comps, 2.0*M_PI*50.0, timeStep, 0.3, log);
newSim.addExternalInterface(villas);
// Main Simulation Loop
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment