Math solver challenge - can't figure it out - Page 1
Forum section: electronics / general

author: rx8pilot
author_rank: Super Contributor
timestamp: July 27, 2016, 08:29:54 pm
content: I have been using PTC mathcad and the online mathway tools to solve various equations that I come across in data sheets. My math skills are not good in general, so I am mostly looking to 'solve for x' and only half way understand what the equations are describing.I was fiddling around with how to measure capacitors on an oscilloscope - built a fixture to hold tiny SMD caps. The equation given to derive the angle of impedance did not look too crazy, but I cannot get the same answer that is given in the example.Expression:with values shown in paper as example:Mathway.com attempt result = -79.788 degMatchcad did not evaluate at all, had a cryptic error that I did not understand. I tried, briefly, to break it down on paper, but that did not go well either. Are there any math-centric people that can help me understand the right way to evaluate this?

author: Dave
author_rank: Super Contributor
timestamp: July 27, 2016, 08:35:33 pm
content: Did you check if the trig functions accept degrees as their input argument? Most expect radians. Just try multiplying the angles with pi/180.

author: rx8pilot
author_rank: Super Contributor
timestamp: July 27, 2016, 08:55:51 pm
content: .... i just noticed i did not put in the degree notation in the denominator. That is a big error.EDIT: It appears the conversion to radians may be automatic - the degree notation does not change the output. I will try my own radian conversion and see what happens.

author: rx8pilot
author_rank: Super Contributor
timestamp: July 27, 2016, 09:37:09 pm
content: Dave - you were correct.I converted all the angles to radians and that provided the correct answer in radians. I then only needed to convert the answer from radians to degrees at the end. That was solving with mathway.com - still could not get PTC mathcad to evaluate at all. Next step is to get the same solution built in excel.Returns -1.55677962 in radians, converts to 89.197 degrees just like the example.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: July 27, 2016, 09:56:18 pm
content: The problem is the output of the atan. While it's converting to radians for sin/cos correctly, it's not converting the output of atan back to degrees before subtracting it from 79.95. There's also a problem with the -79.95, it's subtracting the output of the atan from 79.95, and then making the entire thing negative, instead of subtracting it from negative 79.95.

author: rx8pilot
author_rank: Super Contributor
timestamp: July 27, 2016, 10:26:36 pm
content: Quote from: suicidaleggroll on July 27, 2016, 09:56:18 pmYes.I guess it should either convert atan to degrees or I could convert -79.95 to radians first (which seems to be easiest. The output needs to feed additional equations down the line that are expecting radians. Thanks for the help everyone.

author: rx8pilot
author_rank: Super Contributor
timestamp: July 28, 2016, 12:54:38 am
content: Finally got PTC Mathcad to work - there was a syntax error that was hidden.for the atan argument, the system had a hidden multiplication inserted. I probably typed it in the wrong way, but the result is a strange error because the atan function had no argument to work with. When you hover the mouse over the area it shows hidden symbols. Once I got the radian conversion worked out, it provided the expected result.I should spend more time learning mathcad as a solver - should be quite helpful and a major step up in some respect from excel that I have been using. Being able to see the equations presented well is nice. Trying to follow equations in excel is harder for me.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 28, 2016, 05:30:35 am
content: What is this even? Just throw it at Wolfram Alpha, it'll probably figure it out...http://www.wolframalpha.com/input/?i=theta+-+atan(-0.31+sin+theta+%2F+(1.929+-+0.31+cos+theta))+radians+at+theta%3D-79.95+degreesNote that it produces the same error, unless you specify that the atan() result is in units of radians. Then it evaluates right. (Else, convert theta to radians in the first place, and convert the result back to degrees.)Tim

author: rx8pilot
author_rank: Super Contributor
timestamp: July 28, 2016, 06:09:21 am
content: Quote from: T3sl4co1l on July 28, 2016, 05:30:35 amWhat is it solving or what is the software I am trying to learn?The math is from a Tek paper on measuring capacitance and inductance with a scope and signal generator. I was using it to figure out how to control my scope remotely and look at the frequency response of some components. Primarily to see if I could do it - not sure if it will be helpful. Step one was verifying the math, and I was assuming (wrongly) that the degree symbol would convert degrees into radians. On top of that, I got stuck on some invisible syntax.I am liking mathcad over the web options because it allows me to save the work in a file that is bundled with all the rest of the project. If I have to go back to it - it is in the same location as everything else. Seems great so far - as long as the driver pushing the button is not too dumb to give it the right units.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 28, 2016, 08:50:55 am
content: Quote from: rx8pilot on July 28, 2016, 06:09:21 amEh, the equation rather.Read that with the phrasing of "oh, what is this even? Just throw it on the shelf over there..."QuoteAh, neat. So partly talking to yourself about the tools (and, hopefully, getting some help from others who use it!).QuoteHeh, when I need something like that, I basically reach for a spreadsheet and call it done. About as effective, if not as good looking as MathCAD. Or MATLAB, but really only if I worked with big datasets to justify it, which I don't usually. (Ugly, but formulas can be prettyprinted through LaTeX, which looks even better than MathCAD. I suppose it can do that, too.) Or if it were more circuit- than formula-oriented, a SPICE simulation, perhaps.Tim

author: nfmax
author_rank: Super Contributor
timestamp: July 28, 2016, 10:20:50 am
content: This is the sort of thing I use a Proper Calculator for, rather than a computer!That means Hewlett Packard RPN entry, so you can see the value of each sub-expression as you calculate it. The HP32Sii at my desk at work gives me -89.1969(0455539)°

author: alex.m
author_rank: Contributor
timestamp: July 28, 2016, 10:26:05 am
content: For this kind of thing I also like to use a Mathcad like program called SMath.http://en.smath.info/

author: rx8pilot
author_rank: Super Contributor
timestamp: July 29, 2016, 08:47:33 pm
content: Quote from: nfmax on July 28, 2016, 10:20:50 amThe downside of a hand held calc, is that it is cumbersome or impossible to setup cascading calculations that have a lot of variables. On a computer, I can spread all the math out and easily see the whole of it and make any change needed. Setup a variable to sweep on a linear or log scale with varying resolution. Excel all but forces the user to break the problems down to make it writable. The various online and offline 'solvers' format the problem visually, which is kind of nice. They also hide the 'work' so it can be harder to sort out any issues. For most of my projects, I setup a spreadsheet and all the pertinent math gets calculated there. Some results feed the next problem and it helps understand 'what it' challenges very quickly.In the end, I want to get the math sorted quickly and efficiently. I cannot imagine using a hand held for anything more than simple and static problems.