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 Fabbro  
#1 Posted : 02 August 2023 12:50:48(UTC)
Fabbro


Rank: Member

Groups: Registered
Joined: 02/08/2023(UTC)
Posts: 16
France

I'm trying to reproduce the attached plot (coming from MathCAD) in SMath
and I'm not able to obtain a plot of the function nor even dividing the function by
1E+10 - I suspect a pb dealing big numbers - by the way I have also an error trying to use MAXIMA GNU.

Has anyone some idea/workaround?

Many Thanks

Plot_big_function.jpg

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

Offline oscampo  
#2 Posted : 02 August 2023 14:23:59(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 248
Man
Colombia
Location: Cali, Colombia

Was thanked: 87 time(s) in 66 post(s)
Hi!
Please provide more information: source code, data, or a link with a function description.

Best,

Oscar
Offline mkraska  
#3 Posted : 02 August 2023 16:43:20(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)
Can you actually display the values of that function? Computing determinants isn't really a strength of SMath. Did you make sure to use MaximaTakeover(det) when trying Maxima?
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Fabbro  
#4 Posted : 02 August 2023 17:20:32(UTC)
Fabbro


Rank: Member

Groups: Registered
Joined: 02/08/2023(UTC)
Posts: 16
France

Dear All,

thanks for your quick reply.

Here attached the file so that you can see "hands-on" the issue.

For TMMT.sm (100kb) downloaded 18 time(s).

I still suspect a limitation in plot function dealing with "big" numbers....but even dividing by 1E+08 (and even more...)
seems to work in this case (I made some other tests and, sometimes, this trick is useful).

As you understand I need a "visualization" of the function in order to "guide" the "solve" function (that seems
to work remarkably well w.r.t. MathCAD, by the way....but I cannot always be so lucky in this kind of problems...).

P.S. for mkraska
1) the name of detZ is, maybe misleading....in facts detZ calculate the determinant of a reduced matrix...and in any case
the function detZ(x) is defined directly by 4 functions
2) As you can see I can easily calculate the values of detZ(x) and find roots....BUT no plotting at all. By the way, due to complexity
of the function detZ(x), this last cannot be written explicitely....
3) I have difficulties to use Maxima for plotting (an error indicates that maxima.bat is apparently lacking in my -free- installation)...and, on the other side, I'm not allowed to install a new version of SMath without IT-manager support (he's actually in holydays...)....so, for the moment at least, no Maxima...


Last but not least: I'm a beginner (I discovered SMath 6 months ago and then I used it intensively, it's true) hence is possible that the way I have tackled the whole pb is not the most efficient (hence my issue with plotting...); so any suggestion, even completely changing the SMath sheet structure is welcome.

Thanks
Offline overlord  
#5 Posted : 02 August 2023 17:42:45(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,128
Turkey

Was thanked: 509 time(s) in 339 post(s)
Units are good, always try to use them.
But plotting doesn't like units.
Get rid of them if you are plotting.

Regards

2023-08-02_17-41.png
thanks 1 user thanked overlord for this useful post.
on 02/08/2023(UTC)
Offline Fabbro  
#6 Posted : 02 August 2023 18:39:08(UTC)
Fabbro


Rank: Member

Groups: Registered
Joined: 02/08/2023(UTC)
Posts: 16
France

Thanks Overlord! First I tried to reproduce the image in your post: just ADDING the unit of measures (as I have always done in MathCAD...but evidently I have not learnt the lesson.....) something is plotted....so, additional question how do you add the line with conditional statement (if...) that, if I understand well define the window range (also very very interesting for my pCool?
Offline Razonar  
#7 Posted : 02 August 2023 19:56:07(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. You can scale the plot choosing adequate units on it. With the exception of al_nleqsolve, there are not pure numerical solvers in SMath, but you can write your own one. It seems also that the limit for numerical evaluation of your function is about s = 160 kHz. Finally, it's true: native SMath plot can't handle very well long ranges, but XYPlot plugin can.

Click to enlarge

TMMT.sm (100kb) downloaded 18 time(s).

Best regards.
Alvaro.
Offline Fabbro  
#8 Posted : 03 August 2023 17:05:38(UTC)
Fabbro


Rank: Member

Groups: Registered
Joined: 02/08/2023(UTC)
Posts: 16
France

Dear ALL,

many thanks once more, as I have both solved the problem and, most of all (for a beginner like me), learnt something more...

In any case, it seems to me that each SMath installation has its own combination of "tricks" working (or not working...).

For Overlord, don't bother with my further question on range definition, I have found in the meanwhile....but still not working (see below)
Screenshot1.jpg

But once I combine the use of Plot native SMath function with unit scaling and range definition (as suggested and worked out by Razonar) and range definition...it works both with SMath native plot and with XY plot!!
Screenshot3.jpg
More, I tried to plot (with XY plot) the function for values higher than 160kHz; and, yes, something strange is happening for (see below); the same seems not using SMath Plot functionality
Screenshot2.jpg
In my specific case, at least, frequencies over 160 kHz are not so critical (the lowest ones are the most worrisome). So, for the moment as said, my problem is solved....next step is to further complexify the function detZ (Omega)...

It's well true that SMath is somewhat tricky, but, honestly, last MathCAD versions are not so error-free as it could be expected.....

Hope that your posts and my small tests/replies can be useful for other forum users.

Best Regards

Fabio
Offline Jean Giraud  
#9 Posted : 03 August 2023 18:17:35(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: Fabbro Go to Quoted Post
In any case, it seems to me that each SMath installation has its own combination of "tricks" working (or not working...).

You can't be more right ! Since Studio is replaced by Solver 30405.
Most annoying are dead functions from fx menu.
minor(M,#) undefined, median undefined, medfit in the blue
slope(vx,vy) divide by 0, intercept(vx,vy) divide by 0.
More puzzling, per say, minor(M,#) works native Studio 6179/Solver 30405
On new Solver sheet minor(M,#) function is not defined.
That is detrimental wrt determinant.
Fortunately, most user codes work Solver 30405.

Offline overlord  
#10 Posted : 03 August 2023 20:01:55(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,128
Turkey

Was thanked: 509 time(s) in 339 post(s)
Originally Posted by: Fabbro Go to Quoted Post
More, I tried to plot (with XY plot) the function for values higher than 160kHz; and, yes, something strange is happening for (see below); the same seems not using SMath Plot functionality

I asked that phenomenon to uni (author of XY Plot plugin).
It is caused by an algorithm to speed up plotting process.
If it really bothers you (it bothers me), there is a trick.
You can eliminate it by setting different start and end parameters.

Regards

2023-08-03_19-58.png
thanks 1 user thanked overlord for this useful post.
on 03/08/2023(UTC)
Offline Jean Giraud  
#11 Posted : 03 August 2023 22:07:57(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: Fabbro Go to Quoted Post
More, I tried to plot (with XY plot) the function for values higher than 160kHz; and, yes, something strange is happening for (see below); the same seems not using SMath Plot functionality

Your 2nd plot looks a distorted Morlet.
In the attached you will have to reconstruct both graphs.
set sigma:= sqrt(16) ... span 'x' 2nd plot for convenience.
Plot X_Y ± 16 perfect.
Cheers ... Jean.

0Appendix Morlet.sm (15kb) downloaded 4 time(s).

Offline Fabbro  
#12 Posted : 03 August 2023 23:44:05(UTC)
Fabbro


Rank: Member

Groups: Registered
Joined: 02/08/2023(UTC)
Posts: 16
France

Thanks Overlord, thanks Jean for your posts....

For Overlord: what you propose, works but....have a look here below.....Screenshot4.jpgScreenshot5.jpg
The function seems to me too complex to make a study of the function (I mean limits, derives, max, min); but I'd like
to perform such a study 'cause I expect an "asymptotic" behavior for values higher than 162kHz (last zero)...maybe it's
this asymptotic behavior at the basis of the "strange" plot.

For Jean: interesting, I discovered something!! And even strange because.....my function comes from vibration of short hollow beams.

Best Regards and thanks again
Offline Jean Giraud  
#13 Posted : 04 August 2023 13:44:22(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: Fabbro Go to Quoted Post
The function seems to me too complex to make a study of the function (I mean limits, derives, max, min); but I'd like
to perform such a study 'cause I expect an "asymptotic" behavior for values higher than 162kHz (last zero)...maybe it's
this asymptotic behavior at the basis of the "strange" plot.
For Jean: interesting, I discovered something!! And even strange because.....my function comes from vibration of short hollow beams.

Lots of maths are not compatible with units.
Can you explicit the project in simple f(x)
attach an image so to code Solver 30405
I doubt it will accept symbolic Derivative
No problem to Derive via Infinitesimal Analysis.
No problem for min/max Golden ratio.
Cheers ... Jean.

Offline Fabbro  
#14 Posted : 04 August 2023 14:50:05(UTC)
Fabbro


Rank: Member

Groups: Registered
Joined: 02/08/2023(UTC)
Posts: 16
France

Hi Jeans, thanks I'll take your remarks into consideration...

But now focus is on complexifying the problem (and relevant calculation times...).

You can make a calculation for a piecewise beam (instead than for a single beam):
you have just to multiply all the matrix Phi (you obtain for each piece of beam) each other...

Then the treatment is the same for the matrix you obtain as explained above.

For the moment I remark long time (longer than for Mathcad that arrived to process
30-pieces beam in 1h and 30'Wink...I'm trying to "explicitate" and cut the functions
that I used to express implicitly....if suggestions, I'll be glad to test in practice!

Best Regards

Fabio
Offline Razonar  
#15 Posted : 04 August 2023 17:03:20(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. Improved version. Can handle derivatives of detZ and find the real domain of that function ( 0 < ω < 163.0244 )

TMMT.sm (113kb) downloaded 4 time(s).
TMMT.pdf (395kb) downloaded 7 time(s).

Best regards.
Alvaro.
Offline Fabbro  
#16 Posted : 04 August 2023 17:24:10(UTC)
Fabbro


Rank: Member

Groups: Registered
Joined: 02/08/2023(UTC)
Posts: 16
France

Thanks RAZOR, I think that as soon as my IT Manager is back from holydays I'll ask for installation of portable version that include Maxima.

Best Regards
Offline Razonar  
#17 Posted : 04 August 2023 17:57:47(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 Fabbro. It can be obtained without Maxima, but it is much slower and less accurate.

TMMT without maxima.sm (114kb) downloaded 14 time(s).

Best Regards.
Alvaro.
Users browsing this topic
Guest
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.