Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hello ,
I would like to know if there is a way to make the calculation faster in my worksheet.
The most probable cause of slow calculation is the large determinant constraint in the solve block because it contains a very ugly integral in each element with a nonlinearity up to power 11
The for loop is just updating the initial value for the solve block each time with the previous solution it shouldnt be the reason why it calculates agonizingly slow
If you are interested and would like to know what i am exactly doing with this calculation i can explain. Maybe i can help you to produce some solution for my actual problem.
PS : the deteminant is actually Jacobian matrice of the system , i am searching solutions for where Jacobian of the system is singular.
Without looking at your sheet (because I would be completely at sea!) I would like to point out that Mathcad 15 has a Jacobian function. . .
In addition to Fred's comment, I think you can replace many of your integrals with symbolic solutions, which
could possible save a lot of time.
Oh i think symbolical solution is not possible for the n-power part , because it contains a fourier series
(a1.sinwt + b1.coswt + a2.sin2wt + b2.cos2wt + a3.sin3wt + b3.cos3wt)^n
and n=11 here
a's and b's are unknowns of the systems.
Ali,
Sorry, didn't see the ()^n.
Don't know if it will help do symbolic solution for part of the integral or not.
I think it might but binomial expansion of 11th power of that expression must very very long. It is not practical.
If there is no way to make this faster , i have to give up on MATHCAD.
I tried different solving techniques Quasi-Newton , Conjugate Gradient but it didnt make it better.
How ugly the integral looks doesn't matter, but yes, it's part of the problem. The integral is solved teratively, so you can think of it as a loop. The derivatives are also solved iteratively, so they are another loop. When the derivative is solved, the integral has to be solved multiple times: once for each iteration of the derivative calculation. Then the derivatives are in the solver, which is another loop. Finally, you put the solver in a program loop. So you have a loop within a loop within a loop within a loop.
so i guess the problem is coming from definition of the problem
is it unavoidable?
is it unavoidable?
I couldn't see a way to avoid it. If I could, I would have suggested it.
loop 2 loop 2 loop
Mike
I got rid of the derivatives in the jacobian , i defined every element manually
But i still have the integrals which i cant symbolically calculate and put there manually
Let's see if it will make it faster or not
That's a good move. The best thing would be to remove the innermost loop, but since that's not possible the next level up is the best option available.
It is relatively O.K now 😃
better than nothing