About fitting one curve with one equation and calculating two values from fitting

I want to fit one curve (x vs y1) with equation y2=(1/ (exp(e-u))/kt)) with same x axis and want to find the value of e and u. How can I do it?

6 Comments

y2=(1/ (exp(e-u))/kt))
Why is there no x on the right-hand side of the (theoretical) equation ? I thought x is the independent variable, but now I'm confused.
"want to find the value of e and u" given
y2=(1/ (exp(e-u))/kt))
In the above expression, e and u are not going to be separable to be estimated individually besides.
@Sunipa Som, Also note that there are 3 left brackets "(" and 4 right brackets ")".
syms y2 e u kt
y2 = (1/(exp(e - u))/kt))
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
In fact, can be rewritten as .
Sorry, the equation should be written as y2=(1/((exp(e-u))/kt)). Where e varies from 1 to 99 and from fitting I have to find the value of u and t. The value of k is given. the value of x is e which varies from 1 to 99. Another curve is y1 vs x, where x varies from 1 to 99. I got the values of y1 from simulation for different x.
Sorry for my mistake. One curve which is e vs y1 (which is known) and another is e vs y2=(1/((exp(e-u))/kt)) where e varies from 1 to 99. k is known. I have to fit those two and find the value of u and t. How can I do it?
Please click this paperclip icon to attach the data for plotting.
If your inline math equation and the implied multiplication are interpreted according to the standard order of operations, it represents a decaying exponential function. This function can be either strictly monotonically decreasing or strictly monotonically increasing, depending on the parameters k and t.
Double check in MATLAB:
syms x u k t
expr = (1/((exp(x - u))/k*t))

Sign in to comment.

Answers (1)

Suppose I gave you a set of data, and asked you to tell me two parameters from the data. All I need is one data point, More would just confuse things.
x = 12
Now, I will suggest a "model" for x, in the form of x = a + b. What are a and b?
Can you tell me what a and b are, separately? You know the sum of a and b, perfectly. But you can never know what a is versus b. The two numbers could be any set of two that sum to 12. So [0,12], [6,6], [12,0], [-5347,5359], etc.
You can NEVER recover both a and b separately in that model, any more than you can recover both e and u in your model, no matter how much data you have. There is no mathematical magic available, no tricks, no statistical resources, no functions in MATLAB to do what you have asked.
Had I told you the value of a, then you can infer b. Similarly, in your problem, if one of the unknowns is known, then you can infer the other. But that is the best you can ever do.
I'm sorry, but there are some things you can never learn, and it is easy to write down a problem with no solution. You did so in your question.

2 Comments

Sorry, the equation should be written as y2=(1/((exp(e-u))/kt)). Where e varies from 1 to 99 and from fitting I have to find the value of u and t. The value of k is given. the value of x is e which varies from 1 to 99. Another curve is y1 vs x, where x varies from 1 to 99. I got the values of y1 from simulation for different x.
Therefore one curve which is e vs y1 (which is known) and another is e vs y2=(1/((exp(e-u))/kt)) where e varies from 1 to 99. k is known. I have to fit those two and find the value of u and t. How can I do it?
I've read it 4 times and it's clear as mud. So you're plotting e vs y1 and e vs. y2? So e is your dependent variable on the y axis and y1 and y2 are the independent variable on the x/horizontal axis? Or did you mean to say you want to plot y1 vs e?
About all I can suggest is that if you have some experimental data you can try to use fitnlm to estimate some parameters for a model. I'm attaching some demos for various models. Adapt as needed, if possible.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
Some screenshots of your data plotted and desired/expected fit curve would also be good to help us understand this.

Sign in to comment.

Categories

Products

Release

R2015a

Asked:

on 30 Sep 2024

Commented:

on 1 Oct 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!