Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot perform simulation in Matlab, (version 7.4.0), error while setting the Trees #96

Open
ghost opened this issue Feb 15, 2019 · 22 comments
Labels

Comments

@ghost
Copy link

ghost commented Feb 15, 2019

Hi all, I'm trying to use Matlab 2018b (academic license) 64 bit on Windows 10, the OSP version I am currently using is the 7.4.0, and as showed in the picture I posted below, I'm having problems to perform simulation using Matlab.
I've already noticed that in this forum there is a similar post about this problem, but even reading that one, I don't understand what is the reason why I cannot perform any simulation (maybe the problem is different because that one was about an old version), and I have no idea what exactly I have to do to solve my problem.
I need to plot GIM_Healthy.xml model, but I'm stucked since days and I don't know what else I can do to solve.
Could please someone try to explain me step by step, what are the files/folders that I must locate in some certain Matlab folders to allow my simulation to be performed without errors?

Please if you can try to explain in a simply and specific way.
Any help and advice will be very appreciate.

Thanks in advance.

screenshot1

Edit: When I try to open the same xml file for the second time (exactly the second time, cause the first time I always have the error 1) in the GUI to perform the simulation, I don't get the error 1 while setting the Tree, I get "please wait, model is getting initialized" or something like that, but after a few of seconds Matlab get closed without showing any error (I suppose that it crashes, but I don't have idea why is this happening).

@StephanSchaller
Copy link
Member

There was another thread with an issue with Matlab 2018b and reinstall helped.

Nevertheless: do any other xml files work when trying the same workflow?

As a note: if you have any questions on the GIM, you can reach out to me ([email protected]) in case you are also looking for preclinical GIM models or other extensions.

@ghost
Copy link
Author

ghost commented Feb 16, 2019

Thanks for your reply, but unfortunately I've already tryied to reinstall Matlab and to open other .xml files with the Gui of generateMatlabCodeForXML.m and I have still the same problem with Matlab (I need it to perform a simulation of an OGTT with the specific values of a particular individual developed with pk-sim, to check how much his blood values are different from the original ones).

@msevestre
Copy link
Member

Can you run some scripts without using the UI? The UI does nothing more than generating some Matlab scripts on your behalf.

@ghost
Copy link
Author

ghost commented Feb 16, 2019

Yes, I can run and plot .m scripts

@msevestre
Copy link
Member

I am not sure what this plot.m is. Does this script initiate some calls to the toolbox? E.g.load a simulation, set parameters etc? If yes, then yiuycan for the time being bypass the UI all together and simply reuse a previous script and adapt it for your need. Does it make sense?

@ghost
Copy link
Author

ghost commented Feb 16, 2019

Sorry maybe I misunderstood the previous question, what I meant is that at the moment I am using Matlab to run .m scripts (none of these uses some functions or similar related to Mobi toolbox), and they work perfectly (just to say that for the rest Matlab seems to work fine), I have problems only when I run generateMatlabCodeForXML.m and I try to open a xml file using the Ui

@Yuri05
Copy link
Member

Yuri05 commented Feb 16, 2019

@Dictatrix In your very first message one can see some error messages (unfortunately partly hidden).
Would be good to see them completely.

Can you please:

  • restart Matlab
  • add path (recursively) to the OSP Matlab toolbox (addpath(genpath(...))
  • execute initSimulation(<path_to_gim_Model>, []) (e.g. initSimulation('C:\Gim.xml', []) )
    Do you observe any errors or warnings? If so, please attach them here.

@ghost
Copy link
Author

ghost commented Feb 16, 2019

Yes, I have these two:
screen

@Yuri05
Copy link
Member

Yuri05 commented Feb 16, 2019

Did you install the Matlab-Toolbox as part of the OSP-Suite setup?
If not, please do so:

  • install the OSP Suite
  • remove path to ...\User\Desktop\Matlab-Toolbox-Core-master from Matlab search path
  • use the installation path of the Matlab-Toolbox, which per default would be
    C:\Program Files\Open Systems Pharmacology\MoBi Toolbox for Matlab 7.4

@ghost
Copy link
Author

ghost commented Feb 18, 2019

I've tryied to do that
screen
, but when I run generateMatlabCodeForXML.m I still have that error.

I have also noticed that when I run GIM_simulations.m I have 2 errors
screen2
, and in the figure window I have only one graphic (the first one), but they should be 12
screen3

@StephanSchaller
Copy link
Member

when I run GIM_simulations.m I have 2 errors

The script (GIM_simulations.m) for running the simulations has been written for MATLAB 2015b. I guess the legend method (and possibly others) has changed since then and now requires different arguments.

To correct this, you will have to edit GIM_simulations.m and update it to run with 2018b. Otherwise we might find the time to do so in the near future (no promises, @PavelBal).

@Yuri05
Copy link
Member

Yuri05 commented Feb 18, 2019

I've tryied to do that, but when I run generateMatlabCodeForXML.m I still have that error.

So if I understand you correct, you were able to execute initSimulation(<path_to_gim_Model>, []) without errors but still get the error in generateMatlabCodeForXML?

@ghost
Copy link
Author

ghost commented Feb 18, 2019

No, when I run initSimulation I have these 2 errors
screen1, and when I run generateMatlabCodeForXML.m I have this one
screen0

@StephanSchaller
Copy link
Member

So how did you manage to run GIM_simulations.m and actually produce at least one curve (as shown in the image above for the IVGTT?

GIM_simulations.m also calls initSimulation at some point…?

@ghost
Copy link
Author

ghost commented Feb 18, 2019

I've just runned it adding these 3 folders (with subfolders) in the path
screen1

@Yuri05
Copy link
Member

Yuri05 commented Feb 18, 2019

Your Matlab path is totally messed up. As already told: remove all of this except
C:\Program Files\Open Systems Pharmacology\MoBi Toolbox for Matlab 7.4 (and its subfolders)

@msevestre msevestre transferred this issue from Open-Systems-Pharmacology/Forum Feb 18, 2019
@msevestre
Copy link
Member

@ALL: I moved the issue to the Matlab Toolbox repo to avoid unnecessary notifications in the forum as this seems to be either an issue with the toolbox or a configuration issue.

@msevestre
Copy link
Member

@Yuri05 For example it would be great if the message "SimModel.xsd" not found would tell us in which folders the schema was being searched (or which Schema paths were attempted). At least it would be much clearer for the user to realize that something is missing and easier for us to spot what is missing

@ghost
Copy link
Author

ghost commented Feb 18, 2019

I've already tried to remove all except this C:\Program Files\Open Systems Pharmacology\MoBi Toolbox for Matlab 7.4 (and its subfolders), but I still have that error, I just can try to uninstall and reinstall all again

@Yuri05
Copy link
Member

Yuri05 commented Feb 18, 2019

  • Restart Matlab
  • Add path to the MoBiToolbox
    addpath(genpath('C:\Program Files\Open Systems Pharmacology\MoBi Toolbox for Matlab 7.4'))
  • Execute which('MoBiSettings')
    This will show the location of MoBiSettings.m, which must be in the matlab_toolbox_core\code subfolder of the Matlab toolbox (s. screen). If it's not the case: your Matlab path is not properly set (e.g. contains entries to the development version of the Matlab-Toolbox)
  • Execute MoBiSettings
    No error should be produced

Now you can save your Matlab path permanently (no need for addpath in every new session) and try initSimulation with e.g. the GIM model.
Once initSimulation was successfull, you can start generateMatlabCodeForXML

grafik

@PriKalra
Copy link

Hi,

Thank you for the detailed explanation on the debugging. I recently encountered this error on one of my model files files in matlab. I am not really sure what variableParameters is it referring to?

initSimulation('C:\temp\28032019_BM_noRenal.xml')
Error using initSimulation (line 91)
input "variableParameters" is missing

@Yuri05
Copy link
Member

Yuri05 commented Mar 28, 2019

@PriKalra Please open new GitHub-issues for new topics, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants