Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


3 Pages123>
Options
Go to last post Go to first unread
Offline SteelCat  
#1 Posted : 12 May 2020 22:10:00(UTC)
SteelCat


Rank: Advanced Member

Groups: Registered
Joined: 02/05/2020(UTC)
Posts: 41
Italy

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)

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

Offline Jean Giraud  
#2 Posted : 12 May 2020 23:11:08(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: SteelCat Go to Quoted Post
I can't solve the system....

As simple as demonstrated !

Prova funzione.sm (7kb) downloaded 30 time(s).

Offline Razonar  
#3 Posted : 13 May 2020 04:14:57(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

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.

Clipboard01.jpg

Best regards.
Alvaro.
Offline SteelCat  
#4 Posted : 13 May 2020 20:01:05(UTC)
SteelCat


Rank: Advanced Member

Groups: Registered
Joined: 02/05/2020(UTC)
Posts: 41
Italy

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)
Offline Alvaro Gavilán  
#5 Posted : 14 May 2020 01:38:55(UTC)
Alvaro Gavilán


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2020(UTC)
Posts: 65
Man
Paraguay
Location: France

Was thanked: 25 time(s) in 16 post(s)
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
thanks 1 user thanked Alvaro Gavilán for this useful post.
on 14/05/2020(UTC)
Offline Davide Carpi  
#6 Posted : 14 May 2020 13:36:49(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
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á Go to Quoted Post
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
Offline Alvaro Gavilán  
#7 Posted : 14 May 2020 16:20:30(UTC)
Alvaro Gavilán


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2020(UTC)
Posts: 65
Man
Paraguay
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.
Offline SteelCat  
#8 Posted : 16 May 2020 00:30:43(UTC)
SteelCat


Rank: Advanced Member

Groups: Registered
Joined: 02/05/2020(UTC)
Posts: 41
Italy

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: Alvaro Gavilá Go to Quoted Post
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á Go to Quoted Post
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)
Offline SteelCat  
#9 Posted : 16 May 2020 12:43:55(UTC)
SteelCat


Rank: Advanced Member

Groups: Registered
Joined: 02/05/2020(UTC)
Posts: 41
Italy

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)
Offline uni  
#10 Posted : 16 May 2020 16:32:03(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)
Old school. See AlgLib 3.1x.

2020-05-16_18-31-28.png 2020-05-16_18-36-08.png

2020-05-16_19-02-33.png

Edited by user 16 May 2020 17:08:14(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
thanks 2 users thanked uni for this useful post.
on 16/05/2020(UTC),  on 16/05/2020(UTC)
Offline SteelCat  
#11 Posted : 16 May 2020 19:41:45(UTC)
SteelCat


Rank: Advanced Member

Groups: Registered
Joined: 02/05/2020(UTC)
Posts: 41
Italy

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: uni Go to Quoted Post
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 (49kb) downloaded 14 time(s).

Now I'll test it in a more complex engineering problem Good
Physics is like sex. Sure, it may give some practical results, but that’s not why we do it. (R. Feynman)
thanks 1 user thanked SteelCat for this useful post.
on 16/05/2020(UTC)
Offline mkraska  
#12 Posted : 16 May 2020 21:55:00(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: SteelCat Go to Quoted Post
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.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 16/05/2020(UTC)
Offline Razonar  
#13 Posted : 16 May 2020 23:04:58(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: mkraska Go to Quoted Post
...

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.
thanks 1 user thanked Razonar for this useful post.
on 17/05/2020(UTC)
Offline mkraska  
#14 Posted : 17 May 2020 13:40:31(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Razonar Go to Quoted Post
Originally Posted by: mkraska Go to Quoted Post
...

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 (31kb) downloaded 16 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline SteelCat  
#15 Posted : 24 May 2020 01:27:47(UTC)
SteelCat


Rank: Advanced Member

Groups: Registered
Joined: 02/05/2020(UTC)
Posts: 41
Italy

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: SteelCat Go to Quoted Post
Originally Posted by: uni Go to Quoted Post
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 (49kb) downloaded 14 time(s).

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

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)
Offline SteelCat  
#16 Posted : 26 May 2020 12:33:19(UTC)
SteelCat


Rank: Advanced Member

Groups: Registered
Joined: 02/05/2020(UTC)
Posts: 41
Italy

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: SteelCat Go to Quoted Post
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 Go to Quoted Post
... subjective of visibility.

Integrate Compendium_17 DOUBLE Fourier CoC.sm (56kb) downloaded 17 time(s).


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)
Offline SteelCat  
#17 Posted : 26 May 2020 18:43:45(UTC)
SteelCat


Rank: Advanced Member

Groups: Registered
Joined: 02/05/2020(UTC)
Posts: 41
Italy

Was thanked: 3 time(s) in 3 post(s)
good news Smile, 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/o...-with-full-jacobian.html)
Also the use of some eval()...
Forum example w-o units_4-BIS.sm (84kb) downloaded 15 time(s).

Any suggestions?

Edited by user 27 May 2020 15:37:35(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)
Offline Alvaro Gavilán  
#18 Posted : 27 May 2020 22:06:15(UTC)
Alvaro Gavilán


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2020(UTC)
Posts: 65
Man
Paraguay
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).

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

Offline Alvaro Gavilán  
#19 Posted : 27 May 2020 22:23:32(UTC)
Alvaro Gavilán


Rank: Advanced Member

Groups: Registered
Joined: 16/04/2020(UTC)
Posts: 65
Man
Paraguay
Location: France

Was thanked: 25 time(s) in 16 post(s)
Originally Posted by: SteelCat Go to Quoted Post
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.
Offline SteelCat  
#20 Posted : 27 May 2020 23:35:19(UTC)
SteelCat


Rank: Advanced Member

Groups: Registered
Joined: 02/05/2020(UTC)
Posts: 41
Italy

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: SteelCat Go to Quoted Post
good news Smile, 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/o...-with-full-jacobian.html)
Also the use of some eval()...
Forum example w-o units_4-BIS.sm (84kb) downloaded 15 time(s).

Any suggestions?


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)
Users browsing this topic
Guest
3 Pages123>
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.