fix: current dump timestamp
parent
a08f602a55
commit
101e55202d
|
@ -34,7 +34,6 @@ Engine_Cylinder::~Engine_Cylinder()
|
||||||
|
|
||||||
void Engine_Cylinder::Init()
|
void Engine_Cylinder::Init()
|
||||||
{
|
{
|
||||||
cerr << "Engine_Cylinder::Init()" << endl;
|
|
||||||
Engine::Init();
|
Engine::Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,7 @@ int ProcessCurrent::Process()
|
||||||
|
|
||||||
// cerr << "ts: " << Eng->numTS << " i: " << current << endl;
|
// cerr << "ts: " << Eng->numTS << " i: " << current << endl;
|
||||||
v_current.push_back(current);
|
v_current.push_back(current);
|
||||||
file << (double)Eng->GetNumberOfTimesteps()*Op->GetTimestep() << "\t" << current << endl;
|
//current is sampled half a timestep later then the voltages
|
||||||
|
file << (0.5 + (double)Eng->GetNumberOfTimesteps())*Op->GetTimestep() << "\t" << current << endl;
|
||||||
return GetNextInterval();
|
return GetNextInterval();
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,11 +101,11 @@ system(command)
|
||||||
cd(savePath);
|
cd(savePath);
|
||||||
|
|
||||||
UI = ReadUI({'ut1_1','ut1_2','it1'},'tmp/');
|
UI = ReadUI({'ut1_1','ut1_2','it1'},'tmp/');
|
||||||
u_f = (UI.FD{1}.val + UI.FD{2}.val)/2; %averaging voltages to fit current
|
u_f = (UI.FD{1}.val + UI.FD{2}.val)/2; %averaging voltages to fit current
|
||||||
i_f = UI.FD{3}.val / partial;
|
i_f = UI.FD{3}.val / partial;
|
||||||
|
|
||||||
delta_t = 1.35929e-11; % time-step (s) FIXME will change, if mesh is changed!
|
delta_t = UI.TD{3}.t(1) - UI.TD{1}.t(1); % half time-step (s)
|
||||||
i_f2 = i_f .* exp(-1i*2*pi*UI.FD{1}.f*delta_t/2); % compensate half time-step advance of H-field
|
i_f2 = i_f .* exp(-1i*2*pi*UI.FD{1}.f*delta_t); % compensate half time-step advance of H-field
|
||||||
|
|
||||||
Z = u_f./i_f2;
|
Z = u_f./i_f2;
|
||||||
plot(UI.FD{1}.f,real(Z),'Linewidth',2);
|
plot(UI.FD{1}.f,real(Z),'Linewidth',2);
|
||||||
|
|
Loading…
Reference in New Issue