Good afternoon, I cannot seem to figure out how to fix my parse errors for this code. Any suggestions? Attached are the formulas I am using. Please note that the theta is in DEGREES, so I used both cosd & sind.
Thank you
Richard
Code Below:
%Task 2
%Variables
%Crank Angle, Theta
%Bore, B
%Stroke, L
%Compression Ratio, r
%Connecting rod length to crank-arm length a, ratio R=1/a
%Area of Cylinder head, Ach
%Area of Piston, Ap
%Crankshaft Rotational Speed, N [RPM]
%We are looking for Volume (theta),Area (theta), Piston Velocity Up (theta),
%First derivative of volume wrt theta (dV/d(theta)),
%First derivative of Area wrt theta, (dA/d(theta))
%Inputs
theta=15 %[degrees]
B = 14 %[inches]
L = 14 %[inches]
r = 9
R = 6
Ach = 231 %[inches^2]
Ap = 154 %[inches^2]
N = 1500 %[RPM]
%Equations
Vd= ((3.14159*(B^2))/4)*L %this equation works
Vc=Vd/(r-1) %this equation works
V = Vc*{1+0.5(r-1)*[(R+(1-cosd(theta))-((R^2)-sind^2(theta))^0.5]}
A=Ach+Ap+((3.14159*B*L)/2)[(R+1)-cosd(theta)-(R^2-sind^2(theta))^0.5]
Up=(3.14159*L*N*sind(theta)(cosd(theta)))/((R^2-sind^2(theta))^(0.5)+1)
%Output