Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Long computation using symbolic variables, help with matlabFunction?

Subject: Long computation using symbolic variables, help with matlabFunction?

From: Jan

Date: 7 Jun, 2014 15:14:09

Message: 1 of 1

Hello,

I am working on description of robotic arm. It is composed of six serial transformations - result of previous transformation is one of inputs of the next transformation. And every transformation is composed of few "subtransformations". The problem is, that creation of last tranformation is extremely slow. It took more than one half of a day and it still was not finished. I have to use 33 symbolic variables and the final equations are really complex. I have already found out, that I can rapidly decrease computing time (I used this in case, which was not so complex) by substituting inputs dependent on previous result by some general vector and than use "subs" to create final expression (see exapmle). But in this case, I have got so complex expressions, that either with this help computing simply takes too long.
I have already found out, that I can create function handle via matlabFunction and accelerate substitution of numbers, but is there any way of making the process of creating the "general expression" faster, please?

Example
Suppose I am interested in final vector R2 (dim 3), but following sequence takes too long

R0=transformation(a1,a2,a3...,initial vector);
R1=transformation(b1,b2,b3....,R0);
R2=transformation(c1,c2,c3....,R1);

So i used something like

R0=transformation(a1,a2,a3...,initial vector);
R1=transformation(b1,b2,b3....,S);
R2=transformation(c1,c2,c3....,R1);

R2=subs(R2,S,R0)

what increased the speed of the code.

(But now I have got six transformations and subs does not help a lot, do you know, how implement matlabFunction into this example? And would it be useful?)

Thank you very much!

Jan

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us