Skip to content

U variable using voltage from next time step #48

@joey-kilgore

Description

@joey-kilgore

When using 4 or 9 parameter IZ models with Forward Euler, the calculations utilize v_next instead of v.

if (!groupConfigs[netId][lGrpId].withParamModel_9)
{
u += dudtIzhikevich4(v_next, u, a, b, timeStep);
}
else
{
u += dudtIzhikevich9(v_next, u, vr, a, b, timeStep);
}

and the same is used in the GPU module

if (!groupConfigsGPU[grpId].withParamModel_9)
{
u += dudtIzhikevich4(v_next, u, a, b, timeStep);
}
else
{
u += dudtIzhikevich9(v_next, u, vr, a, b, timeStep);
}

Unless there is something I don't understand, there is no reason to use v_next and instead v should be used like the other methods (such as RK4)

float k1 = dvdtIzhikevich4(v, u, totalCurrent, timeStep);
float l1 = dudtIzhikevich4(v, u, a, b, timeStep);

This seems like a fundamental error in how voltage and the recovery variable would be calculated with forward euler.


I know that typically RK4 is used for simulations, but I am trying to mirror CARLsim simulations in another simulator to have side by side comparisons, and found this bug in trying to recreate a simple simulation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions