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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Faster Solve Block Solution

AliErbay
1-Newbie

Faster Solve Block Solution

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.

12 REPLIES 12

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. . .

wayne
3-Visitor
(To:AliErbay)

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.

tmp.gif

AliErbay
1-Newbie
(To:wayne)

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.

wayne
3-Visitor
(To:AliErbay)

Ali,

Sorry, didn't see the ()^n.

Don't know if it will help do symbolic solution for part of the integral or not.

AliErbay
1-Newbie
(To:wayne)

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.

RichardJ
19-Tanzanite
(To:AliErbay)

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?

RichardJ
19-Tanzanite
(To:AliErbay)

is it unavoidable?

I couldn't see a way to avoid it. If I could, I would have suggested it.

MikeArmstrong
5-Regular Member
(To:RichardJ)

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

RichardJ
19-Tanzanite
(To:AliErbay)

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

Top Tags