Can one make an Accordion's state survive?

In my app I am using a couple of accordions in several forms. Whenever I switch forms (just re-adding, not recreating the component!) all the accordions are always closed again. From a user’s perspective it would be MUCH nicer and more intuitive, if the opened accordions would then still be open as last time, when that form was displayed. Is that achievable?
BTW: why are they always closed in the first place?

Actually - the state IS preserved across removal and re-adding of a form. My code had accidentally re-created the form each time (instead of recycling the previous form - as intended). And with a new form the accordions were of course always closed. My bad!