Skip to content

Commit

Permalink
Add new validation notebook for controllers
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Moraga <[email protected]>
  • Loading branch information
martinmoraga committed Jul 4, 2022
1 parent 752db2d commit 69414ce
Show file tree
Hide file tree
Showing 18 changed files with 3,358 additions and 1,741 deletions.
4 changes: 2 additions & 2 deletions Examples/Cxx/Circuits/SP_ReducedOrderSG_SMIB_Fault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ void SP_1ph_SynGen_Fault(String simName, Real timeStep, Real finalTime, Real H,

// Exciter
if (withExciter) {
loggerSP->addAttribute("Vf", exciterSP->attribute("Vf"));
loggerSP->logAttribute("Vf", exciterSP->attribute("Vf"));
}

// Turbine Governor
if (withTurbineGovernor) {
loggerSP->addAttribute("Tm", turbineGovernorSP->attribute("Tm"));
loggerSP->logAttribute("Tm", turbineGovernorSP->attribute("Tm"));
}

Simulation simSP(simNameSP, logLevel);
Expand Down
4 changes: 2 additions & 2 deletions Examples/Cxx/Examples.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ namespace Events {
loadSwitch->open();
system.addComponent(loadSwitch);
system.connectComponentToNodes<Complex>(loadSwitch, { CPS::SimNode<Complex>::GND, connectionNode});
logger->logAttribute("switchedload_i", loadSwitch->attribute("i_intf"));
//logger->logAttribute("switchedload_i", loadSwitch->attribute("i_intf"));
return DPsim::SwitchEvent::make(eventTime, loadSwitch, true);
} else if (domain == CPS::Domain::SP) {
auto loadSwitch = SP::Ph1::Switch::make("Load_Add_Switch_" + nodeName, Logger::Level::debug);
Expand All @@ -569,7 +569,7 @@ namespace Events {
loadSwitch->open();
system.addComponent(loadSwitch);
system.connectComponentToNodes<Complex>(loadSwitch, { CPS::SimNode<Complex>::GND, connectionNode});
logger->logAttribute("switchedload_i", loadSwitch->attribute("i_intf"));
//logger->logAttribute("switchedload_i", loadSwitch->attribute("i_intf"));
return DPsim::SwitchEvent::make(eventTime, loadSwitch, true);
} else {
return nullptr;
Expand Down
45 changes: 39 additions & 6 deletions Examples/Notebooks/Circuits/CS_R2CL.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -27,12 +27,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'dpsim'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Input \u001b[0;32mIn [5]\u001b[0m, in \u001b[0;36m<cell line: 2>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# DPsim EMT simulation\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mdpsim\u001b[39;00m\n\u001b[1;32m 4\u001b[0m name \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mEMT_CS_R2CL\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m# Nodes\u001b[39;00m\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'dpsim'"
]
}
],
"source": [
"# DPsim EMT simulation\n",
"import dpsimpy\n",
"import dpsim\n",
"\n",
"name = 'EMT_CS_R2CL'\n",
"\n",
Expand Down Expand Up @@ -87,6 +99,27 @@
"sim.add_logger(logger)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['anyio==3.6.1', 'apturl==0.5.2', 'argon2-cffi-bindings==21.2.0', 'argon2-cffi==21.3.0', 'asttokens==2.0.5', 'attrs==21.4.0', 'babel==2.10.1', 'backcall==0.2.0', 'bcrypt==3.2.0', 'beautifulsoup4==4.11.1', 'bleach==5.0.0', 'blinker==1.4', 'brlapi==0.8.3', 'certifi==2020.6.20', 'cffi==1.15.0', 'chardet==4.0.0', 'click==8.0.3', 'colorama==0.4.4', 'command-not-found==0.3', 'cryptography==3.4.8', 'cupshelpers==1.0', 'cycler==0.11.0', 'dbus-python==1.2.18', 'debugpy==1.6.0', 'decorator==5.1.1', 'defer==1.0.6', 'defusedxml==0.7.1', 'distlib==0.3.4', 'distro-info==1.1build1', 'distro==1.7.0', 'duplicity==0.8.21', 'entrypoints==0.4', 'executing==0.8.3', 'fasteners==0.14.1', 'fastjsonschema==2.15.3', 'filelock==3.6.0', 'fonttools==4.33.3', 'future==0.18.2', 'httplib2==0.20.2', 'idna==3.3', 'importlib-metadata==4.6.4', 'ipykernel==6.13.0', 'ipython-genutils==0.2.0', 'ipython==8.3.0', 'jedi==0.18.1', 'jeepney==0.7.1', 'jinja2==3.1.2', 'json5==0.9.8', 'jsonschema==4.5.1', 'jupyter-client==7.3.1', 'jupyter-core==4.10.0', 'jupyter-server==1.17.0', 'jupyterlab-pygments==0.2.2', 'jupyterlab-server==2.14.0', 'jupyterlab==3.4.2', 'keyring==23.5.0', 'kiwisolver==1.4.2', 'language-selector==0.1', 'launchpadlib==1.10.16', 'lazr.restfulclient==0.14.4', 'lazr.uri==1.0.6', 'lockfile==0.12.2', 'louis==3.20.0', 'macaroonbakery==1.3.1', 'mako==1.1.3', 'markupsafe==2.0.1', 'matplotlib-inline==0.1.3', 'matplotlib==3.5.2', 'mistune==0.8.4', 'monotonic==1.6', 'more-itertools==8.10.0', 'natsort==8.0.2', 'nbclassic==0.3.7', 'nbclient==0.6.3', 'nbconvert==6.5.0', 'nbformat==5.4.0', 'nest-asyncio==1.5.5', 'netifaces==0.11.0', 'notebook-shim==0.1.0', 'notebook==6.4.11', 'numpy==1.22.4', 'oauthlib==3.2.0', 'olefile==0.46', 'packaging==21.3', 'pandas==1.4.2', 'pandocfilters==1.5.0', 'paramiko==2.9.3', 'parso==0.8.3', 'pexpect==4.8.0', 'pickleshare==0.7.5', 'pillow==9.0.1', 'pip==22.0.2', 'platformdirs==2.5.1', 'prometheus-client==0.14.1', 'prompt-toolkit==3.0.29', 'protobuf==3.12.4', 'psutil==5.9.1', 'ptyprocess==0.7.0', 'pure-eval==0.2.2', 'pycairo==1.20.1', 'pycparser==2.21', 'pycups==2.0.1', 'pygments==2.12.0', 'pygobject==3.42.0', 'pyjwt==2.3.0', 'pymacaroons==0.13.0', 'pynacl==1.5.0', 'pyparsing==2.4.7', 'pyrfc3339==1.1', 'pyrsistent==0.18.1', 'python-apt==2.3.0+ubuntu2', 'python-dateutil==2.8.2', 'python-debian==0.1.43ubuntu1', 'pytz==2022.1', 'pyxdg==0.27', 'pyyaml==5.4.1', 'pyzmq==23.0.0', 'reportlab==3.6.8', 'requests==2.25.1', 'scipy==1.8.1', 'screen-resolution-extra==0.0.0', 'secretstorage==3.3.1', 'send2trash==1.8.0', 'setuptools==59.6.0', 'six==1.16.0', 'sniffio==1.2.0', 'soupsieve==2.3.2.post1', 'stack-data==0.2.0', 'systemd-python==234', 'terminado==0.15.0', 'tinycss2==1.1.1', 'tornado==6.1', 'traitlets==5.2.1.post0', 'ubuntu-advantage-tools==27.8', 'ubuntu-drivers-common==0.0.0', 'ufw==0.36.1', 'unattended-upgrades==0.1', 'urllib3==1.26.5', 'usb-creator==0.3.7', 'villas-dataprocessing==0.3.2', 'virtualenv==20.13.0+ds', 'wadllib==1.3.6', 'wcwidth==0.2.5', 'webencodings==0.5.1', 'websocket-client==1.3.2', 'wheel==0.37.1', 'wxpython==4.0.7', 'xdg==5', 'xkit==0.0.0', 'zipp==1.0.0']\n"
]
}
],
"source": [
"import pkg_resources\n",
"installed_packages = pkg_resources.working_set\n",
"installed_packages_list = sorted([\"%s==%s\" % (i.key, i.version)\n",
" for i in installed_packages])\n",
"print(installed_packages_list)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -369,7 +402,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -383,7 +416,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.9"
"version": "3.10.4"
},
"tests": {
"skip": false
Expand Down
Loading

0 comments on commit 69414ce

Please sign in to comment.