- 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?
Want to plot theoretical curve
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164675/image.png)
3 commentaires
Star Strider
le 22 Juin 2014
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.
Réponses (1)
Roger Stafford
le 24 Juin 2014
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.)
0 commentaires
Voir également
Catégories
En savoir plus sur Yield Curves dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!