Magic Network-Magic Error

Hey Brian Family,
I had a quick question about creating a Magic network because I keep raising a Magic error. I suppose brian is not sure about the run command but I am not sure how to create a magic network to rid this error.

Hi @amanforthepeople . Could you give an example where you run into this issue?
In general, you do not “create a magic network” – what Brian calls a “magic network” is the situation where you simply call run(...) , and Brian tries to figure out what is part of your network. This usually works fine, but if you run multiple networks one after the other, or e.g. if you repeatedly simulate things in a jupyter notebook, you can run into the “magic error”. In that case you either have to tell Brian which objects should be part of the network (by creating a Network object), or tell it that you want to start a new fresh simulation by using start_scope().

Thank you for your response. Understood, is there documentation on creating a Network object? I am calling run in a different cell for the same duration use in the previous cell(not sure if that made any sense lol). This is generating the error so I am trying to as you said create a network object to remove the error.

My reply above included a link to the documentation :slight_smile:
Also see for example this tutorial: Introduction to Brian part 3: Simulations — Brian 2 documentation
There are also a number of examples that create Network objects, see for example

Haha, silly me, I did not know that was a link. Thank you again for your prompt response. I will be reviewing the link.