Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

control.matlab.lsim does not work for systems of order > 1 #764

Closed
Labels
@jonschlipf

Description

@jonschlipf

When calling the control.matlab.lsim with a higher-order system (at least 2x2 matrices), there is a prompt:

ValueError: Parameter ``T`` must have same elements as the number of columns in input array ``U``

Inverting U or T does not help. Instead, it prompts a different error with matrix multiplication.
It works properly when calling control.timeresp.forced_response directly, with the "transpose" flag set to false.
The error is likely due to the transpose flag, and its implementation throughout the declaration of control.timeresp.forced_response

import numpy as npimport controlimport control.matlabtime = np.linspace(0.0, 511.0e-6, 512)DAC = np.sin(time)ADC = np.cos(time)input_Kalman = np.transpose(np.concatenate(([[DAC]], [[ADC]]), axis=1)[0])Af = [[0.45768416, -0.42025511], [-0.43354791, 0.51961178]]Bf = [[2.84368641, 52.05922305], [-1.47286557, -19.94861943]]Cf = [[1.0, 0.0], [0.0, 1.0]]Df = [[0.0, 0.0], [0.0, 0.0]]ss_Kalman = control.ss(Af, Bf, Cf, Df, 1.0e-6)x_est, _, _ = control.matlab.lsim(ss_Kalman, input_Kalman, time)

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp