MATLAB: How to generate the Taylor series as a function of several variables in MATLAB R2011b
MATLABmultivariatemupadseriestaylor
I have a symbolic function with several independent variables:
y = f(x,w,z)
I would like to know if there is a way to to generate the Taylor series of this function.
Best Answer
This enhancement has been incorporated in Release 2012a (R2012a). For previous product releases, read below for any possible workarounds:
The ability to generate a symbolic expression for the Taylor Series of a function of several variables is not available from the MATLAB command line. The following example computes the first terms of the taylor series of f with respect to the variable x around the point x0.
taylor(f, x = x0)
As a workaround, the Multivariate Taylor Series may be generated within the MUPAD Notebook interface if you have the Symbolic Math Toolbox (check the output of VER).
The following example may be executed within the MUPAD Notebook for the function f:
mtaylor(f, [x = x0, y = y0, ...])
This computes the first terms of the Multivariate Taylor Series of f with respect to the variables x, y etc. around the points x = x0, y = y0 etc.
To make the simulation "really" in real-time, you need to run the simulation in a target (micro-controller) with a real-time operation system (RTOS). Your PC or MAC is unlikely a real-time target. xPc Target can boot your PC as a real-time target but that's a different story.
If you just want to slow down your simulation to close to real-time, you can use Guy Rouleau's S-function.
You can use mupad for this. Suppose your ODE is dot(.)=f(x,y....) and you want to expand along(x0,yo,....) and n is the order upto which you want to truncate, then the command in mupad is
Best Answer