This question is an exact duplicate of:

I am trying to use 27 simultaneous differential equations to model the cardiovascular system. I have the following code, however, the output isn't giving interpolating functions, but rather another rearrangement in terms of NDSolve. Can anyone help me?

enter image description here


marked as duplicate by Sjoerd C. de Vries, C. E., Michael E2, J. M. will be back soon Jun 18 '15 at 23:39

This question was marked as an exact duplicate of an existing question.

  • $\begingroup$ Please, don't ask a new question -- you can edit your old one. And also don't use images -- post properly formatted code. $\endgroup$ – Sektor Jun 18 '15 at 19:56
  • $\begingroup$ Ok. However, I do not know how to fix or edit the code, and format it properly. $\endgroup$ – Rama Jun 18 '15 at 19:58
  • 1
    $\begingroup$ I see that you are using square brackets as parentheses. Square brackets should only be used for function calls. If you are starting programming in a new programming language you're supposed to read up a bit about basic syntax, you should not be guessing it. $\endgroup$ – Sjoerd C. de Vries Jun 18 '15 at 20:11
  • $\begingroup$ In the upper right corner of the question edit box there is a help button, marked with a question mark. $\endgroup$ – Sjoerd C. de Vries Jun 18 '15 at 20:18
  • $\begingroup$ You also use curly brackets as parenthesis. Again, you cannot use arbitrary symbols as you like in a programming language. They may have a predefined function other than what you think they have. $\endgroup$ – Sjoerd C. de Vries Jun 18 '15 at 20:21

It would help a lot if you write each of the equations separately and name them appropriately; e.g. eq1, eq2, eq3... etc. Then you can use NDSolve routine to try and solve the system (along with the boundary/initial conditions).

Also, try formatting your code properly so that the stack-exchange community can help you more easily. From a quick view of the picture above, it seems that Mathematica does not recognize as equations those arguments that you have. Try avoiding the use of subscripts (you can type f0 instead of $f_0$). Always use parentheses instead of arbitrary symbols (curly brackets etc.), as Sjoerd C. de Vries correctly pointed out in his comment.

  • $\begingroup$ Thank you for the help. I am still correcting the code. However, one question. When you say to type in f0 instead of the subscript, do you mean in Mathematica as well? Or just on StackExchange? Thank you so much $\endgroup$ – Rama Jun 19 '15 at 16:56
  • $\begingroup$ I mean in Mathematica. On SE use pre-formatted input for code and modify it when applicable. $\endgroup$ – Dimitris A. Jun 19 '15 at 17:21
  • $\begingroup$ Ok, so I did what you said.... but it still gives me the equation rearranged. Are the parameters right? And it says to use an argument? $\endgroup$ – Rama Jun 19 '15 at 20:05
  • $\begingroup$ It could be easier to understand the problem if you copy-paste the mathematica code here and the messages that you get. And of course, use the pre-formatted method for inputing code. It makes it much more readable and in this case it is easier for more people to get involved and help you. $\endgroup$ – Dimitris A. Jun 20 '15 at 20:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.