Interpolating data from the graph

The graph shown is plotted ductility Vs Time period of a system for four diifferent Ry . What i needed is to find the Ry s for particular ductility demand ( say 2) for the time period varying from 0 to 20 as shown in the graph. The Ry s need to find out using interpolation of the given graphs ( ie, in between the four Ry s given). can someone help with this problem??

2 件のコメント

Cris LaPierre
Cris LaPierre 2020 年 12 月 30 日
Do you have the data that was used to create the figure?
subbu
subbu 2020 年 12 月 30 日

サインインしてコメントする。

 採用された回答

Cris LaPierre
Cris LaPierre 2020 年 12 月 30 日

0 投票

Ok, since you have all the data used to create the plot, you will just use the X and Y values as inputs to the interp1 function. For example, if I wanted to interpolate the values of each curve at T(s)=7, I would add the following to the bottom of your check.m script.
% interpolate at T(s) = 7
xq=7;
yq1 = interp1(Tn,meu1,xq);
yq2 = interp1(Tn,meu2,xq);
yq4 = interp1(Tn,meu4,xq);
yq8 = interp1(Tn,meu8,xq);
% visualize on the plot
plot(xq,yq1,'^')
plot(xq,yq2,'o')
plot(xq,yq4,'d')
plot(xq,yq8,'>')

7 件のコメント

subbu
subbu 2020 年 12 月 30 日
suppose let us fix meu as 2 (Y ordinate as 2). what i needed is the corresponding values of Rys for T(s)=0:0.05:20
Cris LaPierre
Cris LaPierre 2020 年 12 月 30 日
If I understood correctly, you want to interpolate a T(s) value from a known Y value. If os, then you would reverse what you are using as your x and y inputs to interp1. However, you're going to get into trouble here when Y<10, since there are multiple possible T(s) values for a given Y value.
subbu
subbu 2020 年 12 月 30 日
suppose let us fix the y ordinate as 2 ( ductility demand ) and the time period (T(s)) as 4, that will lead to a point in the graph among the four Ry plots ( Ry=1,Ry=2,Ry=4,Ry=8) i need the value of Ry for that particular ponit (4,2) as example,from the figure it can be seen that the Ry for the point (4,2) just below 2 (just below the orange plot Ry=2)( we can say maybe 1.9) just by looking in the figure (its a guess from the figure ) . i need the Rys for a series of points in the graph (x,2); x=(0:0.05:20) i hope you understand the question
Cris LaPierre
Cris LaPierre 2020 年 12 月 30 日
So you want to pick a point, and determine which curve is closest to it?
subbu
subbu 2020 年 12 月 31 日
Not closest. If we draw a series of curves maybe 1000 or more which curve will go through that point and what's the Ry of that curve
Cris LaPierre
Cris LaPierre 2020 年 12 月 31 日
編集済み: Cris LaPierre 2020 年 12 月 31 日
In that case, you need to interpolate twice. First to find the ductility values for all 4 known Ry lines, then again to guesstimate the Ry value of the actual point. I say guesstimate because this approach only works if you make some assumptions about Ry. Foremost is that Ry changes linearly.
% Use interpolation to estimate Ry line that passes through (4,2)
% interpolate at T(s) = 4
xq=4;
yq1 = interp1(Tn,meu1,xq)
yq2 = interp1(Tn,meu2,xq)
yq4 = interp1(Tn,meu4,xq)
yq8 = interp1(Tn,meu8,xq)
% Interpolate to find Ry line at ductility = 2
yq = 2;
Ryq = interp1([yq1 yq2 yq4 yq8],[1 2 4 8],yq)
Ryq =
1.8997
subbu
subbu 2020 年 12 月 31 日
yeah i think this willl do thanks for the help

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2020 年 12 月 30 日

コメント済み:

2020 年 12 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by