Skip to main content
1-Visitor
April 7, 2020
Question

Solving numerically one equation and data fit

  • April 7, 2020
  • 1 reply
  • 4205 views

Hello Everyone,

 

I have some experimental points, and I need to fit this with a equation. But the dependence of variables is related wtih a second equation. The problem is explained in the attached file.

Can somebody help me?

 

Thanks

1 reply

23-Emerald IV
April 7, 2020

Let's establish that the following is known:

LucMeekes_0-1586290571226.png

Furthermore these equations are given:

LucMeekes_1-1586290642547.png

Using the first, we can write A as a function of r:

LucMeekes_2-1586290740644.png

but we can also write r as a function of A:

LucMeekes_3-1586290761220.png

And that is much more useful, because we cannot write r as a function of CT, but CT as a function of r solves as:

LucMeekes_4-1586290829652.png

Using this we can substitute r with its function of A, and substitute the third function as well:

LucMeekes_6-1586290973129.png

So now we have a function CT(A, A0, A1, CBP, K, N).

If the supposed solution is entered, and compared to the known points, we get:

LucMeekes_7-1586291367597.png

The 'solution' is nowhere near the known points (except for CT=0).

Let's see if we can get a better approximation:

LucMeekes_8-1586291493647.png

That's more like it.

With these results as guess values, one more try:

LucMeekes_9-1586291621114.png

I hope this brings you further.

 

Success!
Luc

 

25-Diamond I
April 8, 2020

As far as I understand it, is CBP not a value to solve for but should be of constant value 48500.

And the supposed value for A1 is not -20, but should be around +20.

 

You may consider using a solve block function (or using the root command) to create a function r(CT,K,N) and use this function with equation (1) in a solve block with minerr(K,N,A1).
But I am not sure that the problem is well conditioned.

23-Emerald IV
April 8, 2020

"the supposed value for A1 is not -20, but should be around +20"

OK then:

LucMeekes_0-1586327070253.png

And with these values as guess values I get:

LucMeekes_1-1586327146487.png

Re-iterating once more causes only minor shifts of the values.

Keeping CBP fixed at 48500:

LucMeekes_2-1586327316858.png

And another iteration gives:

LucMeekes_3-1586327357993.png

"I am not sure that the problem is well conditioned". I fully agree.

 

Luc