teh_allchemist

50 Reputation

6 Badges

11 years, 309 days

MaplePrimes Activity


These are questions asked by teh_allchemist

Hi MaplePrimers!

I have a simulation in MapleSIM, exported as a compiled procedure in maple using -LinkModel(), and -GetCompiledProc.

I'm trying to do parameter estimation on my MapleSIM model.  Within a optimization scheme, I call the MapleSIM model, and it will output a curve.  Using a least squares method, I compare this measurements to synthetic experimental data (I know the actual values), and generate an objective function.  The optimization algorithm will try different parameter values, and try to minimze the objective function.  When the curves are exactly the same, the objective function will be zero.

The problem I am having is certain parameter sets will cause the model to require very small steps.  I wish to put a timeout on these experiments, because speed is important.  However, I would also like to see the results up to the point of requiring very small steps.  For timeout, I was using code along the lines of:

out:= timelimit(30,cProc(params = PData)); #simulate with 30s limit

where PData are the parameter guessses, and cProc is the compiled MapleSim model.

I would like 'out' to be assigned whatever the results were after 30 seconds, even if the model had not finished integrating.

 

Thanks in advance for any help!

Hi MaplePrimers,

I'm trying to solve a system of algebraic equations using 'solve' [float].  I'd prefer to use 'solve' over 'fsolve', as 'solve' solves my system in about 0.05s, whereas fsolve takes about 5 seconds.  I need to solve the system repeatedly at a different points, so time is important.  I don't know why there is such a large difference in time ... 

I have a few piecewise functions of order 3 to 5.  It solves fine with the other (piecewise) equations, but adding one piecewise function which gives me an error while trying to solve:

Error, (in RootOf) _Z occurs but is not the dependent variable.

I think this is due to solve finding multiple solutions.  Is there a way to limit solve to only real solutions?

Thanks in advance!

Hi Everybody,

I'm having some problems simulating an algebraic system in Maple.  I want to do this for a larger system of equation (~20 equations/20 variables, with 3 inputs), but I'd like to get an idea of the form this should be in.

So, using an example out of Maple help:

with(DynamicSystems);

sys1:=AlgEquation([y=sin(x)],[x],[y],discrete=true,sampletime=0.001);

inp1:=Vector[column]([1,2,3,4,5,6,7]) * 0.1;

res:=Simulate(sys1,[inp1]);

Error, (in DynamicSystems:-Simulate) should never be here

 

I don't understand what this error means.  Reading the example in the help files, says the second argument should be a vector of input values.  What I would assume this would do is plugin x = 0.1, then solve y=sin(0.1), and output y.

Am I missing some syntax, or is my inputs wrong?  There are examples of how to set up an algebraic system in the help files, but no examples of how to simulate them.

 

Thanks in advance for any help!

 

 

 

 

Hi,

I've been trying to manipulate the equations of a mechanism that I've exported from MapleSIM.  The system equations contain 4 differential ordinary equations, and 6 algebraic equations.  In MapleSIM it simulates fine, but I'm having problems simulating it in maple alone (without multibody exports).

I've tried solving the initial value problem by replacing all the time dependant variables with constants, (and as this is a dynamics problem) I supplied...

1 2 3 Page 3 of 3