Hello
I have plotted a changing distance (d(x)) with time using cftool and calculated the function. Its derivative was calculated and this is v(x). when plotted with fplot the initial Y values are 0. I am calculating the x position at which this rises above the x axes (y>0). To do this i made v(x) equivalent to 1 (==1) and evluated x yet:
>>v(x)==1
ans =
(4119*x^2)/10000 - (1787*x)/5000 + 891/2500 ==1
>> eval x
x =
x
Will someone please help to calculate this? i can measure the x value directly. It is preferable to standardise this procedure.
GS.

2 commentaires

Gavin Seddon
Gavin Seddon le 14 Fév 2019
Hello, I tried
solve (x)
ans =
0
does this help?
GS.
madhan ravi
madhan ravi le 14 Fév 2019
Are you asking or stating?

Connectez-vous pour commenter.

 Réponse acceptée

Walter Roberson
Walter Roberson le 14 Fév 2019

0 votes

solve(v(x)==1,x)

16 commentaires

Walter Roberson
Walter Roberson le 14 Fév 2019
expect two solutions as it is a quadratic .
Gavin Seddon
Gavin Seddon le 14 Fév 2019
hello
yes this is perfect thank you.
GS
Gavin Seddon
Gavin Seddon le 14 Fév 2019
Hello, is it suitable to solve each quadratic equation in order to make comparisons? This is because I suspect the visual results will give a 'quadratic' relationship when plotted? If so will you please suggest a suitable command?
GS.
Walter Roberson
Walter Roberson le 14 Fév 2019
I am not sure what you mean by "solve each quadratic equation" ? Perhaps you want to double() the result of solve() to get the floating point equivalent ?
Gavin Seddon
Gavin Seddon le 15 Fév 2019
Hello, DOUBLE gave unusual answers
whilst simplify to give 2 numbers did not work.
How would I accomplish this?
GS.
Walter Roberson
Walter Roberson le 15 Fév 2019
Give an example of the kind of output you want to see, taking into account that the exact solution will involve sqrt()
Gavin Seddon
Gavin Seddon le 18 Fév 2019
Hello, I presumed SIMPLIFY (ans) would give two numbers. One of which is about 13.5(expected) yet it returned the same number. Does this help?
GS.
Gavin Seddon
Gavin Seddon le 19 Fév 2019
Hello, I assume you mean the quadratic should be expanded and the rooted? Are there Matlab commands for this? Sorry I forgot this is a different itteration than the one that I am using. It maybe anything between 11 and 15.
GS.
Walter Roberson
Walter Roberson le 19 Fév 2019
>> syms x
>> eqn = (4119*x^2)/10000 - (1787*x)/5000 + 891/2500 ==1
eqn =
(4119*x^2)/10000 - (1787*x)/5000 + 891/2500 == 1
>> solve(eqn)
ans =
1787/4119 - 29703253^(1/2)/4119
29703253^(1/2)/4119 + 1787/4119
Those last two lines are the two roots, expressed as algebraic numbers. double() of that gives two distinct values.
In general, it is possible for a quadratic to have two identical roots, such as x^2 - 4*x + 4 has two identical roots that are value 2.
It is also possible for the two roots to be nearly equal, including possibly to beyond the precision of double precision numbers, such as if the two roots were 1 +/- 1E-60 .
... None of this has to do with simplify()
Gavin Seddon
Gavin Seddon le 20 Fév 2019
Hello, thank you for this. Since it is not the root I need because I am comparing the time which y doesn't = 0 realising the time at which a change begins. I will measure this point from the graph manually.
GS.
Walter Roberson
Walter Roberson le 20 Fév 2019
I do not understand what you are trying to say there? That equation only equals 0 for complex valued x. The location of the minimum is at solve(diff(lhs(eqn),x),x) = 1787/4119 which is about 0.4338 .
Gavin Seddon
Gavin Seddon le 21 Fév 2019
HelloSorry for being mystical. The experiment measures crystal binding. Initially there is no change in y which begins at y== 1. It is the value of X at this point which is of interest rather than the root. Yet a single calculated number may be useful as a comparison for the iterations. GS.
Walter Roberson
Walter Roberson le 21 Fév 2019
The root calculated is the value of x at which v(x) is 1.
Your equation is a quadratic. It has two locations at which v(x) becomes 1.
It is possible that you are only interested in the larger of the two solutions, a point at which v(x) increases to 1 rather than decreasing to 1.
Gavin Seddon
Gavin Seddon le 13 Mar 2019
Hello,
is it possible to apply my derivative function (v(x)) to the second column of my table, to produce a third column which will verify my suppersition ? This will also make matters clearer, please?
GS.
Do you mean that the second column of your table contains x values ? If so then
YourTable.NewThirdColumn = double( subs( v, x, YourTable.{:,2}));
Gavin Seddon
Gavin Seddon le 14 Mar 2019
Hello,
mytable.NewThirdColumn = double( subs( v, x, MyTable.(2)));
was the command used and yes indeed it produced a third column.
The numbers revealed indicate the method I tried previously was indeterminate. Thank you
GS.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by