user2983967
user2983967

Reputation:

Trying to solve over 1000 different equations as fast as possible

I have a chunk of code which uses symbolic variables to solve various different equations. Currently I'm using a loop from say 1: 1000+, so that at each point it selects the right equation (depending on various if statements), and with the right constants. Since only one equation is selected, it will naturally solve it very easily. However, since there are 1000 iterations this process will take up to 30 mins (no surprise there since its a loop). This was bearable until I had to investigate the effects of the number of iterations, which means using this code for different lengths (1 to 10,000).... resulting in a horrendously slow process.

Most loops can be vectorised. However, is there a way of solving multiple equations stored in an array very quickly? Please bear in mind these are not simultaneous equations! The one variable that needs to be determined each time, is not dependent on the other equations.

Thanks for the help in advance!

D

I've Solved it. -thanks

Upvotes: 0

Views: 327

Answers (1)

NPE
NPE

Reputation: 500177

The description of the problem is rather vague. However, it sounds like the problem is embarrassingly parallel. It should therefore be easy to use multiple cores to process several equations at the same time, speeding things up.

How you do that depends on your computing environment (about which you haven't told us anything at all).

Upvotes: 1

Related Questions