SMath Studio Forum
»
SMath Studio
»
Questions
»
Hidden variabile in functions contaning integrals
Rank: Advanced Member Groups: Registered
Joined: 02/05/2020(UTC) Posts: 41 Was thanked: 3 time(s) in 3 post(s)
|
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 (10kb) downloaded 36 time(s). |
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman) |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: SteelCat I can't solve the system....
As simple as demonstrated ! Prova funzione.sm (7kb) downloaded 30 time(s).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
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. Best regards. Alvaro.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/05/2020(UTC) Posts: 41 Was thanked: 3 time(s) in 3 post(s)
|
Thanks to both, but I'm dealing with a more complex case: Forum example.sm (49kb) downloaded 28 time(s).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) |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 16/04/2020(UTC) Posts: 65 Location: France Was thanked: 25 time(s) in 16 post(s)
|
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
|
1 user thanked Alvaro Gavilán for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,648 Location: Italy Was thanked: 1329 time(s) in 875 post(s)
|
It is a know issues/beahvior of Unknowns; I have plans to improve it although isn't easy to provide something generic and reliable. Originally Posted by: Alvaro Gavilá 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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 16/04/2020(UTC) Posts: 65 Location: France Was thanked: 25 time(s) in 16 post(s)
|
Thank you Davide, now I have dowloaded/read the NTC2018, it looks like EC2-1.1.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/05/2020(UTC) Posts: 41 Was thanked: 3 time(s) in 3 post(s)
|
Originally Posted by: Alvaro Gavilá 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. Jean Giraud 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? Originally Posted by: Alvaro Gavilá 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) |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/05/2020(UTC) Posts: 41 Was thanked: 3 time(s) in 3 post(s)
|
I purged units in function definitions: Forum example w-o units.sm (55kb) downloaded 18 time(s).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) |
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 post(s)
|
|
Russia ☭ forever Viacheslav N. Mezentsev |
2 users thanked uni for this useful post.
|
on 16/05/2020(UTC), on 16/05/2020(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/05/2020(UTC) Posts: 41 Was thanked: 3 time(s) in 3 post(s)
|
Originally Posted by: uni Many thanks Viacheslav, your NL solver found the solution in few seconds! Forum example w-o units_2.sm (49kb) downloaded 14 time(s).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 user thanked SteelCat for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,986 Was thanked: 1124 time(s) in 721 post(s)
|
Originally Posted by: SteelCat I purged units in function definitions: Forum example w-o units.sm (55kb) downloaded 18 time(s).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. |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Originally Posted by: mkraska ...
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 user thanked Razonar for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,986 Was thanked: 1124 time(s) in 721 post(s)
|
Originally Posted by: Razonar Originally Posted by: mkraska ...
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.sm (31kb) downloaded 16 time(s). |
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/05/2020(UTC) Posts: 41 Was thanked: 3 time(s) in 3 post(s)
|
Forum example w-o units_3.sm (53kb) downloaded 7 time(s).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... Edited by user 26 May 2020 07:25:25(UTC)
| Reason: Not specified |
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman) |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/05/2020(UTC) Posts: 41 Was thanked: 3 time(s) in 3 post(s)
|
Originally Posted by: Jean Giraud Originally Posted by: SteelCat 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. Originally Posted by: Jean Giraud 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 (124kb) downloaded 20 time(s). Forum example w-o units_4.sm (80kb) downloaded 13 time(s).. https://en.smath.com/for...t1775p2_AlgLib-3-1x.aspx : I see the solver deals also with 3 variables... Any other suggested solver? Edited by user 26 May 2020 13:20:44(UTC)
| Reason: Not specified |
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman) |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/05/2020(UTC) Posts: 41 Was thanked: 3 time(s) in 3 post(s)
|
|
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman) |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 16/04/2020(UTC) Posts: 65 Location: France Was thanked: 25 time(s) in 16 post(s)
|
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). 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
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 16/04/2020(UTC) Posts: 65 Location: France Was thanked: 25 time(s) in 16 post(s)
|
Originally Posted by: SteelCat I purged units in function definitions: <a class="attachedImageLink {html:false,image:false,video:false}" href="/forum/resource.ashx?a=33117 Ok I see it here. I will try.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/05/2020(UTC) Posts: 41 Was thanked: 3 time(s) in 3 post(s)
|
Originally Posted by: SteelCat Forum example w-o units_4-BIS.sm (81kb) downloaded 17 time(s).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) |
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Hidden variabile in functions contaning integrals
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.