How to write this equation into code?

I currently have it in this form and I am getting a weird answer:
eqn3 = ((Ac*Pul)/(alpha*CF*miu))*((((Rm*Ac)/(alpha*CF))^2)+(((2*Ac)/(alpha*CF))*((Rm*Vcf)+((alpha*CF*(Vcf^2))/(2*Ac))+((Ac*Pul*(t-tcf))/miu))))^-(1/2) == Vt2;

답변 (1개)

KSSV
KSSV 2018년 5월 4일

0 개 추천

When you have such a complex equation......it is confusing to type whole equation at once......try to type term by term and then see the answer.
T1 = Ac*Pul/(alpha*CF*mu) ;
T2 = (Rm*Ac/(alpha*CF))^2 ;
T3 = (2*Ac/(alpha*CF))*(Rm*VCF+(alpha*VCF^2)/(2*Ac)+(Ac*Pul*(t-tCF)/mu)) ;
J = T1*(T2+T3)^(-1/2) ;

댓글 수: 3

Bryan Lee
Bryan Lee 2018년 5월 4일
Thank you for your input. I tried this and it did not work. It is still giving me a strange answer. Would you like me to give you the values of the constants?
Image Analyst
Image Analyst 2018년 5월 4일
We can't do much else until you do. The formula looks correct. Give values for all the variable, and your expected answer that is known to be correct.
Bryan Lee
Bryan Lee 2018년 5월 4일
편집: Walter Roberson 2018년 5월 5일
the equation is set equal to Vt2, and I am solving for the variable 't'. The expected value of t is 2925.24, but I am getting 725764499.359.
CF = 4.5; % kg/m^3
Ac = 0.0018; % m^2
Vt1 = (1e-5)/60; % m^3/s
P0 = 2068.43; % Pa
Pul = 172368.93233; % Pa
miu = 1e-3; % Pa?s
alpha = 3.8e12; % m/kg
Rm = 22339043999.99; % m^-1
tcf = 1161.628; % s
Vcf = 0.0001936; % m^3
Vt2 = 8.333e-08; % m^3

댓글을 달려면 로그인하십시오.

질문:

2018년 5월 4일

편집:

2018년 5월 5일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by