Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Dear Experts,
I want to find confidence intervals for estimated parameters using LeastSquaresFit. Without units, there is no problem. When using units, an error occurs if the fitting function defined as a program block. How to solve this problem?
With units:
Without units:
With this kind of problems it's usually wise to check the labels of variables.
I found that most k2's are either labelled as 'variable' or as an 'automatic' 'variable', except for the one indicated:
Success!
Luc
@LucMeekes wrote:
With this kind of problems it's usually wise to check the labels of variables.
I found that most k2's are either labelled as 'variable' or as an 'automatic' 'variable', except for the one indicated:
Thanks for the reply, Luc. Unfortunately, it does not solve the problem.
Hi,
The values used in the second phase without units are k1=1 and k2=2 as start guesses.
The values used in the first phase with units are k1=0.278 and k2=5.556*10^-4 as start guesses. see the sheet.
That is why 0.046 and 1.278x10^-4 are found by Minerr.
The values used in the second phase without units are [1 2 3 4 6] T for t and [0.135 0.217 etc]T for Ce.
The values used in the first phase with units are [3600 7200 etc]T for t and [135 217 etc]T for Ce. see the sheet
These two the first and second phases thus are not the same numerical problem. I only have express version of Mathcad Prime 4.0 so it will not do the couple of lines of programming to show you how to correct your sheet. Essentially with units you must force the value by dividing by the units to use to get the value you want.
Hi,
The values used in the second phase without units are k1=1 and k2=2 as start guesses.
The values used in the first phase with units are k1=0.278 and k2=5.556*10^-4 as start guesses. see the sheet.
That is why 0.046 and 1.278x10^-4 are found by Minerr.
The values used in the second phase without units are [1 2 3 4 6] T for t and [0.135 0.217 etc]T for Ce.
The values used in the first phase with units are [3600 7200 etc]T for t and [135 217 etc]T for Ce. see the sheet
These two the first and second phases thus are not the same numerical problem. I only have express version of Mathcad Prime 4.0 so it will not do the couple of lines of programming to show you how to correct your sheet. Essentially with units you must force the value by dividing by the units to use to get the value you want.
Thank you, Terry.
The problem is not in which units the guess values are given. Functions Minerr and LeastSquaresFit return the result in the base units of the system SI. The problem is that the construction of Sol1 does not work!
Unfortunately I can not open files Prime 4.0.
An alternative solution to this problem is to step-by-step calculate the confidence intervals for the estimated parameters. Perhaps this approach is not elegant, but it works reliably with units. Still, the problem of using LeastSquaresFit-function with units remained unresolved (or unsolvable?).
"B-but, my dear f-fellows," said Feodor Simeonovich, having diligently eciphered the handwriting. "This is BBen B-Beczalel's problem! Didn't C-Cagliostro prove ththat it had no s-solution?"
"We know that it has no solution, too," said unta, bristling immediately. "But we wish to learn how to solve it".
(Arkadi and Boris Strugatsky. Monday begins on Saturday)