Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The absolute viscosity can be found using, abs. viscosity = 10 c-7 where C=10 Aj

ID: 3625226 • Letter: T

Question

The absolute viscosity can be found using, abs. viscosity = 10c-7 where C=10Aj-Bjlog10(T0) and T0 = 255.3722+(5/9)T.  Create a function called oil viscosity that returns the abs oil viscosity.  The function has 3 input parameters a temperature array, the elements in an array and oil weight number.  The function returns an array of viscosities based on the temperature array. Create a test drive program that creates a table based on temperatures from 200 to 400 F in 20 increments.  User input is not required.

For SAE 10: j=1, Aj=9.1209, Bj=3.5605

For SAE 20: j=2, Aj=9.1067, Bj=3.5385

For SAE 30: j=3, Aj=8.9939, Bj=3.4777

For SAE 40: j=4, Aj=8.9133, Bj=3.4292

For SAE 50: j=5, Aj=8.5194, Bj=3.2621

For SAE 60: j=6, Aj=3666, Bj=3.1884

Explanation / Answer

#include "stdafx.h"

#include <iostream>

#include <math.h>

using namespace std;

double* oilViscosity(int[],int,int);

double aj[]={9.1209,9.1067,8.9939,8.9133,8.5194,8.3666};

double bj[]={3.5605,3.5385,3.4777,3.4292,3.2621,3.1884};

void main()

{

int temp[]={200,220,240,260,280,300,320,340,360,380,400};

double *visca[6];

for(int i=10,j=0;i<=60;i=i+10,j++)

visca[j]=oilViscosity(temp,11,i);

cout<<"temperatures: "<<endl;

for(int i=0;i<11;i++)

cout<<temp[i]<<" ";

for(int i=0,k=10;i<6;i++,k=k+10)

{

cout<<k<<" ";

for(int j=0;j<11;j++)

cout<<fabs(visca[i][j])<<" ";

cout<<endl;

}

system("pause");

}

double* oilViscosity(int temp[],int size,int weight)

{

double *v;

double array[11];

int j=weight/10;

v=array;

for(int i=0;i<size;i++)

{

double t0=255.3722 + (5/9) *temp[i];

double c=pow(10,aj[j-1]-bj[j-1]*log10(t0));

double vis=pow(10,c-7);

array[i]=fabs(vis);

}

return v;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote