Hidden variabile in functions contaning integrals

Hidden variabile in functions contaning integrals - Сообщения

#1 Опубликовано: 12.05.2020 16:10:00
SteelCat

SteelCat

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

Группа: User

Hello everyone,
I would like to solve a system of two equations in two variables (x, y) which contain defined integrals with other two variables (t, z for example).

The functions seem to work properly, but why does Smath also recognize as unknowns the fictitious variables into the integrals?
I can't solve the system....


Thanks.

Prova funzione.sm (9 КиБ) скачан 60 раз(а).
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
#2 Опубликовано: 12.05.2020 17:11:08
Jean Giraud

Jean Giraud

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

Группа: User

Wrote

I can't solve the system....


As simple as demonstrated !

Prova funzione.sm (6 КиБ) скачан 50 раз(а).

#3 Опубликовано: 12.05.2020 22:14:57
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Hi. SMath can't handle integrals in symbolic form. You don't have a "true" system of equations, because t and z are dummy variables, and Unknowns badly returns them as it. Using maple you can see what you actually have.

Clipboard01.jpg

Best regards.
Alvaro.
#4 Опубликовано: 13.05.2020 14:01:05
SteelCat

SteelCat

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

Группа: User

Thanks to both, but I'm dealing with a more complex case:
Forum example.sm (48 КиБ) скачан 53 раз(а).

As you can see, I know the solution of the system from a textbook example made with Mathcad: the single variable equation works well (apart the fact I've to input a very short range of solution...), but for the system of two eqn there is an errorro referring to a matrix...

Can anyone help me?
Thanks in advance.

PS: I know Jean doesn't like the unit usage, but it's very useful for making more general spreadsheets!
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
#5 Опубликовано: 13.05.2020 19:38:55
Alvaro Gavilán

Alvaro Gavilán

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

Группа: User

Hope this solves your problem: (declare the boundaries)

declare.png

Just for my curiosity, are you obliged by your codes (and which) to use the parabola-rectangle diagram?

Regards,

Alvaro
1 пользователям понравился этот пост
Alvaro Diaz Falconi 14.05.2020 16:18:00
#6 Опубликовано: 14.05.2020 07:36:49
Davide Carpi

Davide Carpi

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

Группа: Moderator

It is a know issues/beahvior of Unknowns; I have plans to improve it although isn't easy to provide something generic and reliable.

Wrote

Just for my curiosity, are you obliged by your codes (and which) to use the parabola-rectangle diagram?



Italian code NTC2018 probably, it allows to use different diagrams.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#7 Опубликовано: 14.05.2020 10:20:30
Alvaro Gavilán

Alvaro Gavilán

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

Группа: User

Thank you Davide, now I have dowloaded/read the NTC2018, it looks like EC2-1.1.
#8 Опубликовано: 15.05.2020 18:30:43
SteelCat

SteelCat

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

Группа: User

Wrote

Hope this solves your problem: (declare the boundaries). Just for my curiosity, are you obliged by your codes (and which) to use the parabola-rectangle diagram?
Regards,
Alvaro



No, I'm not obliged to use the parabola-rectangle diagramma for the ULS.

Wrote

Your system is over-killed from gyzmas [subscripts] and from carrying units at the design stage. You have J, N in the solve bloc. Smath is not a clone of the crappy PTC Mathcad.



Thanks. I can remote units before defining the functions, but what are the subscript-related issues?

Wrote

Thank you Davide, now I have dowloaded/read the NTC2018, it looks like EC2-1.1.



Yes, the Italian code is very similar to Eurocodes, also for the design of structures made with material other than concrete.
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
#9 Опубликовано: 16.05.2020 06:43:55
SteelCat

SteelCat

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

Группа: User

I purged units in function definitions: Forum example w-o units.sm (54 КиБ) скачан 45 раз(а).

Now I have three different errors:
  • Maxima couldn't reduce functions to polynomials;
  • roots founds 2 equations with 3 variables;
  • FindRoots I do not understand.


I think now I'm closer to the solution. Any other suggest?

PS: sometimes I used a while loop to solve single equations, but I've some desing difficulties with 2 variables...
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
#10 Опубликовано: 16.05.2020 10:32:03
Вячеслав Мезенцев

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

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

Группа: Moderator

Old school. See AlgLib 3.1x.

Файл не найден. Файл не найден.

2020-05-16_19-02-33.png
Russia ☭ forever, Viacheslav N. Mezentsev
2 пользователям понравился этот пост
SteelCat 16.05.2020 13:31:00, frapuano 16.05.2020 17:00:00
#11 Опубликовано: 16.05.2020 13:41:45
SteelCat

SteelCat

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

Группа: User

Wrote

Old school. See AlgLib 3.1x.



Many thanks Viacheslav, your NL solver found the solution in few seconds! Forum example w-o units_2.sm (48 КиБ) скачан 41 раз(а).

Now I'll test it in a more complex engineering problem
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
1 пользователям понравился этот пост
sergio 16.05.2020 15:35:00
#12 Опубликовано: 16.05.2020 15:55:00
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

I purged units in function definitions: Forum example w-o units.sm (54 КиБ) скачан 45 раз(а).

Now I have three different errors:

  • Maxima couldn't reduce functions to polynomials;
  • roots founds 2 equations with 3 variables;
  • FindRoots I do not understand.


I think now I'm closer to the solution. Any other suggest?

PS: sometimes I used a while loop to solve single equations, but I've some desing difficulties with 2 variables...



I think maxima Solve() can't handle functions containing conditional statements. Using boolean expressions won't help, as these aren't translated to maxima.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
SteelCat 16.05.2020 17:07:00
#13 Опубликовано: 16.05.2020 17:04:58
Alvaro Diaz Falconi

Alvaro Diaz Falconi

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

Группа: User

Wrote

...

I think maxima Solve() can't handle functions containing conditional statements. Using boolean expressions won't help, as these aren't translated to maxima.



Hi Martint. I guess that what you have in Maxima for handle conditionals is unit_step(x) = ( 0 if x <= 0 and 1 for x > 0 ).

Or can use U(x) = (1 + signum(x))/2 which takes U(0)=1/2.

I don't try to use it, but guess that both can be used for Solve, Integrate and Diff inside SMath calling Maxima.

Best regards.
Alvaro.
1 пользователям понравился этот пост
frapuano 17.05.2020 11:47:00
#14 Опубликовано: 17.05.2020 07:40:31
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

Wrote

...

I think maxima Solve() can't handle functions containing conditional statements. Using boolean expressions won't help, as these aren't translated to maxima.



Hi Martint. I guess that what you have in Maxima for handle conditionals is unit_step(x) = ( 0 if x <= 0 and 1 for x > 0 ).

Or can use U(x) = (1 + signum(x))/2 which takes U(0)=1/2.

I don't try to use it, but guess that both can be used for Solve, Integrate and Diff inside SMath calling Maxima.

Best regards.
Alvaro.



Hi Alvaro, thanks for the unit_step() hint. Generally, charfun() is a more general approach to convert boolean expressions to 0 and 1. However, symbolic integration in maxima can't handle charfun(), whereas the unit_step() function is handled. See feature request SS-99.
.
Some testing shows that Solve() (maxima's solve()) doesn't handle step functions well. Perhaps there are some options or special packages to improve this, but it doesn't work out of the box. Handling of integrals with abs() and sign() is enabled by loading the package abs_integrate, which is done by default in the plugin, see the session log in the printout.

Here is an overview of integration of piecewise continuous functions (from the interactive handbook). Some of these are handled symbolically by maxima, some of them are returned unchanged and then handled by poor man's non-adaptive SMath numeric integrator.

For now, the sign() and abs() approaches work.

Section math piecewise.png
Section math piecewise.sm (30 КиБ) скачан 49 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#15 Опубликовано: 23.05.2020 19:27:47
SteelCat

SteelCat

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

Группа: User

Wrote

Wrote

Old school. See AlgLib 3.1x.



Many thanks Viacheslav, your NL solver found the solution in few seconds! Forum example w-o units_2.sm (48 КиБ) скачан 41 раз(а).

Now I'll test it in a more complex engineering problem


Forum example w-o units_3.sm (52 КиБ) скачан 28 раз(а).

Here a test with 3 equations: someting went wrong, because the solution is expected to be near the origin and function value in the origin is very large... I can't find a graphical solution in this case...

EDIT: Following AlgLib example, I'm not able to compute the Jacobian matrix. It seems the issues is due to inequalities in the integrand definition...
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
#16 Опубликовано: 26.05.2020 06:33:19
SteelCat

SteelCat

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

Группа: User

Wrote

Wrote

Here a test with 3 equations: someting went wrong, because the solution is expected to be near the origin and function value in the origin is very large... I can't find a graphical solution in this case...


Your project is not visible:
1. NO units whatsoever, nowhere.
2. Visible values
3. NO subscript
As it looks, you seem seeking for the intersection of 2 double integral.
You may proceed like in real Engineering project, i.e:
1. Tabulate each double integral in matrix.
2. Unwrap each matrix in single vector, adjoin fake index.
3. Plot 2D to see intersection.
4. Interpolate, solve for more exact graphical solution.



Wrote

... subjective of visibility.

Integrate Compendium_17 DOUBLE Fourier CoC.sm (55 КиБ) скачан 39 раз(а).



I do not well understand your suggestions... There are 3 double integrals with a functions of 3 variables.
However I compared the results of the previous design with those from a simple domain discretization (using the known solution), in a way to detect some input errors: no errors but the solver still does not work.

Forum discretization example.sm (123 КиБ) скачан 45 раз(а).
Forum example w-o units_4.sm (79 КиБ) скачан 36 раз(а)..

https://en.smath.com/forum/yaf_postst1775p2_AlgLib-3-1x.aspx : I see the solver deals also with 3 variables...

Any other suggested solver?
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
#17 Опубликовано: 26.05.2020 12:43:45
SteelCat

SteelCat

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

Группа: User

good news , the AlgLib solver works, but:
  • I'd improve the solution speed;
  • I still can't evaluate the Jacobian matrix.


I think the use of Jacobian would improve the efficiency (https://www.mathworks.com/help/optim/ug/nonlinear-least-squares-with-full-jacobian.html)
Also the use of some eval()...
Forum example w-o units_4-BIS.sm (83 КиБ) скачан 39 раз(а).

Any suggestions?
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
#18 Опубликовано: 27.05.2020 16:06:15
Alvaro Gavilán

Alvaro Gavilán

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

Группа: User

Hello SteelCat,

Could you please tell me what are the equations you want to solve (as I sincerely don't know about the Jacobian procedure and the AlgLib solver).

PR concrete.png


Nint = ?;
Mxint = ?;
Myint = ?;


I will give it a try, I understand that you are dealing with biaxial bending of a concrete column.. as I am working on my interaction volume these weeks, I think I could help you.

By the way, I am proceeding with the shoelace Gauss formula to obtain the compression volume of concrete (a discrete approach, not a continuous double-integral approach) and also with the R diagram for concrete (not P-R).

But I will try to find a solution for your equations (staying continuous).

Regards,

Alvaro

#19 Опубликовано: 27.05.2020 16:23:32
Alvaro Gavilán

Alvaro Gavilán

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

Группа: User

Wrote

I purged units in function definitions:

#20 Опубликовано: 27.05.2020 17:35:19
SteelCat

SteelCat

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

Группа: User

Wrote

good news , the AlgLib solver works, but:

  • I'd improve the solution speed;
  • I still can't evaluate the Jacobian matrix.


I think the use of Jacobian would improve the efficiency (https://www.mathworks.com/help/optim/ug/nonlinear-least-squares-with-full-jacobian.html)
Also the use of some eval()...
Forum example w-o units_4-BIS.sm (83 КиБ) скачан 39 раз(а).

Any suggestions?



Forum example w-o units_4-BIS.sm (80 КиБ) скачан 44 раз(а).

It seems that the issue was due to the Jacob() function: I defined manually the Jacobian matrix, but Smath still do not show me the result...
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений