numeric ODE system of equations function fails

jsmeyer's picture

I cannot convince SWP5.5 to solve the example from the help files. I can't get the answers to display. See the attached TEX file. What am I doing wrong, please?

AttachmentSize
ode-failure.tex2.19 KB
texab's picture

I got this answer from Solve

I got this answer from Solve ODE, Exact

{[x(t)=(1/7)i√7e^{(3/2)t-(1/2)i√7t}-(1/7)i√7e^{(3/2)t+(1/2)i√7t}+1,y(t)=(1/2)e^{(3/2)t-(1/2)i√7t}+(1/2)e^{(3/2)t+(1/2)i√7t}-(1/(14))i√7e^{(3/2)t-(1/2)i√7t}+(1/(14))i√7e^{(3/2)t+(1/2)i√7t},z(t)=(1/7)i√7e^{(3/2)t+(1/2)i√7t}-(1/7)i√7e^{(3/2)t-(1/2)i√7t}+1]}

jsmeyer's picture

Thank you for taking the

Thank you for taking the trouble to send me the exact solutions. I apologize, for I apparently misled you. I was trying to get the NUMERIC solver working. I have a much more set of equations which do not possess an exact solution. I was trying the example from the book only to try to learn how to effect the numeric solution. I am still struggling with that.

I deleted everything in your

I deleted everything in your document except for the matrix at the beginning of the document.  I then used Compute, Definitions, Clear Definitions.  I then placed the cursor immediately following the matrix (it could also have been inside the matrix) and selected Compute, Solve ODE, Numeric.  This returned "Functions defined: x,y,z".  I then added x(1.1), y(1.1), and z(1.1) to the document and evaluated each one.  A numeric value was returned for each one.  This seems to indicate things are working properly for me.

Attached is a screen capture of the document after the above steps were completed.

jsmeyer's picture

I, too, was able to get

I, too, was able to get single elements. But I was trying to generate matrices and tables and graph ala pages 419 and 420 in the manual by Hardy and Walker, titled Doing Mathematics with Scientific Workplace and Scientific Notebook, Version 5.5

I think I believed that the table on 420 would be automatically generated...apparently not; if I have 1000 values of the independent variable, I must by hand display each and every one separately. I thought the trick using the "g(i)" function would work; but it doesn't.

Thanks for bailing me out again, George. You are really an expert on SWP.

pax
Jim Meyer

Using the g(i) method worked

Using the g(i) method worked for me.  Did you remember to add square expanding brackets around the generated matrix?

jsmeyer's picture

Yes, I "sort of" have it

Yes, I "sort of" have it working now. I followed the example on page 113 of the Hardy Walker book. The example uses "curved " delimiters, not square ones, and it works fine in the ODE portion too. It was absolutely necessary to put in the delimiters "by hand" and not from the matrix template generator, it seems. Also we are limited to only 30 rows in the table with each iteration.

This should keep me occupied through the weekend!

Thanks again for your help.
Pax
Jim Meyer

John MacKendrick's picture

Instead of using a matrix

Instead of using a matrix with built in delimiters, try entering a matrix, highlighting it and manually adding delimiters by pressing Ctrl+[.

 

jsmeyer's picture

Yes, I "sort of" have it

Yes, I "sort of" have it working now. I followed the example on page 113 of the Hardy Walker book. The example uses "curved " delimiters, and it works fine in the ODE portion too. It was absolutely necessary to put in the delimiters "by hand" and not from the matrix template generator, it seems.

Thank you, Mr. McKendrick. You, like George, are truly a genius.

Now to try to plot the solutions. This should keep me occupied through the weekend!

Pax
Jim Meyer

texab's picture

No I did not succeed either

No I did not succeed either with NUMERIC.

jsmeyer's picture

George and John gave some

George and John gave some excellent suggestions. Also see page 113 and pages 419-420 of the Hardy-Walker book on Doing Mathematics with Scientific Workplace & Scientific Notebook, Version 5.5

Thanks again for your efforts on my behalf.

Pax
Jim Meyer