Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihantao committed Mar 31, 2024
1 parent 7a87ad5 commit 7cc8daf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 9 additions & 2 deletions andes/core/symprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,26 @@ def generate_symbols(self):
self.tex_names[name] = sp.Symbol(tex_name)
# -----------------------------------------------------------

# `all_params_names` include parameters, services, exports from blocks, etc.
for var in self.cache.all_params_names:
is_real = True

if var in self.parent.services:
if self.parent.services[var].vtype == complex:
is_real = False

self.inputs_dict[var] = sp.Symbol(var)

for var in self.cache.all_vars_names:
tmp = sp.Symbol(var)
tmp = sp.Symbol(var, real=True) # all DAE variables are real
self.vars_dict[var] = tmp
self.inputs_dict[var] = tmp
if var in self.cache.vars_int:
self.vars_int_dict[var] = tmp

# store tex names defined in `self.config`
for key in self.config.as_dict():
tmp = sp.Symbol(key)
tmp = sp.Symbol(key, real=True) # not expecting complex numbers in config
self.inputs_dict[key] = tmp
if key in self.config.tex_names:
self.tex_names[tmp] = sp.Symbol(self.config.tex_names[key])
Expand Down
6 changes: 6 additions & 0 deletions docs/source/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ The APIs before v3.0.0 are in beta and may change without prior notice.
v1.9 Notes
==========

v1.9.3 (2024-04-XX)
-------------------
- In symbolic processor, most variables are assumed to be real, except some
services that are specified as complex. This will allow generating simplified
expressions.

v1.9.2 (2024-03-25)
-------------------
- Improve PSS/E parser for the `wmod` field in the static generator
Expand Down

0 comments on commit 7cc8daf

Please sign in to comment.