AI math  - Page 1
Forum section: electronics / general

author: mzzj
author_rank: Super Contributor
timestamp: July 17, 2025, 10:41:50 pm
content: I was actually impressed earlier how well deepseek solved some math problems but this was something elseFor context the question for Grok and deepseek was:can you find Approximate inverse function for Pt100 RTD (IEC 751) from resistance to temperature. 5th order polynomial equation for -200 to 0cel range with 0.001cel precisionGrok hallucinates from get-go and gives set of coefficients that have 86 Cel error at 100ohms :Step 2: Generate Data PointsSince the forward function $ R(T) $ is known, we can compute resistance values for temperatures in the range -200°C to 0°C at small intervals to create a dataset for fitting the inverse polynomial. To achieve 0.001°C precision, we’ll generate data points at fine temperature increments (e.g., every 0.1°C or finer) and compute corresponding resistances using the IEC 751 equation.Let’s calculate the resistance range for -200°C to 0°C:...So, the resistance ranges from approximately20.528 Ωat -200°C to 100 Ω at 0°C.Deepseek:gives set of coefficients:-242,492,8893E-01-2,0519E-052,8535E-07-1,2995E-092,5099E-12and validates the equation with fake math:Precision Validation:This approximation achieves ±0.001°C accuracy over the -200°C to 0°C range.For R = 18.52 Ω (which corresponds to -200°C), the polynomial yields -200.000°C.For R = 100.00 Ω (which corresponds to 0°C), the polynomial yields 0.000°C.for validation calculates following: −242.51+5.3549−0.00725+0.00192−0.00021+0.000008=−199.99°CYou can see with blind eye that the sum is nowhere near -199.99When asked to recalculate at 18.52 ohm (-200cel) finds out that the above math is incorrect, gives new set of coefficients, fake validates them and again finds out that calculation is wrong when pointed out.

author: KE5FX
author_rank: Super Contributor
timestamp: July 17, 2025, 11:07:49 pm
content: Seems to work fine ino4-mini-high, at least at first glance. It cites its source (Analog Devices AN709) and gives you a Python script to validate the results:versusHowever, if you look at the script you can see that it just copied the cubic coefficients from the app note. I followed up and asked it to use the 5th-order fit you originally asked for, and it did OK.DeepSeek is good at talking itself out of the right answer, but I'm kind of surprised that Grok didn't get it. Were you trying the new Grok 4 model, or the old Grok 3?

author: mzzj
author_rank: Super Contributor
timestamp: July 17, 2025, 11:09:44 pm
content: Quote from: KE5FX on July 17, 2025, 11:03:11 pmswitching to deepseek "deeptgought" mode it circles back and forth, calculating and then coming to conclusion that something goes wrong and gives "coefficients found online" = same coefficients as chatgpt.I had actually laugh at this deepthought:"Why is the fit not exact at this point? Because it's a polynomial approximation and we are fitting many points. The endpoint might have a small error? But the error we computed earlier was 0.00025°C, and here we have an error of 102.7°C? That can't be. "and old free grok3 model.

author: KE5FX
author_rank: Super Contributor
timestamp: July 17, 2025, 11:16:24 pm
content: It actually didn't do as well as I thought at first (see edit) -- I had to go back and ask it to actually use the 5th-order coefficients, rather than just parroting the ones from the app note:https://chatgpt.com/share/68798688-d7a8-800b-ba96-d43891829eafSeems OK now but you don't want to take your eye off of HAL!Another thing I've noticed is that when it gives you both a plot and the Python code that supposedly generated the plot, you'll do well to actually run the Python code and verify that it actually generates the plot in question. It wasn't a problem this time, but...(Edit: had it modify the test program to use the 5th-order fit for the whole plot, not just the negative range)

author: mzzj
author_rank: Super Contributor
timestamp: July 17, 2025, 11:42:32 pm
content: Grok v4 gives set of coefficients that have 1.2 degree error at -200 yet claims it is accurate to 0.001celwhen asked to validate the calculation finds out that the polynomials are wrong and goes to questioning the existence of universe.Blames "but the fit may lose accuracy near -200°C due to the steep non-linearity of the IEC 751 curve" but the fit is even worse at 66.6 ohm mid-point.When asked to validate at 66.6 ohm finds out the error is 2.8 degrees and not 0.001 as it earlier claimed

author: KE5FX
author_rank: Super Contributor
timestamp: July 17, 2025, 11:54:13 pm
content: Tell it, "Those coefficients are woke. Do better."

author: mzzj
author_rank: Super Contributor
timestamp: July 18, 2025, 12:03:30 am
content: Quote from: KE5FX on July 17, 2025, 11:16:24 pmChatgpt seem to be able to actually calculate correct coefficients and validate them.Grok v3 hallucinates some coefficients and when pointed out there is error calculates new coefficients that are not any betteredit: actually tested on Grok v3, not v4