Matrix function (conditional)

Matrix function (conditional) - Сообщения

#1 Опубликовано: 20.09.2019 15:34:48
XiuPer

XiuPer

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

Группа: User

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 (7 КиБ) скачан 33 раз(а).
#2 Опубликовано: 20.09.2019 17:22:30
Arie

Arie

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

Группа: User

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 (6 КиБ) скачан 36 раз(а).
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
#3 Опубликовано: 20.09.2019 19:56:29
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

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.
#4 Опубликовано: 20.09.2019 20:15:38
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

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
#5 Опубликовано: 20.09.2019 20:37:44
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

calculate the surface area



Area.PNG
#6 Опубликовано: 20.09.2019 20:46:37
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

You can try something like this

2019-09-21_04-44-40.png
Russia ☭ forever, Viacheslav N. Mezentsev
#7 Опубликовано: 20.09.2019 23:29:09
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

calculate the surface area.



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

MatrixUnknown.sm (9 КиБ) скачан 29 раз(а).
#8 Опубликовано: 21.09.2019 04:37:10
XiuPer

XiuPer

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

Группа: User

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
#9 Опубликовано: 21.09.2019 05:47:47
Martin Kraska

Martin Kraska

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

Группа: Moderator

uint.png
uint.sm (9 КиБ) скачан 39 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
2 пользователям понравился этот пост
frapuano 21.09.2019 07:05:00, sergio 21.09.2019 08:26:00
#10 Опубликовано: 21.09.2019 11:23:03
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

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 (131 КиБ) скачан 32 раз(а).

#11 Опубликовано: 21.09.2019 14:12:23
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

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 (49 КиБ) скачан 30 раз(а).
#12 Опубликовано: 21.09.2019 14:16:46
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

You can try something like this


True Viacheslav: ODE integrator(s) are very excellent.
Thanks for your input.
#13 Опубликовано: 21.09.2019 17:18:55
Jean Giraud

Jean Giraud

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

Группа: User

... some didactic added.
OBSERVE: before the CAS numerical integration,
integration was FD [Finite Differences].
Read: F.B. Hildebrand.

Integrate Discontinuous_3 [HermiteSpline, FD].sm (114 КиБ) скачан 30 раз(а).
#14 Опубликовано: 22.09.2019 06:57:11
XiuPer

XiuPer

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

Группа: User

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 (20 КиБ) скачан 29 раз(а).
#15 Опубликовано: 22.09.2019 09:43:08
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

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 (24 КиБ) скачан 40 раз(а).


#16 Опубликовано: 22.09.2019 13:56:55
Jean Giraud

Jean Giraud

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

Группа: User

... 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 (42 КиБ) скачан 27 раз(а).
#17 Опубликовано: 22.09.2019 15:32:32
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

you can sub-space [at will]


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

Soil Simplifed from Sampled Data.sm (18 КиБ) скачан 47 раз(а).
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений