Want to plot theoretical curve
이전 댓글 표시
I want to plot this two equation . actually these are two theoretical model. I do not have any data for i and t. I know the form of the curve and attaching the plot. I was trying by using some value for t , but getting half bell shaped curve.
equations are i^2/(〖i2〗_max^ )=1.2254(t_mAX/t){〖1-exp[-2.3367( t^2/(t_max^2 ))]}〗^2 i^2/(i_max^2 )=1.9542(t_mAX/t){〖1-exp[-1.2564( t/(t_max ))]}〗^2
Matlab code
x=(1:20);
A=(x./max(x));
C=(A).^2;
for i=1:20
D(i)=[1.2254*(1./A(i))*[1-exp(-2.3367.*C(i))]^2];
end
plot (C,D)

댓글 수: 3
Image Analyst
2014년 6월 22일
I have two questions
- Do you have a question ? Or are you merely telling us what you're going to do?
- If you want us to fix your code, can you attach your code with the paper clip icon?
Star Strider
2014년 6월 22일
Create a vector for t/t_max as:
ttm = linspace(0,5);
then take it or its inverse (use (1./ttm) for the inverse, and (ttm.^2) or ((1./ttm).^2) — note the ‘.’ — for the squared terms) and use that in your equation. If you simply want to plot the curve, it’s not necessary to know what t or t_max actually are.
sudipta
2014년 6월 24일
답변 (1개)
Roger Stafford
2014년 6월 24일
The scale factors 1.2254 and 2.3367 in your first theoretical equation have been so chosen that the function
f(z) = 1.2254/z*(1-exp(-2.3367*z^2))^2
attains a maximum value of 1 just at z = 1. Since z here is simply a ratio t/t_max where t_max indicates the value of t where f(t/t_max) attains its maximum value, there is no way you can plot the value of f(t/t_max) against just the variable t without further information. Similarly there is no way you can plot just i without some further information about i_max. If you know both t_max and i_max, you could then find the i against t curve with:
i = i_max*sqrt(f(t/t_max))
A similar statement holds for the second theoretical equation.
In other words you cannot plot the curve of i against t just from the plot you have exhibited above without also knowing both i_max and the corresponding t_max.
(Note: Calling it t_max is somewhat misleading because it refers to a value of t where i is maximum.)
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!