fix: current dump timestamp

pull/1/head
Thorsten Liebig 2010-04-09 21:15:44 +02:00
parent a08f602a55
commit 101e55202d
3 changed files with 5 additions and 5 deletions

View File

@ -34,7 +34,6 @@ Engine_Cylinder::~Engine_Cylinder()
void Engine_Cylinder::Init()
{
cerr << "Engine_Cylinder::Init()" << endl;
Engine::Init();
}

View File

@ -95,6 +95,7 @@ int ProcessCurrent::Process()
// cerr << "ts: " << Eng->numTS << " i: " << current << endl;
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();
}

View File

@ -101,11 +101,11 @@ system(command)
cd(savePath);
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;
delta_t = 1.35929e-11; % time-step (s) FIXME will change, if mesh is changed!
i_f2 = i_f .* exp(-1i*2*pi*UI.FD{1}.f*delta_t/2); % compensate half time-step advance of H-field
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); % compensate half time-step advance of H-field
Z = u_f./i_f2;
plot(UI.FD{1}.f,real(Z),'Linewidth',2);