cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

System of ODE and Minerr data fit optimization

amusiienko
6-Contributor

System of ODE and Minerr data fit optimization

Hello, everyone. I wrote a simple program that solves 5 differential equations. Further, I fit experimental data with MINERR. 

 

It works but it works very slow.  Does anyone know how to do it a bit faster?

 

Thank you in advance! Program is attached

amusiienko_0-1609098421368.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

I notice that your odesolve-block returns 8 functions, but in your minerr-solve block you assign the result to a vector with just seven variables. Thats sure possible - are you sure you don't need p022.

I can't check your sheet because I always get the error message that Excel is busy, can't be activated and I shall try in a few seconds again.

I have Excel 2016 installed and I see in the task manager that its invoked. Not sure whats going on.

 

View solution in original post

7 REPLIES 7

Your minerr-solveblock calls the odesolve-solve block (function F) six times for every iteration, which is quite inefficient.

The modification seen in the pic below should speed up the calculation by the factor 6.

Werner_E_0-1609123148079.png

I turned the solve block into a function just to be able to determine and compare the execution time of both versions.

I just finished timing the two versions and the speed gain with my suggested modification is indeed a little bit more than factor 6.

Werner_E_0-1609124642976.png

P6 sheet (with auto-calc disabled) attached

 

amusiienko
6-Contributor
(To:Werner_E)

Oh, interesting you have called function in vector format. That is interesting.

amusiienko
6-Contributor
(To:Werner_E)

Thank you Werner_E. Your insight is very useful as always. 

amusiienko
6-Contributor
(To:Werner_E)

Hi Werner,

After I applied your solution to my main program. It still works slow. 

I do not really see why. Maybe you could find it.

 

Thank you in advance!.

I notice that your odesolve-block returns 8 functions, but in your minerr-solve block you assign the result to a vector with just seven variables. Thats sure possible - are you sure you don't need p022.

I can't check your sheet because I always get the error message that Excel is busy, can't be activated and I shall try in a few seconds again.

I have Excel 2016 installed and I see in the task manager that its invoked. Not sure whats going on.

 

amusiienko
6-Contributor
(To:Werner_E)

I added p022 "just in case" to use in the future. But seem it is critical for minerr function. After I deleted unused p022 it works much faster.

Thank again Werner.

You saved my day again!

Top Tags