predicting the trends of diagram

조회 수: 8 (최근 30일)
shahin hashemi
shahin hashemi 2018년 6월 5일
댓글: Image Analyst 2018년 6월 6일
dear all
i have 2 data point like this that come from nonlinear equations :
x=[13 8 6 5.5 5 4.9 4.8 4.795 4.792 4.791 4.77 4.76 ]
y=[0.154058581114650 0.149736758736220 0.144520156929792 0.141698370356069 0.136778534431870 0.135128381143846 0.132667849050780 0.132491826080336 0.132381996482185 0.132344176545640 0.131391601025611 0.130704833218502]
plot(x,y)
and when i plot these points i got following diagram
is there any way to predict at which point of x the y is equal to zero
thank you all
  댓글 수: 2
Star Strider
Star Strider 2018년 6월 5일
Be very careful with any extrapolation you do with these (or any other) data. The curve you posted could be part of a function that may never be close to 0.
If the points you plotted are from a deterministic equation, you do not need to interpolate. Simply calculate them.
Please do not ever extrapolate so far beyond the region of known data.
shahin hashemi
shahin hashemi 2018년 6월 5일
ty for your attention star strider
but im sure about existence of a point that has zero y

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2018년 6월 5일
You could try this:
x=[13 8 6 5.5 5 4.9 4.8 4.795 4.792 4.791 4.77 4.76 ]
y=[0.154058581114650 0.149736758736220 0.144520156929792 0.141698370356069 0.136778534431870 0.135128381143846 0.132667849050780 0.132491826080336 0.132381996482185 0.132344176545640 0.131391601025611 0.130704833218502]
plot(x,y, 'bs-')
grid on;
% Find coefficients of a line
[sortedX, sortOrder] = sort(x, 'Ascend');
sortedY = y(sortOrder);
coefficients = polyfit(sortedX(1:2), sortedY(1:2), 1);
% Line equation is y = coefficients(1) * x + coefficients(2)
% y=0 when x = -coefficients(2) / coefficients(1)
xWhenYEquals0 = -coefficients(2) / coefficients(1)
% Plot it.
hold on;
plot(xWhenYEquals0, 0, 'r*');
% Plot line from there tothe first data point.
plot([xWhenYEquals0, sortedX(1)], [0, sortedY(1)], 'r-');
If you want some other model, other than linear extrapolation of the left-most two points, let me know.
  댓글 수: 4
shahin hashemi
shahin hashemi 2018년 6월 6일
편집: shahin hashemi 2018년 6월 6일
it s nonlinear equation fill with sin and cos or their square that i solve them with f solve and about the physics i should mention that my x axis is torque that exerted to a system and y axis is minimum eigenvalue of the stability matrix
and as it is obvious when torque Decrease from 13N y axis is decrease too and at 4N diagram drop dramatically and i know my zero point is somewhere between x=4.758 and x =4.755
i can calculate the point that i want but every time i run my code it takes about 45 min to solve that
thanks again for your attention
and if its necessary i show my code ?
Image Analyst
Image Analyst 2018년 6월 6일
Just give me an equation like y = a1 * sin(a2*x) + a3 * cos(a4*x).^2 or whatever you expect the theory to be. The a's would be the unknowns to be solved for.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2018년 6월 5일
You can fit a line between the left two points and extrapolate. Or do you have some model/equation you think the whole curve follows, and if so do you have the stats toolbox?
  댓글 수: 1
shahin hashemi
shahin hashemi 2018년 6월 5일
ty for your attention
but i dont have any equation
can u please explain more about "You can fit a line between the left two points and extrapolate" this part of your answer
is there any cod or tool box for extrapolate or how should i do that ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrix Computations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by