Hello everyone. I am new on the forum, and also quite new to c++. Currently I develop some computational program, and have a problem with implementation of the formula(s). Let me explain this. I want to obtain smix:
Name:  2.png
Views: 102
Size:  4.0 KB
wherein sk:
Name:  1.png
Views: 77
Size:  6.2 KB
k = 0 - 4 (this is just naming for the 5 different substances, because the program computes some property of these substances, and the property of its mixture)
x is a scalar, there are 5 such a scalars (for every k), so I put them into one vector
dk, that is d0 - d4 are the 11 element coefficient vectors
in the formula b is the 10 element vector, whose indexing begins from 1 (this is in the document from which the above formulas come), in the program indexing begins from 0, so bi element from the formula is b[i-1] in my program.
I could simply implement this, no big deal - unless xk would not equal 0... When xk = 0, the natural logarithm cannot be computed, so i must add some checking if xk = 0, if yes the program should skip computing ln(xk) (sk should not be taken into account in that situation as well).
I have tried to implement for/if combination, but it seems to surpass me... So I am kindly asking you - people of good will - to help me resolve the problem. I am stuck with this for a "while" and because of that kinda frustrated. I will be very, very very grateful for help. Thanks in advance.