I'm trying to make a script in order to perform those two equation with summation:
((−b*σ*yn)/(2))+∑(−σ*(1-((yi)/(yn)))*ab*nbi,i,1,Nf)
and this:
((b*s*yn^(2))/(3))+∑(−σ*(1-((yi)/(yn)))(yi-yn)*ab*nbi,i,1,Nf)
My code is:
Prgm
Local b,h,n,nf,n_tot,mf,ub,lb,hi,ii,msg,y,yn,σ,ab,eq1,eq2
Disp ""
Request "b :",b
Request "h :",h
Request "Ab :",ab
Request "N : ",n
Request "Mf : ",mf
Request "N° tot : ",n_tot
Request "N° over N-A : ",nf
newMat(nf,2)→hi
For ii,1,nf,1
Request "h i-i:",msg
msg→hi[ii,1]
Request "b i-i:",msg
msg→hi[ii,2]
EndFor
Disp "matrix",hi
newMat(1,1)→eq1
newMat(1,1)→eq2
For ii,1,nf,1
((-b*σ*yn)/2) + (−σ*(1-((hi[ii,1])/(yn)))*ab*hi[ii,2])→eq1[ii,1]
((b*s*yn^2)/3) + (−σ*(1-((hi[ii,1])/(yn)))*(hi[ii,1]-
yn)*ab*hi[ii,2])→eq2[ii,1]
EndFor
Disp "eq1:",eq1
Disp "eq2:",eq2
Disp "solution",solve(eq1[1,1]=n and eq2[1,1]=mf+n(0.5*h+yn),{yn,σ})|yn>0
EndPrgm
But i get : "Error: Variable is not defined"
I do not understand why i get this error, what i'm doing wrong? Any hints will be appreciated,i'm new in programming.
Solved: the problem was in Local variable definition.
So I've just cancelled the variables that are used in the command "solve()". That's all.