From: Vishal P on
Hello there,
Can anyone help me out with as i need to plot figure of T vs Theta but the problem is T is inter-link with V and V is interlink with theta. as shown below in code.
theta ranges from 180 to 360, so do V

I have tried writing this code but couldn't get the result

theta180 = 180;
theta360 = 360;
V181 = 181;
V360 = 360;
V1 = V180 = 0.0004494;

theta1 = theta180:1:theta330; % crank angle starting from 180 to 360 compression %
V = 181:1:360;

for i = 181:1:360
T(i+1) = (((V(i+1))/V1)^(1-gamma))*T1;
for V = (1 + 0.5*(18 - 1)*((R + 1 - cos(theta1(i)) - ((R^2 - sin(theta1(i))^2)^0.5))))*Vc;
end
end


please reply me as i have stuck on my work........it would be helpful


From: Ross W on
"Vishal P" <vishalbparmar(a)yahoo.com> wrote in message <i414qr$ev4$1(a)fred.mathworks.com>...
> Hello there,
> Can anyone help me out with as i need to plot figure of T vs Theta but the problem is T is inter-link with V and V is interlink with theta. as shown below in code.
> theta ranges from 180 to 360, so do V
>
> I have tried writing this code but couldn't get the result
>
> theta180 = 180;
> theta360 = 360;
> V181 = 181;
> V360 = 360;
> V1 = V180 = 0.0004494;
>
> theta1 = theta180:1:theta330; % crank angle starting from 180 to 360 compression %
> V = 181:1:360;
>
> for i = 181:1:360
> T(i+1) = (((V(i+1))/V1)^(1-gamma))*T1;
> for V = (1 + 0.5*(18 - 1)*((R + 1 - cos(theta1(i)) - ((R^2 - sin(theta1(i))^2)^0.5))))*Vc;
> end
> end
>
>
> please reply me as i have stuck on my work........it would be helpful
>
>

hi

your code is not at all clear - it not valid matlab syntax.
It's not legal to write
V1 = V180 = 0.0004494;
or to write

for V = (1 + 0.5*(18 - 1)*((R + 1 - cos(theta1(i)) - ((R^2 - sin(theta1(i))^2)^0.5))))*Vc;

I'll guess at what you want:
theta1=180:1:360;
R=1;Vc=1;gammavalue=.1;
V=zeros(size(theta1));T=zeros(size(theta1));
for i=2:numel(theta1)

V(i) = (1 + 0.5*(18 - 1)*((R + 1 - cos(theta1(i)) - ((R^2 - sin(theta1(i))^2)^0.5))))*Vc;
T(i+1) = (((V(i))/V(1))^(1-gammavalue))*T(1);

end

My guess is certain to be wrong. But it lets you see what legal matlab code looks like. You can edit it so that it does what you want.

Ross
From: Vishal P on
"Ross W" <rosswoodskiwi(a)hotmail.com> wrote in message <i43ap0$jjk$1(a)fred.mathworks.com>...
> "Vishal P" <vishalbparmar(a)yahoo.com> wrote in message <i414qr$ev4$1(a)fred.mathworks.com>...
> > Hello there,
> > Can anyone help me out with as i need to plot figure of T vs Theta but the problem is T is inter-link with V and V is interlink with theta. as shown below in code.
> > theta ranges from 180 to 360, so do V
> >
> > I have tried writing this code but couldn't get the result
> >
> > theta180 = 180;
> > theta360 = 360;
> > V181 = 181;
> > V360 = 360;
> > V1 = V180 = 0.0004494;
> >
> > theta1 = theta180:1:theta330; % crank angle starting from 180 to 360 compression %
> > V = 181:1:360;
> >
> > for i = 181:1:360
> > T(i+1) = (((V(i+1))/V1)^(1-gamma))*T1;
> > for V = (1 + 0.5*(18 - 1)*((R + 1 - cos(theta1(i)) - ((R^2 - sin(theta1(i))^2)^0.5))))*Vc;
> > end
> > end
> >
> >
> > please reply me as i have stuck on my work........it would be helpful
> >
> >
>
> hi
>
> your code is not at all clear - it not valid matlab syntax.
> It's not legal to write
> V1 = V180 = 0.0004494;
> or to write
>
> for V = (1 + 0.5*(18 - 1)*((R + 1 - cos(theta1(i)) - ((R^2 - sin(theta1(i))^2)^0.5))))*Vc;
>
> I'll guess at what you want:
> theta1=180:1:360;
> R=1;Vc=1;gammavalue=.1;
> V=zeros(size(theta1));T=zeros(size(theta1));
> for i=2:numel(theta1)
>
> V(i) = (1 + 0.5*(18 - 1)*((R + 1 - cos(theta1(i)) - ((R^2 - sin(theta1(i))^2)^0.5))))*Vc;
> T(i+1) = (((V(i))/V(1))^(1-gammavalue))*T(1);
>
> end
>
> My guess is certain to be wrong. But it lets you see what legal matlab code looks like. You can edit it so that it does what you want.
>
> Ross



Thanks a lot Ross, by the changing the values I found the graph.
Sorry about the way of writing the code, As I am totally new to Matlab so just learning.

Thanks again.
Vishal