help-octave
[Top][All Lists]

## Code Problem

 From: Richard Schumacher Subject: Code Problem Date: Wed, 19 Feb 2020 14:00:33 -0500

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:

%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 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 Screen Shot 2020-02-19 at 13.58.30.png
Description: PNG image Screen Shot 2020-02-19 at 13.58.42.png
Description: PNG image Screen Shot 2020-02-19 at 13.59.32.png
Description: PNG image