calculating x when y is > 0

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 Comments

Hello, I tried
solve (x)
ans =
0
does this help?
GS.
Are you asking or stating?

Sign in to comment.

 Accepted Answer

Walter Roberson
Walter Roberson on 14 Feb 2019
solve(v(x)==1,x)

16 Comments

expect two solutions as it is a quadratic .
hello
yes this is perfect thank you.
GS
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.
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 ?
Hello, DOUBLE gave unusual answers
whilst simplify to give 2 numbers did not work.
How would I accomplish this?
GS.
Give an example of the kind of output you want to see, taking into account that the exact solution will involve sqrt()
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.
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.
>> 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()
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.
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 .
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.
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.
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}));
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.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!