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 件のコメント
Gavin Seddon
2019 年 2 月 14 日
Hello, I tried
solve (x)
ans =
0
does this help?
GS.
madhan ravi
2019 年 2 月 14 日
Are you asking or stating?
採用された回答
Walter Roberson
2019 年 2 月 14 日
solve(v(x)==1,x)
16 件のコメント
Walter Roberson
2019 年 2 月 14 日
expect two solutions as it is a quadratic .
Gavin Seddon
2019 年 2 月 14 日
hello
yes this is perfect thank you.
GS
Gavin Seddon
2019 年 2 月 14 日
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
2019 年 2 月 14 日
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
2019 年 2 月 15 日
Hello, DOUBLE gave unusual answers
whilst simplify to give 2 numbers did not work.
How would I accomplish this?
GS.
Walter Roberson
2019 年 2 月 15 日
Give an example of the kind of output you want to see, taking into account that the exact solution will involve sqrt()
Gavin Seddon
2019 年 2 月 18 日
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
2019 年 2 月 19 日
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
2019 年 2 月 19 日
>> 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
2019 年 2 月 20 日
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
2019 年 2 月 20 日
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
2019 年 2 月 21 日
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
2019 年 2 月 21 日
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
2019 年 3 月 13 日
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.
Walter Roberson
2019 年 3 月 13 日
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
2019 年 3 月 14 日
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.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Line Plots についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
