Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Skanda  
#1 Posted : 08 March 2024 18:59:05(UTC)
Skanda

Rank: Newbie

Groups: Registered
Joined: 10/02/2024(UTC)
Posts: 4
Italy
Location: Genova

Hi everyone,

I need your valuable support to solve a non linear problem.
I tried the functions solve, roots, Findroot, al_nleqsolve, bisection but I obtained only errors.
I red a lot of topic and tried different approach but without result.

I extracted a part of the entire file. The procedure goal is to evaluate the moment Vs curvature diagram in a reinforced concrete section. The section is discretized in fibers (10x10 in the examples).
In the attached file you will find one iteration (a fixed value of curvature) where the non linear solver have to find the position of neutral axis (x) that lead to the equilibrium of the section (between compression and tension forces).

I also tried (in another file) to avoid units but the result was always the same.

Thank in advance to anyone who can dedicate some time to my problem

Lorenzo




RC_forum_nonlinear.sm (83kb) downloaded 12 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline StvMath  
#2 Posted : 09 March 2024 05:19:33(UTC)
StvMath


Rank: Advanced Member

Groups: Registered
Joined: 26/07/2022(UTC)
Posts: 35
United Kingdom
Location: UK

Was thanked: 22 time(s) in 19 post(s)
Here's a transparent, home grown bisection routine that does the job:

RC.png

RC_forum_nonlinear_b.sm (80kb) downloaded 10 time(s).
Offline Skanda  
#3 Posted : 09 March 2024 19:48:11(UTC)
Skanda

Rank: Newbie

Groups: Registered
Joined: 10/02/2024(UTC)
Posts: 4
Italy
Location: Genova

Many thanks for the quick solution.
I'll include the code in the inner loop of the procedure.

Lorenzo
Offline StvMath  
#4 Posted : 09 March 2024 23:28:55(UTC)
StvMath


Rank: Advanced Member

Groups: Registered
Joined: 26/07/2022(UTC)
Posts: 35
United Kingdom
Location: UK

Was thanked: 22 time(s) in 19 post(s)
Just noticed that, strictly, my bisection routine should be as follows:

Bisection.png

Offline Skanda  
#5 Posted : 10 March 2024 05:40:43(UTC)
Skanda

Rank: Newbie

Groups: Registered
Joined: 10/02/2024(UTC)
Posts: 4
Italy
Location: Genova

Thanks. Yes I've already correct the code.
My initial question was about the possibility to use built-in function, as it normally takes less time.
If there isn't this possibility, no problem. I can write alternative solution method.
I've implemented the quasi-Newton method (Broyden method - starting from Davide Carpi) to evaluate the best strategy regarding time and number of iterations.

Advice is always welcome.

Regards,

Lorenzo
Offline StvMath  
#6 Posted : 10 March 2024 23:32:48(UTC)
StvMath


Rank: Advanced Member

Groups: Registered
Joined: 26/07/2022(UTC)
Posts: 35
United Kingdom
Location: UK

Was thanked: 22 time(s) in 19 post(s)
Originally Posted by: Skanda Go to Quoted Post
Thanks. Yes I've already correct the code.
My initial question was about the possibility to use built-in function, as it normally takes less time.

Regards,

Lorenzo



It isn't the bisection routine that's slowing the calculation; it's your melprod routine. Try the following instead:

melprod.png
Offline Skanda  
#7 Posted : 11 March 2024 10:32:55(UTC)
Skanda

Rank: Newbie

Groups: Registered
Joined: 10/02/2024(UTC)
Posts: 4
Italy
Location: Genova

Thank you! With your improvement the speed is significantly increased
Wonderful
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.