Matlab? Mathematica? Ma... what do I need!?? - Page 1
Forum section: electronics / general

author: ivan747
author_rank: Super Contributor
timestamp: February 10, 2015, 03:33:19 pm
content: Why is this Matlab thing all the rage in the academic world? The circuits 1 teacher is suggesting Matlab for circuit simulation!Now, I get that you can do lots of advanced maths processing, but, isn't it too much asking to use it as a substitute for a really basic circuit simulator? Besides, I haven't been taught how to use it. In fact, for most of my peers, this is the second time they touch a programming language. The first time was a 40 hour introductory programming course in C.Bear in mind that we have barely just learned how to do KCL, KVL and that sort of thing (well, they... I already learned it long ago).

author: owiecc
author_rank: Frequent Contributor
timestamp: February 10, 2015, 03:43:00 pm
content: It is used in academia because it is good. Probably your professor uses it for something else and he doesn't even bother to look at different software. You will probably use it later in the control class.I love MATLAB but there are better circuit simulators. Spices for example: LTSpice (because it is free, fast and good) and Circuitlab (much nicer GUI + cloud stuff).

author: ivan747
author_rank: Super Contributor
timestamp: February 10, 2015, 03:51:27 pm
content: yeah, I think it will be useful for something... Specially since I suck at doing symbolic math (I can mostly understand concepts and problems, but I suck at solving problems manually) so I work best with good tools.And what about real world usage?

author: rollatorwieltje
author_rank: Unknown
timestamp: February 10, 2015, 03:59:06 pm
content: Similar strategy as Microsoft, Matlab is aggressively approaching universities to get students to use it. Then when students go work somewhere, employers have to buy Matlab for massive amounts of money because it's the only thing they are familiar with.The Matlab infestation started in the company I work for as well, but we are actively trying to get rid of it. Python seems to be the preferred alternative now. At one point Matlab crap even ended up in production stuff (using the Matlab-to-C converter), that's where we realized this had to stop. Matlab also offers no license for continous integration / build servers...

author: ivan747
author_rank: Super Contributor
timestamp: February 10, 2015, 04:04:58 pm
content: Why would you NOT use Matlab in a production environment? The same case as labview (unmaintainable code tied to proprietary technologies)? (I had the impression that matlab was less bloated than labview)

author: Rigby
author_rank: Super Contributor
timestamp: February 10, 2015, 04:31:38 pm
content: Virtually everywhere I've worked in the automotive industry uses Matlab and LabView constantly.If you're going to go into any field where there are gas/diesel engines or AC/DC motor control, you're going to see a lot of LabView and Matlab. Industry standards, apparently.

author: LabSpokane
author_rank: Super Contributor
timestamp: February 10, 2015, 05:09:36 pm
content: Matlab has been a standard tool for academia and industry going on a couple decades now. Yes, it takes some time to learn the language, but if you know C, Matlab should be a breeze.Matlab is being suggested because so many of your circuit solutions will be done as matrices. Matlab, as denoted by its name, has highly efficient algorithms for matrix computations. It can literally be 10X faster to solve matrices in Matlab than to try and compute solution element-wise (i,j). The code that does the computation is also very compact once you understand how to convert the equation into Matlab matrix notation.Using those algorithms with a streamlined language with built-in graphing libraries can yield quick results with not much coding. It really is worth your time learning.

author: rollatorwieltje
author_rank: Unknown
timestamp: February 10, 2015, 08:21:33 pm
content: Quote from: ivan747 on February 10, 2015, 04:04:58 pmVendor lock-in. Also most features you want are in toolboxes. The price of those toolboxes is not listed for obvious reasons. Yes there is a trade-off between productivity and price, for some problems Matlab could be a good solution, but really for the stuff I see it being used for it's just a money sink. I would dare to say that if you have some experience in Python or whatever other language you could be just as productive.Matlab also churns out new versions like crazy. People only seem to want to work with the latest and greatest version, so be prepared to spend even more money on the service contracts. Also then don't forget to update the Matlab runtimes on all machines that run those "Compiled Executables".Those compiled executables are also interesting things, they actually aren't compiled at all. The exe is just some zip file containing the actual Matlab scripts and something that invokes the Matlab Runtime. The Runtime is basically Matlab without a GUI, so your nice Matlab application can't just run on any machine. Yep, you need another licence just to be able to use a GUI.One of the arguments I hear often is that Matlab can be used by people who have no experience with programming... Matlab (well, the language) is just another programming language. It doesn't matter that it has some nice features, that's called syntactic sugar. The basic rules and quality standards of programming still apply. I can't really blame Matlab for this (although stuff like unit testing was only very recently introduced), but most Matlab scripts I've seen were "messy" at best.What happens is that the research scientist builds something in Matlab, converts it to C using that C converter (he had to add 20 hacks as the converter for some reason can't convert everything), and then assumes the program works exactly the same on some embedded platform. Ironically the performance is often significantly better, but this is because there are literally no protections in the C code. Divide by 0? Not a problem. NaN? Infinity? Array sizes? Who cares. This analog sensor never returns 0, right?/rant

author: langwadt
author_rank: Super Contributor
timestamp: February 10, 2015, 11:04:48 pm
content: Quote from: rollatorwieltje on February 10, 2015, 08:21:33 pmThe point of the compiled executables is that you can ship it with your product without having to buy a full blown matlab license for each of your costumers.And lots of other programs and script languages rely on having the right runtime/dll etc.

author: mswhin63
author_rank: Frequent Contributor
timestamp: February 11, 2015, 01:27:32 am
content: My 2 bobs worth, learn the hardest system and then should be able to apply yourself over many other more refreshing applications. That should make you more employable.Personally I find Maple harder than MATLAB, but that is my feeling as MAPLE is much more mathematical, but it is an integral part of my Uni studies.Learn other application of holiday break, use Uni discount offers where possible and so on.CheersBruce

author: dannyf
author_rank: Super Contributor
timestamp: February 11, 2015, 01:36:17 am
content: QuoteHardly all the rage. Widely used? yes, but only because many issues can be expressed in matrix and matlab is good at processing matrix.Maple / Gauss are different in that they are processors of symbolic math, where Matlab are for numeric processing.

author: ivan747
author_rank: Super Contributor
timestamp: February 11, 2015, 02:09:04 am
content: Quote from: mswhin63 on February 11, 2015, 01:27:32 amThe bastards never gave us student emails, so 95% of the time, I can't prove I am a student. In fact, the only place where I could register as a student without academic email was the IEEE.

author: ivan747
author_rank: Super Contributor
timestamp: February 11, 2015, 02:10:54 am
content: Quote from: dannyf on February 11, 2015, 01:36:17 amWhat about Mathematica? What's that all about? Technically, I have a copy of Mathematica installed on the Raspberry Pi. It comes bundled with the default OS. But it isn't convenient for day to day use.I am looking for some sort of computer algebraic system that helps me with the darned symbolic math. You would have to bestupidcrazy (and meticulous and smart) to solve any but the simplest differential equations by hand.Perhaps one of these, instead?http://www.amazon.com/Texas-Instruments-Nspire-Graphing-Calculator/dp/B00IQBSXN6/ref=sr_1_1?ie=UTF8&qid=1423620715&sr=8-1&keywords=cas+calculatorBecause, when you come to think of it, these software packages cost even more than that calculator, and at least the calculator is giving me some very nice hardware I can carry around with me, perhaps even take to exams if the professor is easygoing. As a matter of fact, here's what they say about TI's N-spire PC software:QuoteWhich means that calculator must be running some serious stuff in it.oooor I could try going open source, if there's a open source package I can trustOr there's this thing called Mathcad, that has a free version for unlimited time with limited features. I'll be definitely trying that.

author: dannyf
author_rank: Super Contributor
timestamp: February 11, 2015, 02:47:45 am
content: mathmatica is the grand daddy of them all (symbolic processing). last time I used it must be in the 1980s or something like that.Maple is all the rage, in that niche.

author: ivan747
author_rank: Super Contributor
timestamp: February 11, 2015, 03:19:17 am
content: I'm probably going to be alright (for personal use) with Mathcad an a TI nspire. But the class requires Matlab. Do they expect us to pirate it? Pay full price? Well I don't wanna do either, I want my .edu emailSorry about the rant.

author: f5r5e5d
author_rank: Frequent Contributor
timestamp: February 11, 2015, 03:36:17 am
content: actually Mathematica is a relative newcomer - Maxsyma/Maxima dates from the 70'sthe DOE Maxima version is open source distributed as wxMaxima and in Sage Math - which wraps every free math package under the sun in PythonMatlab is primarily for numeric matrix math - symbolic math with matrixes quickly becomes unwieldy although Matlab does bundle the MuPad symbolic math in a tool boxmatrix formulations of circuit theory are not much used by practicing EE outside of RF where "circuit theory" approximations no longer apply - Spice circuit simulation is much more often used, helpfulcontrol theory however is often done in State Space formulation with heavy reliance on matrix algebraMatlab has well developed State Space control theory toolboxes - but largely numericOctave is the open source workalike for Matlab, free Scilab is less compatible but has more of a GUI and the Xcos dynamic simulation add on

author: rollatorwieltje
author_rank: Unknown
timestamp: February 11, 2015, 08:27:48 am
content: Quote from: langwadt on February 10, 2015, 11:04:48 pmYes, whay I was trying to say is that it only works under certain conditions. Everything that requires a GUI (one of the strong points of Matlab, it's easy to visualize everything) can't run using that Runtime.

author: nfmax
author_rank: Super Contributor
timestamp: February 11, 2015, 08:54:56 am
content: Compiled Matlab programs most certainly can run with a GUI - what they can't include is the Matlab IDE(20+ year Matlab user)

author: Howardlong
author_rank: Super Contributor
timestamp: February 11, 2015, 09:01:39 am
content: If you can avoid the Matlab specific toolboxes, Octave is a reasonable replacement for Matlab.As a one-man band, I simply cannot justify the cost of Matlab. My recurring software spend is already around $5,000pa as it is. I only use Octave with any gusto three or four times a year for a couple of hours or so each time. Octave/Matlab is very useful for numerical analysis, as Excel can be ;-) but for engineering number crunching Octave/Matlab can often be better than Excel due to the sheer volume of data.I do miss Matlab's FDATool though, but you can design filters without it.As others have said, relying on any machine-generated C code is often a disaster for ongoing maintenance. Sure, take the coefficients you generated from Matlab, but resist being lazy and taking the spoon fed code it generates: you, or someone else, will surely be cursing sometime in the future as a result.

author: mswhin63
author_rank: Frequent Contributor
timestamp: February 11, 2015, 12:02:00 pm
content: Quote from: ivan747 on February 11, 2015, 03:19:17 amIf you have a student ID, that can be used as well. Different process in identification though and take a bit longer, usually during the trial period.

author: rr100
author_rank: Frequent Contributor
timestamp: February 11, 2015, 12:40:53 pm
content: Quote from: ivan747 on February 11, 2015, 02:10:54 amMaple user here since 90's. I tried many things and if you aren't stuck because of profession, course, whatever with some particular software I strongly recommend something free and open.http://en.wikipedia.org/wiki/Sage_%28mathematics_software%29is fairly complete and the only problem is that it's web based and doesn't run natively on Windows (and by web based I mean you can run it yourself, there's no need to use somebody else's server unless you want to).And you can run it online on their servers (think google docs but for math programs).

author: Sigmoid
author_rank: Frequent Contributor
timestamp: February 11, 2015, 06:48:50 pm
content: Quote from: Howardlong on February 11, 2015, 09:01:39 amYea, there's Octave and one other free software alternative that I can't recall off the top of my head.MATLAB is really good, but as said above it is expensive, and that doesn't seem to be a thing if you are at a university.Some of it isn't even legal. I've seen pirate copies of MATLAB handed out on DVDs by professors, to be used as a prerequisite of getting a grade.

author: coppice
author_rank: Super Contributor
timestamp: February 11, 2015, 07:01:20 pm
content: Quote from: Sigmoid on February 11, 2015, 06:48:50 pmAre you thinking of scilab? Its isn't a direct alternative, but its in the same ballpark.

author: djacobow
author_rank: Super Contributor
timestamp: February 11, 2015, 07:23:29 pm
content: In addition to Octave, if which is supposed to be close to a "drop in" replacement, you have excellent matrix abilities in Python+NumPy or Perl+PDL. The advantage of both of those is that they are embedding top-notch numerical capabilities in real, solid programming languages with large libraries of other useful stuff. I'm partial to PDL, but nobody seems to be learning Perl anymore, it's dead for the most part.

author: Rigby
author_rank: Super Contributor
timestamp: February 11, 2015, 08:02:25 pm
content: Quote from: Sigmoid on February 11, 2015, 06:48:50 pmThe origin of the program bits doesn't solely determine if you're using pirated software or not. If I'm licensed for MATLAB, I can download a pirated version and patch the binary so that no license server is required (for example) and still be covered by the license I purchased.I'm not saying that your anecdote is false, just saying that things like site licenses can be granted to organizations who then tell you to "obtain the software yourself."

author: electr_peter
author_rank: Unknown
timestamp: February 11, 2015, 08:30:45 pm
content: I have used Matlab and Octave for math applications among other programs as well. Matlab and Octave are not 100% compatible in functions and syntax, but I tried to keep same syntax in both.The most annoying thing about Octave is that you cannot define function inside a function (I am not sure about newest version). This means unnecessary increase in function input/output parameters.Some guys just hate Matlab for various reasons:https://abandonmatlab.wordpress.com/

author: ConKbot
author_rank: Super Contributor
timestamp: February 11, 2015, 09:39:13 pm
content: Avoid Mathematica. They have shit customer service. I purchased a license 3 years ago, installed it, it was working fine, upgraded my PC, got rid of the old one, etc.. Went to reinstall, and it wouldnt let me because the license key was used already. Did their online help thing. And despite it saying I'd have a response in 24 hours (finding a keygen takes 5 minutes... and I need this software to work now, not in 24 hours... ) I never got a response, at all. So screw them. Sorry I dont have $50k to drop on their software with garbage syntax (so many awkward shift key characters, ugh) to get them to pay attention to me.

author: rollatorwieltje
author_rank: Unknown
timestamp: February 11, 2015, 09:47:54 pm
content: Quote from: nfmax on February 11, 2015, 08:54:56 amhttp://nl.mathworks.com/products/compiler/supported/compiler_support.htmlThe useful things aren't supported.

author: gocemk
author_rank: Regular Contributor
timestamp: February 11, 2015, 10:48:43 pm
content: It really depends on the field you are in. I can only speak for Control Systems Engineering and Automation, because that's the field i graduated in. During the studies i extensively used Matlab, and especially Simulink for system stability simulations. Also, it's PID toolbox comes in really handy for calculating PID parameters. The MPC toolbox allows simulation of the output when using MPC controller in your design, and so on...Also there are plug-in toolboxes you can install for e.g stability simulation on non-linear systems...And the list goes on (Nyquist diagrams, Bode plot analisys, conversions from State-Space to Transfer Function...)Now, after my studies i use it really rarely. In fact, i used it only once to calculate PID parameters for a PID controller i was writing in C. (I already had the transfer function, so once you have that, calculation of the PID parameters is trivial with the toolbox). Most PLC's software have the magic "autotune" option when using PID function blocks in the code, so this makes the use of Matlab even more rare, at least in the field of automation.

author: ivan747
author_rank: Super Contributor
timestamp: February 13, 2015, 04:53:14 pm
content: Well, I think I got my math existential crisis solved out.Thanks for your opinions guys!I'll be using the Matlab copies installed on the uni's labs, when I specifically need Matlab. I'll be using MathCAD and Wolfram Alpha as PC and phone math packages, respectively and I bought an HP Prime calculator for classroom use.Here are the rationales for my decisions:*Matlab is a necessary thing on my curriculum, but I cannot afford the home edition as well as a calculator (more on that later). I am, however, still complaining for my university not providing us with .edu.do emails (they own a .edu.do domain and have had online platforms much more complex than simple POP3 email)*MathCAD is free. I haven't done anything with it, but I would predict it is sort of like Eagle or DipTrace in the math packages world. Matlab and Mathematica being sort of like Altium and Cadence*I had already bought mobile Wolfram Alpha when I started uni. It was 5 bucks, no periodic fee and it lets me see solutions step by step. Amazing value, but it doesn't integrate very well with my normal work flow (no pun intended). It paid out in less than 1 trimester[\li]*I felt like my Casio FX-115ES is great, but it has limitations and I am already starting to be affected by them. It solves matrices and even quadratic equations and (defined) integration, but it struggles with it. In the case of the 3rd order polynomial solver, it often only gave me 2 roots, instead of 3. I know that sometimes that is because 2 of the roots are actually the same, but I need to know which two.[\li]*Enter the HP Prime. I already took and passed all standardized test in my uni and country, that I know of, so I can get whatever calculator I want, not ridiculously crippled 20-year-old dinosaurs like the TI-84. The Prime's competitor is obviously the TI N-spire. It is extremely ugly for a start. I once tried to use it and it was more than counterintuitive. The mouse thing is ridiculous, the keyboard is not qwerty, so programming on it, if possible, would be a pain. So the keyboard is quite useless. It's only there, taking 1/4 of the calculator's surface and it's only useful for inserting variables. No trigonometric functions in sight. It looks and is bulky.The HP is quite different. They opted for a touchscreen, which is okay. I played with the emulator and the whole thing makes more sense. There is no space wasted on the keyboard. Most, if not all of the keys, as a consequence, are bigger. The hardware seems like a fine piece of instrumentation, not only a high school toy that has to stand the abuse of irresponsible users. The keys are reportedly clicky and firm, with a metallic feeling. HP markets it to students and professionals. TI doesn't even mention professionals. I plan to finish college, you know...To top this off, the HP is cheaper. Its community consists of professionals and (slightly dissapointed) HP calculator aficionados. TI seems to be teachers and students. "But Ivan, aren't you a student?" I hear you ask... yes, and I get educated by teachers, but I get the practical advise from professionals, because that's what I am going to be.So HP prime it is

author: ivan747
author_rank: Super Contributor
timestamp: July 05, 2015, 03:00:28 am
content: Just an update!They finally gave us a .edu email addressAnd I'm using MATLAB for something I'd find it useful. It's a course called "Signals and Systems", and it makes sense to use an environment like MATLAB for this sort of thing, since it's closer to maths than it is to circuits. I've now become slightly familiarized with it, but I'm sure there's a whole lot more to it.I still believe its use is definitely NOT circuits. Not without a CAS built in (yes, I know there's an option for it, no I can't pay for it). Still, there's room for improvement, like automatic matrix creation from circuit equations, direct schematic input... Oh wait, that's what LTspice is for.I'll stick to Octave for personal use, if I ever need it.

author: kalhana
author_rank: Contributor
timestamp: July 14, 2015, 11:59:12 pm
content: MATLAB is great for many things, I use a lot of SimPowerSystems Toolbox in Simulink to simulate circuits (mainly power electronics) and you can integrate the control system (either in MATLAB code or as graphical blocks) into it which makes it great.We were thought not to use the PID tuner wizard (it's frowned upon over here) so we derive the closed/open loop transfer functions and use either Bode/root locus methods to design the controller. For transfer function manipulations, I use MATLAB coding.Recently started using Mathematica, and it's really awesome and really elegant. Been using it for symbolic maths. I have heard that it's much better than MATLAB's symbolic toolbox. Things that used to take pages and pages to manually derive, now take much less effort (and if it's a critical thing, you can always do manually and double check with Mathematica).Also, I like Mathematica's "manipulation" capability where you can manipulate variables with sliders and see in real time how your equation terms change and how waveform plots change. Beyond awesome!

author: MarkF
author_rank: Super Contributor
timestamp: July 15, 2015, 01:21:20 am
content: Matlab is heavily used in industry for data processing and post analysis. A very nice thing to have on your resume.It's also used in complex digital signal processing and analysis.

author: John Coloccia
author_rank: Super Contributor
timestamp: July 15, 2015, 07:48:11 am
content: Quote from: MarkF on July 15, 2015, 01:21:20 amBingo.Lots of people complain about it, but the fact is that I can write incredibly powerful programs with just a few lines of code, and in the US it's trusted throughout the industry and military for spitting out the correct answers. It's simple enough that even a casual user can follow what's going on and spot bugs, or verify correctness.For some reason, it's always being compared with programs like Mathematica and Maple. To me that's like asking, "Should I use and LM833 opamp or a Vishay capacitor?" They're so completely different from one another that it doesn't even make sense to compare them. I think people just mistakenly read "Matlab" as some misspelling of "MathLab". It's "MATRIX Lab".You can get circuit analysis stuff for Matlab, but it's more appropriate for industrial applications...like modelling power lines from the dam to some distribution station. IMHO, it's a very odd, and possibly bad, choice for general circuit design. Any one of the popular SPICE variants is a far better choice.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: July 16, 2015, 04:55:41 am
content: I have had a copy of Mathcad since the late 80s, early 90s, updating whenever their price got low enough. It does symbolic math fine, and is set up to do matrices, but doesn't have the power for data entry/collection that Matlab does. I have never found symbolic math too useful. Anything big enough that you can't do it manually causes the programs to choke or expand into uselessly large expressions. If you are going to have a forty line equation you might as well go directly to a numerical solution.I would recommend anyone in school to get thoroughly familiar with Matlab. It has evolved into a widely used standard and the knowledge will serve you well.I would also recommend investigating either the Microsoft Office or Open Office spreadsheet tools for simulation of smaller systems (say a few dozen variables/states and a few thousand time steps) and working with modest size data sets (say 10k to 20k data points). They are also effectively limited to 2D models, anything 3D is very clumsy and limited. They are adequate tools (not nearly as nice or versatile as Matlab), and they are widely accessible. While the odds are very good that you will run into people who don't have access to Matlab, there is almost no one who can't latch on to one of the spreadsheet programs and utilize your work or look at your data.

author: John Coloccia
author_rank: Super Contributor
timestamp: July 16, 2015, 10:40:56 am
content: Quote from: CatalinaWOW on July 16, 2015, 04:55:41 amAbsoolutely! The engineering world runs on Excel. It's amazing what it can do. I hate working in spreadsheets, but if you're going to survive as an engineer, you'll probably have to become proficient at some point.