Function and for loop

Function and for loop - Сообщения

#1 Опубликовано: 05.11.2019 12:52:13
hanskl

hanskl

7 сообщений из 158 понравились пользователям.

Группа: User

Hi guys.

I have come across an obstacle that I have not managed to find a satisfactory solution to. I am sure the problem is easy for the experts here, but the solution completely eludes me.

I want to make a function to plot bending moments caused by an eccentric load.

My aim is to make an equation/function that can plot a continuous bending moment diagram, while being able to scale how many loads is acting on the member.

Thank you for your time.

Best regards,
Hans Kristian.

snip.PNG

test.sm (106 КиБ) скачан 34 раз(а).

#2 Опубликовано: 05.11.2019 16:43:53
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Do you mean a function that will represent M(x)... up to 100 ?
Certainly from selecting representative support points !

Plot.PNG

test (3).sm (108 КиБ) скачан 31 раз(а).
#3 Опубликовано: 05.11.2019 17:14:42
hanskl

hanskl

7 сообщений из 158 понравились пользователям.

Группа: User

Wrote

Do you mean a function that will represent M(x)... up to 100 ?
Certainly from selecting representative support points !

Plot.PNG

test (3).sm (108 КиБ) скачан 31 раз(а).



Hi Jean,

I want a function that will represent M(x) where the eccentric load P will be divided into n equal loads which are spaced out evenly along the length of the member.

Does that make sense?
#4 Опубликовано: 05.11.2019 18:33:47
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

saw.sm (7 КиБ) скачан 26 раз(а).
saw.png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#5 Опубликовано: 05.11.2019 18:42:15
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Hi Jean,

I want a function that will represent M(x) where the eccentric load P will be divided into n equal loads which are spaced out evenly along the length of the member.


I guess it makes sense, that stuff is not my cup of tea.
You mean the 100 lines is typical of eccentric load model but
each one will be of different parameters [your conditions] ???
Big project in view Captain !
We have a utility that divides a range in N equal spaces>
That will make some lines longer/shorter as per the how those
loads appear on the beam.
Do you have some material from else source ?

#6 Опубликовано: 05.11.2019 18:47:15
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Now with proper scaling

saw1.png
saw1.sm (5 КиБ) скачан 37 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#7 Опубликовано: 05.11.2019 18:57:54
hanskl

hanskl

7 сообщений из 158 понравились пользователям.

Группа: User

Wrote

Wrote

Hi Jean,

I want a function that will represent M(x) where the eccentric load P will be divided into n equal loads which are spaced out evenly along the length of the member.


I guess it makes sense, that stuff is not my cup of tea.
You mean the 100 lines is typical of eccentric load model but
each one will be of different parameters [your conditions] ???
Big project in view Captain !
We have a utility that divides a range in N equal spaces>
That will make some lines longer/shorter as per the how those
loads appear on the beam.
Do you have some material from else source ?



The application for this sheet is going to be on sandwich concrete wall panels where the weight of the exterior non-bearing layer of concrete acts on the interior bearing layer. The actions to consider are N and M.

In practical application, N will be split into 2-4 equal loads, but I wanted to make a framework that could split the load into n parts, just for fun.. :d
#8 Опубликовано: 05.11.2019 19:02:01
hanskl

hanskl

7 сообщений из 158 понравились пользователям.

Группа: User

Wrote

Now with proper scaling

saw1.png
saw1.sm (5 КиБ) скачан 37 раз(а).



Thank you Martin, this is exactly what I am looking for!

Although your expression is both much simpler and much faster to compute, it does not look anything like what I had in mind.. Goes to show I have so much more to learn when it comes to SMath!

Cheers!
#9 Опубликовано: 05.11.2019 21:47:57
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Wrote

Now with proper scaling



Just for show why the Martin solution it's correct:

int.gif

Best regards.
Alvaro.
#10 Опубликовано: 05.11.2019 22:39:50
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote


Thank you Martin, this is exactly what I am looking for!

Although your expression is both much simpler and much faster to compute, it does not look anything like what I had in mind.. Goes to show I have so much more to learn when it comes to SMath!

Cheers!



The approach was purely phenomenological, i.e. to reproduce the plots, no matter what they mean. The idea was to combine a sawtooth function and a linear term (slope). There are many options to get a sawtooth, the modulo function being just one of them. Others are round(), Floor(), Ceil()... The remainder was guessing the coefficients in a heuristic trial and error fashion.

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#11 Опубликовано: 05.11.2019 23:03:41
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Although your expression is both much simpler and much faster to compute, it does not look anything like what I had in mind..


That great scaled saw tooth plots on the canvas wrt 'x'.
You then have to subdivide 'x' to imitate your first document.
The attached utilities are general rather than specific to
your project. You can fabricate whatever for purpose.
Stay in love with Smath ... don't hesitate for +.
Cheers ... Jean

Utilities Discrete Algo Range INTERVALS.sm (29 КиБ) скачан 41 раз(а).
Utilities Discrete Algo Range INTERVALS Application.sm (29 КиБ) скачан 36 раз(а).
Utilities Discrete Algo Range INTERVALS Parts 1234.sm (84 КиБ) скачан 44 раз(а).

#12 Опубликовано: 06.11.2019 06:50:02
hanskl

hanskl

7 сообщений из 158 понравились пользователям.

Группа: User

Wrote

Wrote

Now with proper scaling



Just for show why the Martin solution it's correct:

Best regards.
Alvaro.



Interessting. I have tweaked Martins equations - now n represents the number of loads, not the number of segments between loads/supports.

Any idea why the integral gives me this result? Also, my integral is 10x the value of yours.

Best regards,

Skjermbilde.PNG
#13 Опубликовано: 06.11.2019 06:51:22
hanskl

hanskl

7 сообщений из 158 понравились пользователям.

Группа: User

Wrote

Wrote

Although your expression is both much simpler and much faster to compute, it does not look anything like what I had in mind..


That great scaled saw tooth plots on the canvas wrt 'x'.
You then have to subdivide 'x' to imitate your first document.
The attached utilities are general rather than specific to
your project. You can fabricate whatever for purpose.
Stay in love with Smath ... don't hesitate for +.
Cheers ... Jean

Utilities Discrete Algo Range INTERVALS.sm (29 КиБ) скачан 41 раз(а).
Utilities Discrete Algo Range INTERVALS Application.sm (29 КиБ) скачан 36 раз(а).
Utilities Discrete Algo Range INTERVALS Parts 1234.sm (84 КиБ) скачан 44 раз(а).



Interesting stuff.. I will have a closer look at that when I have some spare time.

Cheers :d
#14 Опубликовано: 06.11.2019 06:53:18
hanskl

hanskl

7 сообщений из 158 понравились пользователям.

Группа: User

Wrote

Wrote


Thank you Martin, this is exactly what I am looking for!

Although your expression is both much simpler and much faster to compute, it does not look anything like what I had in mind.. Goes to show I have so much more to learn when it comes to SMath!

Cheers!



The approach was purely phenomenological, i.e. to reproduce the plots, no matter what they mean. The idea was to combine a sawtooth function and a linear term (slope). There are many options to get a sawtooth, the modulo function being just one of them. Others are round(), Floor(), Ceil()... The remainder was guessing the coefficients in a heuristic trial and error fashion.



I thought that might be the case.. Anyways, it was purely to illustrate what happens when n approaches infinity, and your solution worked wonders for that!

Thanks again
#15 Опубликовано: 06.11.2019 10:56:55
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Any idea why the integral gives me this result?


Smath native Simpson integrator ranges from:
1. Exact only few trivial cases.
2. Acceptable but depending upon Options/Calculations/Int. acc
set 1000 in your example.
3. Native Simpson may be TOTALLY useless.
Sooner or later, units system collide in the wall.

Discontinuous integration is poison in the soup.
Master tool box has done all difficult projects
except ONE ... The Inverse_Z transform.

Cheers ... Jean

Integrate Discontinuous [min(x)].sm (8 КиБ) скачан 34 раз(а).
Integrate Discontinuous_1.sm (24 КиБ) скачан 32 раз(а).
Integrate Discontinuous.sm (31 КиБ) скачан 29 раз(а).
Integrate Discontinuous_2.sm (132 КиБ) скачан 35 раз(а).
Integral 00000000 MASTER ToolBox.sm (476 КиБ) скачан 39 раз(а).
#16 Опубликовано: 06.11.2019 17:50:35
hanskl

hanskl

7 сообщений из 158 понравились пользователям.

Группа: User

Wrote

Wrote

Any idea why the integral gives me this result?


Smath native Simpson integrator ranges from:
1. Exact only few trivial cases.
2. Acceptable but depending upon Options/Calculations/Int. acc
set 1000 in your example.
3. Native Simpson may be TOTALLY useless.
Sooner or later, units system collide in the wall.

Discontinuous integration is poison in the soup.
Master tool box has done all difficult projects
except ONE ... The Inverse_Z transform.

Cheers ... Jean



Thanks again Jean.. I am baffled by the knowledge you guys possess here on the forum!

Best regards,
Hans Kristian.
#17 Опубликовано: 06.11.2019 20:32:03
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Thanks again Jean.. I am baffled by the knowledge you guys possess here on the forum!


At least, two of us are old kookoo from Mathcad.
Smath learning curve has not revealed asymptotic.
Two versions of the 3D rolling Torus.

Rotate Torus [Ber7 20170922].sm (20 КиБ) скачан 34 раз(а).
Rotate Torus.sm (44 КиБ) скачан 28 раз(а).

#18 Опубликовано: 07.11.2019 06:01:13
hanskl

hanskl

7 сообщений из 158 понравились пользователям.

Группа: User

Wrote

Wrote

Thanks again Jean.. I am baffled by the knowledge you guys possess here on the forum!


At least, two of us are old kookoo from Mathcad.
Smath learning curve has not revealed asymptotic.
Two versions of the 3D rolling Torus.



It took my computer about 3 minutes to compute this sheet..
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений