Skip to content

Adding inputs and outputs functions #1209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dannys4
Copy link
Contributor

@dannys4 dannys4 commented Aug 17, 2021

This adds functions to access inputs and outputs of a system

end

function outputs(sys::AbstractSystem)
[st for st in states(sys) if isoutput(st)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be true. Do you want it to be true?

Copy link
Contributor Author

@dannys4 dannys4 Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what case would it operate incorrectly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah they could be eliminated to observed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, so should I cat any states in observed that are also decorated as outputs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then, you cannot calculate the Jacobian.

Copy link
Member

@YingboMa YingboMa Aug 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppose we have the reduced output as an observed variable x ~ a + b with the equation D(y) ~ a + sin(a) + b. What's the derivative of the right hand wrt x ~ a + b? We cannot differentiate this thing. First, matching a+b is hard. Second, we don't know if this a + b is from x. It could very well be something else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with you on the idea that the a+b needs to be "from" x, but I see your point nonetheless. Does that have anything to do with it being an output though? Your argument seems to be valid regardless of that. Right now, don't we just expect people to, for lack of better words, "not do that"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given x is an output, what's the output Jacobian of

D(y) ~ a + b + x
0 ~ a + b - x

and what's the output Jacobian of

```julia
D(y) ~ 2a + 2b

wrt a+b?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Say x isn't an output though. Isn't this still a problem? I'm failing to see where it being labelled as output=true comes in

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When linearizing control problems, we need to compute the Jacobian wrt the inputs or the outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants