A compact nanogrid with a behavior-tree control for islanded applications and remote areas