Skip to main content
1-Visitor
March 17, 2016
Question

Working with results from the Mathcad State Space ODE Solver

  • March 17, 2016
  • 11 replies
  • 5145 views

Hi,

I usually work with range variables. I don't know how to work with the results from the Mathcad State Space ODE Solver. They are in a matrix. I want to subtract the results from the state space solver from results of a calculation using range variables. Moreover, I calculated displacement using range variables and want to compare that to the displacement calculated with the state space solver. Some sort of conversion is needed but I can't figure it out.

Thanks for your help.

Update 1; I found one work around but it's pretty brutal. You can't seem to do derivatives on vectors. So I had to brute force things a bit too much for my taste. Hopefully, the experts here will have better ideas. I updated the attachments to this post.

Update 2; I figured it out. I used what I learned from the 'problem (2)' file and applied that to the updated 'problem (1)' file. Much more elegant fix.

11 replies

24-Ruby IV
March 18, 2016

Hi Anthony,

Have you tried to use the built-in "submatrix(...)" function?

afalzone1-VisitorAuthor
1-Visitor
March 18, 2016

Thanks Vladamir,

I have never really worked with matrices in Mathcad before, so I wasn't aware of the feature you mentioned. I will check it out. It seems like I have to work with range variables to do the derivatives and matrices to use the state space solver. So somehow working with both looks like it is going to be a necessity. I did figure out a way to do what I needed, but I still wonder what the best way to work with both is.

24-Ruby IV
March 23, 2016
25-Diamond I
March 18, 2016

How about this:

afalzone1-VisitorAuthor
1-Visitor
March 19, 2016

hmm,

that is strange. you are getting an incorrect result with that method. I looked into it but can't find were it is going wrong. I think the method I used is getting a correct result.

25-Diamond I
March 19, 2016

you are getting an incorrect result with that method

Really? Why do you think so?

I just streamlined what you did.

The right plot differs of course because there I plot the error over t, not over the indices.

R