Skip to content

Conversation

murrayrm
Copy link
Member

This PR allows parameter values to be saved in time responses as well as passing parameter values (via the params keyword) for the initial_response, ,step_response, and final_response functions (which call through to input_output_response for nonlinear I/O systems).

With this functionality, you can do things like

    nlsys = ct.nlsys(
        lambda t, x, u, params: params['a'] * x[0] + u[0],
        states = 1, inputs = 1, outputs = 1, params={'a': 0})
    timevec = np.linspace(0, 1)
    resp = step_response(nlsys, timevec, params={'a': -0.5})

The simulation will run with params['a'] = -0.5 and this information will be stored in resp.params.

@murrayrm murrayrm force-pushed the save_params-30Mar2024 branch from 7c322e2 to 85568a9 Compare March 30, 2024 22:43
@coveralls
Copy link

coveralls commented Mar 30, 2024

Coverage Status

coverage: 94.449% (+0.02%) from 94.425%
when pulling 85568a9 on murrayrm:save_params-30Mar2024
into 4d878a9 on python-control:main.

@murrayrm murrayrm added this to the 0.10.0 milestone Mar 31, 2024
@murrayrm murrayrm merged commit c8d9c8f into python-control:main Mar 31, 2024
@murrayrm murrayrm deleted the save_params-30Mar2024 branch March 31, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants