Saturday 15 February 2014

order of the outputs for the MATLAB solve function -


I'm tinkling with MATLAB function for a while, but it can not seem to be how it dictates the order It does this symbolic variable

Specifically, I have a system of equations that I want to solve together.

  a = f (a, b, c, d) b = f (a, b, c, d) c = f (a, b, c, d) d = f A, b, c, d)   

and these equations are symbolic and other symbolic are variables (different from A, B, C, and D) (hence solution output are not numerical , But are symbolic).

For example, when I solve the speed equations for an inverted spring pendulum, I have two equations, which depend on phiDDot ​​and lenDDot. I use the call function to solve for Fidotte and Linkedot:

  [eom2, eom1] = solution (interval (1) == 0, interval ( 2) == 0, DDFI, DDLAN);   

The solution of ddphi corresponds to the second task of the output matrix, whereas DDLAN corresponds to the first period of the matrix. I was wondering whether MATLAB had any way of telling output DDFi first and DeDelin seconds, or at least determining the order in which they were outputed. Do not know the order of variables becomes a big problem when I solve more than 4 variables, and I'm trying to solve the differential equation using Ode 45.

Any advice would be useful!

I believe that it is alphabetically based on the ASCII value of variable names in your equations According to the solution , in this case the equations are used to parse where you do not give the names of the output variables. The help for sym / symvar indicates that this Returns the variable, namely alphabetically (this is the same, even if it does not say, by calling). If you see the actual code to solve. Check the subfunction named M (type edit in your code window) and assign-optup (line 19 in R2012b), see if it makes a call and This is a comment about the dictionary.

The R2012b (and possibly earlier) documentation is different from the R2013a, which appears to be related to your problem, in R2013a:

If you explicitly specify the independent variable < Code> wars , the solver solution uses the same command to return.

I am still running R2012b, so I can not confirm this different behavior.

No comments:

Post a Comment