Calculate an unknown equation coefficient

 Accepted Answer

You can certainly use fminsearch for your problem, however since you are regressing a linear system, you can use mldivide,\ (link) effectively:
X = randi(9, 10, 3); % Define ‘X’ As A (Nx3) Matrix
Y = randi(9, 10, 1); % Define ‘Y’ As A (Nx1) Matrix
DM = [ones(size(X,1),1) X.^2]; % Design Matrix
abcd = DM \ Y; % Estimate Parameters
fid = 1;
fprintf(fid, 'a = %5.2f\nb = %5.2f\nc = %5.2f\nd = %5.2f\n\n', abcd)
Your system is linear because the partial derivatives of the parameters are not functions of themselves or of other parameters. If they were, your system would be nonlinear, and fminsearch would be an appropriate solver.
I created ‘X’ and ‘Y’ here to demonstrate the code (and to test it to be certain I had not made any errors in coding it). Substitute your own data for them.
I have no experience with Aspen Plus® (link) so I cannot help you with it.

4 Comments

Ahmed Alketife’s Answer nmoved here:
Hi mate,
Many thanks.
Regards, Ahmed
My pleasure.
If my Answer helped you solve your problem, please Accept it!
(You will have to un-accept your own accepted answer first.)
AAK
AAK on 8 Apr 2018
Edited: AAK on 8 Apr 2018
Hi mate,
It's, indeed, very helpful. Thanks again.
If my Answer helped you solve your problem, please Accept it!

Sign in to comment.

More Answers (6)

AAK
AAK on 8 Apr 2018
Hi mate,
Many thanks.
Regards, Ahmed
AAK
AAK on 8 Apr 2018
No worries mate,
Sure, accepted, please let me know if anything else is required!

1 Comment

You first must un-accept your Answer in order to Accept my Answer.

Sign in to comment.

AAK
AAK on 8 Apr 2018
How to do this? because of I already clicked on my profile photo, I found this option is already accepted, whereas your has no option like that? would please clarify?
AAK
AAK on 8 Apr 2018
Thanks for this.
Cheers,
AAK
AAK on 8 Apr 2018
Edited: AAK on 22 Apr 2018
Thanks

1 Comment

The only links I can find that may be relevant are:
You may need to use the Contact Us link in the upper right corner of this page to ask MathWorks any other questions you may have about using MATLAB with Aspen Plus.

Sign in to comment.

Categories

Asked:

AAK
on 7 Apr 2018

Edited:

AAK
on 22 Apr 2018

Community Treasure Hunt

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

Start Hunting!