Quantcast
Channel: PTC Community: Message List
Viewing all articles
Browse latest Browse all 12488

Re: Is there method fastly to solve about "condition" ?

$
0
0

In case you are interested why the intergral took so long:

Thanks to your heavily nested functions the calculation of a single value of t() requires evaluationg the solve block(s) for ar resp. a'r 15 time !! Thats quite inefficient!

But it comes better. For the function th() you try to integrate those solveblocks are called 17*15=255 times just to calculate one single value. Thats more than inefficient - thats a total waste of ressources.

So the cause for the desaster is not the use of the if statements.

You would have to design all of your functions completely different and more efficient. For instance your CL() should have only alpha as argument and should not csall alpha.r. If you use sin(Phi) and cos(Phi) in one expression, you should calculate Phi only once, store it in a temporary variable and use this, E.g. a simple call to alpha.r evaluates the solve blocks four times as it is written now,

A lot of work to be done.


Viewing all articles
Browse latest Browse all 12488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>