For case like this, I would suggest an implementation using s-function. Derive a non-linear state equation first and then write the equation into the s-function. If you are not familar with S-function, take a look at the help document. It's not much more than writing out your equations with sin() and cos(). Patrick Ryan wrote: > > > Hey all, > I'm building a simulator for a robot that I am working on. I have > derived the equations of motion for the 6-DOF open-chain > manipulator. > They are in the form > > D(q)*q" + C(q,q')*q' + g(q) = Torque > > Where D and C are 6x6 matrices and g and Torque are 6x1 vectors. > > I would like to implement these equations into Simulink. > > Problem: The terms in D and C are huge. I'm talking 10+ pages per > term. They are all non-linear, invovling sin and cos. > > Is there any way to put these equations into Simulink without > creating 10,000 blocks for each term. > > I am hoping that there is a way that I can say this is the function > f=(q1, q1', q2, q2'...q6,q6') give it every input and have it spit > out q1", q2" and so forth. Or something of that sort. I'm not > exactly sure how it would work, but maybe someone has experience > with > this. > > Thanks for the help guys. > > --Patrick

0 |

1/31/2007 6:36:06 PM

Hello, I have got some math formulas on paper, they are huge. One equation is almost a full page. I am trying to find a way to get this formula to Simulink. Actually when it works to Realtime Workshop or C code too. I assume I need to read from the paper and type into either matlab or MathML or something like that. But what's next is mystery for me. Thanks, Make. ...

Hi, I have a long formulas in Simulink: 3*u(1)*u(2)+u(5)*(u(2)+2*u(1)*sin(u(1)))+(u(3)*abs(u(1)*u(2))+u(4)*u(5 )*abs(u(1))+1)*sign(u(2)+u(5)*u(1)) Initially, I used 'Fcn' block to implement this. However, it turned out not reliable. First, it gave me error message. Then, after i removed '3*u(1)*u(2)', it passed the complier. My question is: any other technical solution based on block (no program) for this long expression except for 'fcn' and 'matlab function'? Thanks Hong ...

Hi, I would like to make a model in MatLab that calculates the 2-D motion of a rigid-body projectile. The model will include the atmospheric properties as a function of altitude, gravity and the drag force acting on the projectile. For the drag force I will be using tabulated drag coefficient data that is a function of Mach number. The duration of the trajectory is not known in advance and the trajectory will end when the projectile reaches the ground (zero altitude). I've taken a look at the MatLab help guide and seen there's a 4th-order Runge-Kutta method but I cannot see how t...

Hi, I'm trying to solve the second order differential equation that governs the motion of m2 relative to m1. The equation is as follow: Rvec_double_dot = -(mu/r^3)*Rvec where mu and r are contants. Rvec is the position vector. Rvec = x_i + y_j + z_k and the velocity vector is: x1_i + y2_j + z2_k I understand that if R and V is in one direction (ie. only involve x and not y & z) I can use ode45 to solve it... but how would I solve it if Rvec is a postion vector? please help. Thanks "Dai Dinh Dinh" <daidinh07@gmail.com> wrote in message <gpg586$33f$1@fred.mathw...

Guys, this is my first post! My question is why do i get slightly different results when computing differential equations using matlab or simulink. Here is my equation. 2nd derivative v * 1st derivative v * v I am using 4th order Runge Kutta in both with fixed time step of 0.5. Qualitatively they are almost identical but not quite. Surely they should be the same. Am I doing something wrong. function [dxy] = diffxy(t, xy) x1 = xy(1); xdot1 = xy(2); xdot1 = xdot1; xdoubledot1 = - xdot1 - x1; dxy = [xdot1; xdoubledot1]; Guys ignore this, have tried with other solvers, A OK....

I am trying to run a simulink model simulation in definite time steps from MATLAB so that I can extract data from simulink, do some caluclations and send these new data back to Simulink for further simulation from the point I left off. The process can be descirbed below: Note that total simulation time is 600 seconds. 1. Start simulation from MATLAB for 100 seconds and then pause the simulation 2. Extract all the data I need from simulink and bring into MATLAB, do some calculations to changes simulink model parameters and then pass this new calculated data back to simulink. 3. Continue the simulation where I left off (i.e. from 100 seconds) but this time in 15 second intervals, up to total simulation time end (repeating step 2 and 3 after every 15 seconds). Can someone please advise if they have done this before and what command structures they used. Thank you. True. You can "sim" to achieve this. Try "help sim" to learn details. Yi "High Voltage" <e8342lec@yahoo.com> wrote in message <gt61tq$657$1@fred.mathworks.com>... > I am trying to run a simulink model simulation in definite time steps from MATLAB so that I can extract data from simulink, do some caluclations and send these new data back to Simulink for further simulation from the point I left off. > > The process can be descirbed below: > > Note that total simulation time is 600 seconds. > > 1. Start simulation from MATLAB for 100 seconds and...

Dear all, I had a source code, which was doing matrix integral computation using "int". I had to modify it in order to use "long long". The problem is that "int" was used both for matrix indices and for matrix element. In the version I modified I want to use "long long" for matrix element and "int" for matrix indices. How to be sure that I did not forget anything. "gcc -Wall" accept without difficulties "long long * long" when I would like him to ask for an explicit cast. Could there exist a static source analyzer that de...

I'm using MATLAB R13. I have a nonlinear equation, with a cubic nonlinearity of the form 2 d x(t) 3 ------ + C(1)*x(t) - C(2)*x(t) = F(t) 2 dt I know how to convert linear equations to state space with no problem. However, I'm having a hard time with nonliner equations. In my search in the MATLAB help I only found linmod, dlinmod, and linmod2. DOes this mean that I need to put my equation in Simulink forst or is there another way to obtain A, B, C, and D for state space? I would appreciate any help. Patrick Roberts Georgia Institute of Te...

Hello, I have a model developed using Simulink which is representing an electromechanical system. I need to perform automated parameter estimation (therfore cannot use Simulink optimisation tool) on this model which I can only do in MATLAB. Is there anyway to convert a simulink model to a set of equations in MATLAB?? I know you can generate a text file of a model (then save as m-file) but this contains 1000s of line of useless positional information, branch positions, block names, and is not in a form that can be directly used. Any help would be much appreciated. Cheers. "Will "...

Hi, I am working with a dspace realtime card and use simulink to develop the application. Unfortunately the PC I am working on is not so young anymore. (can't upgrade since the dspace card is ISA). So, when I include "a lot" of data (e.g. a 4000 element array) in one of the simulink blocks as a parameter, e.g. the lookup table, my compile time goes up with 10 to 15 minutes!! Personally, I don't think that's very normal. So I wrote an S-function in C and included all my data there (statically declared in mdlOutputs). Bottom-line: it worked and my compile time did _not_ g...

Hi everyone, As you know Simulink is capbale of solvinf second order differential equations numerically. As an example, x"=f(x,x') can be solved by drawing block diagrams which relates x and x' to x". Then, we can solve them. I have a bunch of ODE which are very lenghty and making blocks takes a lot of time (almost impossible) because of the huge expressions I have. Do you know any way to convert equations in Matlab to 'Simulink Blocks' using for example S-Functions? I mean can S-function convert the equations to block? How? I highly appreciate your response. Hi ...

Hi everyone, As you know Simulink is capbale of solvinf second order differential equations numerically. As an example, x"=f(x,x') can be solved by drawing block diagrams which relates x and x' to x". Then, we can solve them. I have a bunch of ODE which are very lenghty and making blocks takes a lot of time (almost impossible) because of the huge expressions I have. Do you know any way to convert equations in Matlab to 'Simulink Blocks' using for example S-Functions? I mean can S-function convert the equations to block? How? I highly appreciate your...

Hi everyone, As you know Simulink is capbale of solvinf second order differential equations numerically. As an example, x"=f(x,x') can be solved by drawing block diagrams which relates x and x' to x". Then, we can solve them. I have a bunch of ODE which are very lenghty and making blocks takes a lot of time (almost impossible) because of the huge expressions I have. Do you know any way to convert equations in Matlab to 'Simulink Blocks' using for example S-Functions? I mean can S-function convert the equations to block? How? I highly appreciate your...

Hi everyone, As you know Simulink is capbale of solvinf second order differential equations numerically. As an example, x"=f(x,x') can be solved by drawing block diagrams which relates x and x' to x". Then, we can solve them. I have a bunch of ODE which are very lenghty and making blocks takes a lot of time (almost impossible) because of the huge expressions I have. Do you know any way to convert equations in Matlab to 'Simulink Blocks' using for example S-Functions? I mean can S-function convert the equations to block? How? I highly appreciate your...

Hello. I have a multi-domain simulation developed visually using SimMechanics, SimPowerSystems, Stateflow (2007b), etc. Is it possible for Matlab/Simulinks to generate the corresponding differential equations or dynamical systems models automatically? Thanks. ...

Hi I want to know how I can plot some equation like this equation like this: x^3+ zyx^2+z^2yx+y^2xz+xyz+y^3+z^3=0 By and large how I can plot equation without parametrization in matlab. Thanks. "F.Vesali" <farshad.vesaly@gmail.com> wrote in message <ad978129-7f90-4685-b8d9-dc536dc63a31@r24g2000yqd.googlegroups.com>... > Hi > I want to know how I can plot some equation like this equation like > this: > x^3+ zyx^2+z^2yx+y^2xz+xyz+y^3+z^3=0 > By and large how I can plot equation without parametrization in > matlab. > Thanks. a hint: help ezplot; ...

how to solve "simultaneous" DE using MATLAB simulink...and obtain the corresponding equation from the graph(scope).... ...

i was going to attempt using lqr controller. but i have a slight problem. i dont know how to convert state equations into state space. i was wondering if anyone here would just point me in the right direction pls. urgent. thank you. just one simple example would be nice. Tapan Say the equation of motion is y(t)''+ay(t)'+by(t)=u(t) where y(t) is the output and u(t) is the input. Then define: x1=y x2=y' then we can rewrite the dynamic equation as two separate equations involving only the "state variables" x1 and x2. x1'=x2 x2'=-ax2-bx2+u putting this i...

I have a system of equations contains one one-dimensional pde and three ode. Can it be solved by the 'pdepe' solver? If it can,how do I treat the boundary function of odes? ...

Hi I am having difficulties matlab programming the 2D wave equation( Helmholtz equation) expressed in terms of greens function (the boundary element integral formulation). Anyone who can give me feedback will be of great help as it is my thesis project. Vasishta, Normally I would not respond to the write my thesis posts - but I am doing something similar - and found the Student Version lacking - you need to buy the Partial Differential Equation toolbox. http://www.mathworks.com/products/pde/ ...

I've always had a problem knowing exactly how wide my integer variables were in C, and the little program below has increased my confusion. Run on 3 compilers on the same cpu (32-bit pentium), sometimes int and long int are the same, and long long int is twice the width; or sometimes both long int and long long int are twice the width of int. This apparently all quite normal according to my c99 draft and c-faq.com. However it doesn't alter the fact that this is all very 'woolly' and ambiguous. Integer widths that obey the rule short < int < long int <long long int ...

Hi, I have a bunch of equations with matrices in an eqnarray environment and one of them is too long so that the end of the matrix is written on top of the equation number (the second one si the one that poses a problem): \begin{eqnarray} C_{0,aug} & = & \left[ \begin{array}{cccc|c} 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ \hline 0 & 0 & 0 & 0 & C_0 \end{array} \right] \\ C_0 & = & \left[ \scriptstyle \begin{array}{cccccccccccccc} 1 & 0 & 0 &am...

For those of you who use, or have access to both products, I would be interested in opinions on which is "better." That is, how do you decide, for your projects, whether to implment a model in Matlab, Simulink, Simulink-calling-S-Functions-written-in-M, or any other option. My background includes object-oriented design and programming (prefer C ++), so I'd also be interested in your views on the object-oriented support in Matlab and Simulink, and whether that support plays at all into your decision of which product(s) to use. In the field I am investigating (mostly linear syst...

Is there a problem in lcc-win32 with long long and the "<=" operator? I compiled an older program using the integer type long long and got a wrong result: Below a short testprogram to reproduce the error. I would assume to get the result 21 in 0..42 but I get 21 NOT in 0..42. Did I something wrong? O:\Sources\test2>type test2.c #include <stdio.h> int main(void) { long long lTmp = 21; if ( 0 <= lTmp && lTmp <= 42 ) printf("%lld in 0..42\n",lTmp); else printf("%lld NOT in 0..42\n",lTmp); } O:\Sources\...

hi everyone, My question is that does in Simulink, the equations of motion block(6DOF euler) under aerospace blockset, work in realtime? thanks, arda ...

In mathematics , an equation is a formula of the form A = B , where A and B are expressions that may contain one or several variables called ...

Research investigated the conventional wisdom that happier people lived longer, and found there was much more to the story.

... Grimes decided to try to create a mathematical measure for just how stupidly implausible that idea is—a sort of conspiracy probability equation. ...

Looking at @FoxNews @BillKristol & @WSJ takes on Biden non-run, gotta wonder: Was it all an elaborate practical joke at GOP media's expense? ...

... has been for some time. But what is community? Community, from the perspective of marketing and especially social media marketing, is an equation: ...

It's common knowledge that women are underrepresented in STEM careers. What's less clear is what businesses can do to better attract and retain ...

Just in time for St. Patty's, mathematicians from Ireland figure out how to put a better, cheaper head on your Guinness.

Australian design brand Page Thirty Three has released homeware collection Tactile Equations, which requires owners to 'complete' objects themselves ...

Next time you dine out at a restaurant that serves a free breadbasket, watch the people around you. You’ll see some of your fellow diners eye ...

It's not news that the digitally-empowered customer is changing our world. What is news is (1) the pace needed to catch-up to an extremely dynamic ...

Resources last updated: 3/5/2016 9:08:54 PM