MATLAB-apm-url problem

18 views
Skip to first unread message

Birsen

unread,
Sep 1, 2022, 5:18:34 PM9/1/22
to apmonitor
Hi,
I am using MATLAB with apm (APMonitor) to find the parameters of an equation but I got an error :

"Error using urlread
The value of 'url' is invalid. Expected input to be one of these types:
char
Instead its type was java.net.URL."
Does anyone knows how to fix this?
Thank you in advance

here is the code:

% Add APMonitor toolbox available from
addpath('apm')
% server and application
a = 'regression';
% clear any prior application
apm(s,a,'clear all');
% load model and data files
apm_load(s,a,'model.apm');
csv_load(s,a,'data.csv');
% configure parameters to estimate
apm_info(s,a,'FV','a');
apm_info(s,a,'FV','b');
apm_info(s,a,'FV','c');
apm_option(s,a,'a.status',1);
apm_option(s,a,'b.status',1);
apm_option(s,a,'c.status',1);
apm_option(s,a,'nlc.imode',2);
% solve nonlinear regression
output = apm(s,a,'solve');
disp(output)

John Hedengren

unread,
Sep 1, 2022, 5:21:37 PM9/1/22
to apmo...@googlegroups.com
Birsen,

Please check that your MATLAB version is 2014+ and that you are
connected to the Internet. If either of those is a problem, I
recommend that you try Python Gekko that doesn't require an internet
connection in local mode. There is also a way to call Gekko from
Matlab: https://apmonitor.com/che263/index.php/Main/MatlabCallsPython

Best regards,
John Hedengren
> --
> --
> APMonitor user's group e-mail list.
> - To post a message, send email to apmo...@googlegroups.com
> - To unsubscribe, send email to apmonitor+...@googlegroups.com
> - Visit this group at http://groups.google.com/group/apmonitor
> ---
> You received this message because you are subscribed to the Google Groups "apmonitor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to apmonitor+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/apmonitor/35066f16-3255-4fc3-9592-824052e85071n%40googlegroups.com.



--
Best regards,

John Hedengren
GEKKO Optimization Suite
https://machinelearning.byu.edu

Bircan

unread,
Sep 1, 2022, 8:48:53 PM9/1/22
to apmo...@googlegroups.com
Hi John,

Thank you for your response. I am using MATLAB 2022a and I have no internet issues. Someone in MATLAB group mentioned that the path might be a problem. The apm  folder is in the same folder where my MATLAB script is. I still have not resolved yet.

You received this message because you are subscribed to a topic in the Google Groups "apmonitor" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/apmonitor/zjhSISh14kI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to apmonitor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/apmonitor/CAGNFaLHw2f%2BUHeScTqDed7%2BfShQd6A5zFfFyKDtN%3DqngVnuC%3DQ%40mail.gmail.com.


--
Birsen
Reply all
Reply to author
Forward
0 new messages