Author Topic: Math solver challenge - can't figure it out  (Read 3664 times)

0 Members and 1 Guest are viewing this topic.

Offline rx8pilotTopic starter

  • Super Contributor
  • ***
  • Posts: 3645
  • Country: us
  • If you want more money, be more valuable.
Math solver challenge - can't figure it out
« on: July 27, 2016, 08:29:54 pm »
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 deg


Matchcad 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?
« Last Edit: July 27, 2016, 10:21:32 pm by rx8pilot »
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1356
  • Country: si
  • I like to measure things.
Re: Match solver challenge - can't figure it out
« Reply #1 on: July 27, 2016, 08:35:33 pm »
Did you check if the trig functions accept degrees as their input argument? Most expect radians. Just try multiplying the angles with pi/180.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline rx8pilotTopic starter

  • Super Contributor
  • ***
  • Posts: 3645
  • Country: us
  • If you want more money, be more valuable.
Re: Match solver challenge - can't figure it out
« Reply #2 on: July 27, 2016, 08:55:51 pm »
.... 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.

« Last Edit: July 27, 2016, 09:12:15 pm by rx8pilot »
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline rx8pilotTopic starter

  • Super Contributor
  • ***
  • Posts: 3645
  • Country: us
  • If you want more money, be more valuable.
Re: Match solver challenge - can't figure it out
« Reply #3 on: July 27, 2016, 09:37:09 pm »
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.
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Match solver challenge - can't figure it out
« Reply #4 on: July 27, 2016, 09:56:18 pm »
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.
 

Offline rx8pilotTopic starter

  • Super Contributor
  • ***
  • Posts: 3645
  • Country: us
  • If you want more money, be more valuable.
Re: Match solver challenge - can't figure it out
« Reply #5 on: July 27, 2016, 10:26:36 pm »
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.

Yes.  |O

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.  :phew:
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline rx8pilotTopic starter

  • Super Contributor
  • ***
  • Posts: 3645
  • Country: us
  • If you want more money, be more valuable.
Re: Math solver challenge - can't figure it out
« Reply #6 on: July 28, 2016, 12:54:38 am »
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.

Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Math solver challenge - can't figure it out
« Reply #7 on: July 28, 2016, 05:30:35 am »
What is this even?  Just throw it at Wolfram Alpha, it'll probably figure it out... :-DD :-+ :D

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+degrees

Note 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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline rx8pilotTopic starter

  • Super Contributor
  • ***
  • Posts: 3645
  • Country: us
  • If you want more money, be more valuable.
Re: Math solver challenge - can't figure it out
« Reply #8 on: July 28, 2016, 06:09:21 am »
What is this even?  Just throw it at Wolfram Alpha, it'll probably figure it out... :-DD :-+ :D

What 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.  :palm:
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Math solver challenge - can't figure it out
« Reply #9 on: July 28, 2016, 08:50:55 am »
What is this even?  Just throw it at Wolfram Alpha, it'll probably figure it out... :-DD :-+ :D

What is it solving or what is the software I am trying to learn?

Eh, the equation rather.

Read that with the phrasing of "oh, what is this even? Just throw it on the shelf over there..." ;)

Quote
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.

Ah, neat.  So partly talking to yourself about the tools (and, hopefully, getting some help from others who use it!).

Quote
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.  :palm:

Heh, 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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline nfmax

  • Super Contributor
  • ***
  • Posts: 1618
  • Country: gb
Re: Math solver challenge - can't figure it out
« Reply #10 on: July 28, 2016, 10:20:50 am »
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)°
 

Offline alex.m

  • Contributor
  • Posts: 12
  • Country: pt
Re: Math solver challenge - can't figure it out
« Reply #11 on: July 28, 2016, 10:26:05 am »
For this kind of thing I also like to use a Mathcad like program called SMath. http://en.smath.info/

Offline rx8pilotTopic starter

  • Super Contributor
  • ***
  • Posts: 3645
  • Country: us
  • If you want more money, be more valuable.
Re: Math solver challenge - can't figure it out
« Reply #12 on: July 29, 2016, 08:47:33 pm »
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)°

The 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.
Factory400 - the worlds smallest factory. https://www.youtube.com/c/Factory400
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf