Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Symbols for circuit elements are not assumed real in symbolic analysis #32

@RJTK

Description

@RJTK

In symbolic.py there is a dictionary

enabled_assumptions = {'real':False, 'positive':False, 'complex':True}

Which is checked in the _symbol_factory function

def _symbol_factory(name, **options):
    filtered_options = {}
    for i in options:
        if options[i] and enabled_assumptions[i]:
            filtered_options.update({i:options[i]})
        else:
            pass # discarded
    return sympy.Symbol(name.upper(), **filtered_options)

This is preventing symbols from being produced with the real and positive assumptions, for example here:

R = _symbol_factory(elem.part_id.upper(), real=True,
                                      positive=True)

The fix is presumably just to enable these assumptions in the dictionary

enabled_assumptions = {'real':True, 'positive':True, 'complex':True}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions