Message Boards Message Boards

GROUPS:

CompiledFunction: argument position 1 should be a machine-size real number

Posted 2 months ago
493 Views
|
3 Replies
|
2 Total Likes
|

Hello dear community,
I'm really spending a lot of time trying to understand what is wrong with my code. I'm solving a model starting at arbitrary initial conditions. When I do I get this error message. I'm really new in using Mathematica and this problem is very preventing me to continue in my work. Can someone help me figure out what's wrong (suggest some solutions) please? Code is attached.

Thank you in advance for your help!
Fansa

Attachments:
3 Replies

The message indicates there is a non-numeric value in Compile code that expects a number. It is caused by presence of a symbol, a, that has not been assigned a numeric value. So that might be a starting point for debugging the problem.

Posted 2 months ago

That was exactly the problem. It works perfectly! Thank you very much for your response.

Now my biggest issue is concerning the saving of the results. Indeed, I need to save the results from this notebook in order to be able to use them later on in another notebook. I write the code for that. Basically I get a file which is suppose to contain my result (Fansatest). But when I try to call the results back, the code takes a while despite the fact that I set the number of replications Rep=0. For example, for rep=9, the results should be the results should be. But now when I run all the notebook till the last cell with contain the code to save the result. I get the file (Fansatest), the name I give to it. Now to call the result, (please uncomment << "Fansa_test"; at this stage) in case you are testing the code), set init="old" instead of init="new" (to call the stored solution) and set the number of replications Rep=0. The aim is to have the same results (just to load them). But the results don't show up. I get a long list of values. here is the code

Attachments:

Welcome to Wolfram Community!
Please make sure you know the rules: https://wolfr.am/READ-1ST
Please do NOT post massive code and ask to debug it. Minimize your questions to concise code examples pinpointing your issue.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract