ad

40 Reputation

2 Badges

16 years, 118 days

MaplePrimes Activity


These are answers submitted by ad

I get this problem all the time as a result of working with MapleSim Multibody models.

It seems like the problem is a result of entering terms into the inertia matrix of mass components without ideal formatting (though Maple doesn't seem to mind evaluating these expressions, only codegeneration...)

i.e. M2(r1+r2) will cause the above error in CodeGeneration but M2*(r1+r2) won't.

Seems obvious but isn't really as Maple can usually deal with the missing '*'...

Just posting for anyone else who is arriving at this thread for the same reasons as me.

Hey,

The 'Map' precursor does the job. Both suggestions work (I'm using Maple 12 btw), though [map(CodeGeneration[Matlab],J)]; creates an interesting matrix full of Null elements, no problem though, this still solves my problem. Am I right in assuming that 'map' should be used in the case of Code Generating from matricies and vectors?

Robert, the Xx input was originally determined from a bunch of Matrix Multiplications. The equation evaluates in J fine symbolically (I can view the output) providing Code Generation isn't used. I found that a copy and paste of the output of J into the brackets of CodeGeneration() works (but of course is a rather laborious process that doesn't lend iteself well to changing Xx).

Thanks guys,

Ad

 

Thanks alot guys that has certainly fixed it. I'm very new to Maple and didn't realise that those commands were outdated and case sensitive.

Thanks again.

Ad

Page 1 of 1