### Author Topic: Numerical Methods in Matlab  (Read 1523 times)

0 Members and 1 Guest are viewing this topic.

#### rstofer

• Super Contributor
• Posts: 7051
• Country:
##### Re: Numerical Methods in Matlab
« Reply #25 on: May 22, 2019, 02:51:04 pm »
Two other resources I find useful:

Desmos.com for graphing
Symbolab.com for solving

Just having a picture to look at is immensely helpful.  Sometimes the roots won't be real (eg x^2+10) and you can see that right off.  I haven't looked closely but Newtow-Raphson seems to barf on imaginary roots.  I need to look into this.

For giggles, go to Symbolab and enter x^2 + 10 = 0 and click on GO.  Not only is the numeric solution given, so is a graph.  Very cool site!

I also use wxMaxima and it's a pretty nice solver.

We had none of these tools when I graduated in '73.  In fact, the HP35 calculator had just been introduced and I couldn't afford one anyway.  Today I mess around with these things to help my grandson with his BSME program.  He just finished a course in MATLAB - imagine having a required course that is actually useful.  He also had a course in 3D modeling (Solidworks) and 3D printing.  These are going to be useful skills down the road.

Now I need to get up to speed on differential equations before the fall semester starts.  It's been decades since I thought about this stuff.  No worries!  MATLAB can handle 'em.

And, yes, Octave is a nice, and free, substitute for MATLAB.  I bought the home license for MATLAB and I tend to use it because it is what my grandson is using.  The MATLAB code given above runs unchanged in Octave.

#### jesuscf

• Regular Contributor
• Posts: 230
• Country:
##### Re: Numerical Methods in Matlab
« Reply #26 on: May 22, 2019, 03:42:46 pm »
Nowadays instead of Matlab I use Python. Instead of Maple I use Xcas (or the cas of the HP-Prime calculator, also based on Xcas).  Xcas is a free computer algebra system that can be downloaded from:

https://www-fourier.ujf-grenoble.fr/~parisse/giac.html

Here is the solution to the equation from OP using Xcas:

Homer: Kids, there's three ways to do things; the right way, the wrong way and the Max Power way!
Bart: Isn't that the wrong way?
Homer: Yeah, but faster!

#### rstofer

• Super Contributor
• Posts: 7051
• Country:
##### Re: Numerical Methods in Matlab
« Reply #27 on: May 22, 2019, 05:12:47 pm »
Xcas seems like a nice alternative.  I'll have to spend some time with it but once I found Ctrl-F9 things came together pretty well.  It is worth noting that portions of the help information have not been translated from French.

Still, 4 lines to get the result is pretty impressive. The system has a programming language so I suspect that it could be coded to do Newton-Raphson (or one of the others) directly rather than just using fsolve().

Smf