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 Xiu12  
#1 Posted : 20 September 2019 21:34:48(UTC)
Xiu12

Rank: Newbie

Groups: Registered
Joined: 20/09/2019(UTC)
Posts: 3

Hi,

I'm trying to write a function that I can use to calculate the surface area. The function is to be based on data from a matrix with n elements
I ran out of ideas. I guess the problem is in a loop.
I attach a file and an image.
I will be grateful for your help.

AA.PNG

BB.PNG

Integral.sm (8kb) downloaded 10 time(s).

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

Offline alyles  
#2 Posted : 20 September 2019 23:22:30(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 275
United States

Was thanked: 91 time(s) in 57 post(s)
You can define piecewise function this way. Haven't figured out integration yet. Built in int() function doesn't seem to work.
Untitled.png
Piecewise Function.sm (7kb) downloaded 15 time(s).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline Jean Giraud  
#3 Posted : 21 September 2019 01:56:29(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Xiu12 Go to Quoted Post
I'm trying to write a function that I can use to calculate the surface area. The function is to be based on data from a matrix with n elements
I ran out of ideas. I guess the problem is in a loop.
I attach a file and an image.
I will be grateful for your help.


That was lavishly exemplified few hours ago.
Your drawing needs some project intention about,
i.e: what is what for what.
Offline Jean Giraud  
#4 Posted : 21 September 2019 02:15:38(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: alyles Go to Quoted Post
You can define piecewise function this way. Haven't figured out integration yet. Built in int() function doesn't seem to work.

Latest version is all white. Could discover the blank regions,
framed the regions, added background.

Nothing2see.PNG
Offline Jean Giraud  
#5 Posted : 21 September 2019 02:37:44(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Xiu12 Go to Quoted Post
calculate the surface area


Area.PNG
Online uni  
#6 Posted : 21 September 2019 02:46:37(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
You can try something like this

2019-09-21_04-44-40.png
Russia ☭ forever
Viacheslav N. Mezentsev
Offline Jean Giraud  
#7 Posted : 21 September 2019 05:29:09(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Xiu12 Go to Quoted Post
calculate the surface area.


Annotate the drawing [what is what in there], and what wort what.

MatrixUnknown.sm (10kb) downloaded 12 time(s).
Offline Xiu12  
#8 Posted : 21 September 2019 10:37:10(UTC)
Xiu12

Rank: Newbie

Groups: Registered
Joined: 20/09/2019(UTC)
Posts: 3

Thank you guys for your answers,

I will try to explain what I need.

Depending on the soil layers, I have a graph similar to the picture. At a later stage, I want to divide this chart into equal pieces (for example 0.25 m or 0.5m) to obtain "soil springs".
To simplify the example, I assumed that the elements of the K matrix are constant.

Springs.png

Edited by user 21 September 2019 10:39:52(UTC)  | Reason: Not specified

Offline mkraska  
#9 Posted : 21 September 2019 11:47:47(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,980
Germany

Was thanked: 1120 time(s) in 718 post(s)
uint.png
uint.sm (10kb) downloaded 17 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 2 users thanked mkraska for this useful post.
on 21/09/2019(UTC),  on 21/09/2019(UTC)
Offline Jean Giraud  
#10 Posted : 21 September 2019 17:23:03(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Xiu12 Go to Quoted Post
Depending on the soil layers,
I have a graph similar to the picture. At a later stage,
I want to divide this chart into equal pieces
(for example 0.25 m or 0.5m) to obtain "soil springs".
To simplify the example, I assumed that the elements of the K matrix are constant.

OK ... from there, apply your skill to produce the Cartesian graph
of the piecewise soil. No problem to integrate.
Integration of discontinuous functions is deceiving.
Two models attached. The Romberg-Simpson is more accurate.
Example 2, the integration is known by inspection.
Isn't deceiving Simpson is not so good !
Cheers ... Jean

Integrate Discontinuous_2.sm (132kb) downloaded 10 time(s).

Offline Jean Giraud  
#11 Posted : 21 September 2019 20:12:23(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Integration of discontinuous functions is deceiving.

Total integration is often what the project needs.
Most Engineering projects require the evolution of the integration,
i.e: the cumulative integration.
The attached takes Martin data set, convex Hermite
that you can fillet [sub:=,] and populate at will [mesh 't'].
The latest step is the FD integration [Finite Differences].
The graph shows the evolution of the integration.
The end point of the cumulative = total integration
from any other best/applicable numerical integrator.
Except for trivial cases no numerical integration is exact.
FD integration is always very accurate [kind of yardstick].
Hermite polyline is very similar to CAD systems.
Please, come back on that "Soil project".
Cheers ... Jean

Integrate Discontinuous_3 [HermiteSpline, FD].sm (50kb) downloaded 6 time(s).
Offline Jean Giraud  
#12 Posted : 21 September 2019 20:16:46(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: uni Go to Quoted Post
You can try something like this

True Viacheslav: ODE integrator(s) are very excellent.
Thanks for your input.
Offline Jean Giraud  
#13 Posted : 21 September 2019 23:18:55(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
... some didactic added.
OBSERVE: before the CAS numerical integration,
integration was FD [Finite Differences].
Read: F.B. Hildebrand.

Integrate Discontinuous_3 [HermiteSpline, FD].sm (115kb) downloaded 12 time(s).
Offline Xiu12  
#14 Posted : 22 September 2019 12:57:11(UTC)
Xiu12

Rank: Newbie

Groups: Registered
Joined: 20/09/2019(UTC)
Posts: 3

Thank you very much,
(btw the "thank" button on this page does not work)

The idea of ​​using linterp is actually much better instead of a loop.
Below is the file with the result I needed.

Final springs.PNG

Final springs.sm (21kb) downloaded 11 time(s).

Edited by user 22 September 2019 13:00:23(UTC)  | Reason: Not specified

Offline Jean Giraud  
#15 Posted : 22 September 2019 15:43:08(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Xiu12 Go to Quoted Post
Thank you very much,
(btw the "thank" button on this page does not work)

The idea of using linterp is actually much better instead of a loop.
Below is the file with the result I needed.

The "Tanks" button used to work years ago, not any more.
Good work ... two comments:
1. subscript is confusing with sub-sub index.
Very many projects are sub-sub indexed.
Reserve subscript as tutorial [exemplified].
2. variable name confusing with number is another killer.
you had 1:=max(X).
SS7030 was reputed good version, compatible SS 6179.

Final springs_1.sm (25kb) downloaded 14 time(s).


Offline Jean Giraud  
#16 Posted : 22 September 2019 19:56:55(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
... for convenience and publishing:
you can sub-space [at will] your calculated segments.
From there, you may obtain the cumulative integration
from the FD as offered before.

Final springs_1.sm (43kb) downloaded 9 time(s).
Offline Jean Giraud  
#17 Posted : 22 September 2019 21:32:32(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
you can sub-space [at will]

... directly from the sampled data.
Subspace is a great utility.

Soil Simplifed from Sampled Data.sm (19kb) downloaded 21 time(s).
Users browsing this topic
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.