Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am attempting to make a plot of the solution an ODE. I want to plot the solution using PolarPlot, x is the polar angle in this case. I cannot get Mathematica to make a plot, and I'm not sure where I'm going wrong. I tried going about it this way:

sol = DSolve[r'[x] == Sqrt[-r[x]^2 - 2*A*r[x]^5 + 3*A^[2/3]*r[x]^4], r[0] == 0, r[x], x]
PolarPlot[sol, {x, 0, 8*Pi}] 

but nothing is produced on the graph. Is this wrong?

share|improve this question
4  
You cannot ignore the error messages Mathematica puts out and then expect it to work. A^[2/3] is not a valid expression. The expression must be put in curly brackets if you provide a boundary condition. DSolve provides the result as a Rule you cannot plot a rule straight up. Look at the documentation for DSolve and study the examples. –  Matariki Nov 18 '13 at 4:14
3  
Other than syntax errors, you can't hope to "plot" something if your "A" has no numerical value. Mathematica needs to know the numerical value of "A" to plot the solution. –  Nasser Nov 18 '13 at 4:43

3 Answers 3

If I make an assumption about the value of A, I can get a solution although it's not very pretty. First I solved your ODE with no boundary condition.

sol = With[{A = 2}, 
  DSolve[r'[x] == Sqrt[-r[x]^2 - 2*A*r[x]^5 + 3*A^(2/3)*r[x]^4], r[x], x]]

sol.png

Next I extract an expression that can plotted from the result.

r[x_] = (sol /. x_C -> 0)[[1, 1, 2]];

Finally I make a plot.

Plot[r[x], {x, -1.3, 0.2}]

plot.png

This isn't a polar plot. The domain and range of r[x] is so restricted that I don't think a polar plot displays it well. I further think that it is likely there is something wrong with your formulation of your ODE, but knowing nothing of the background to your problem, this is mere speculation.

share|improve this answer

My Solution:

Firsty,I give a numer to variable A,A=2

sol1

sol2

sol3

share|improve this answer
4  
Please post code, not images. Posting only images precludes everyone else to copy your code for easy verification. Thanks! –  belisarius Nov 18 '13 at 6:30
1  
@belisarius,Sorry,I think the code is not clear to read.Thanks your advice! –  ShutaoTang Nov 18 '13 at 9:54

The differential equation has constraints on real solutions and the initial condition of r[0]==0 is problematic.

Insights can be obtained by the following:

  1. Checking when derivative has real values:

    w[a_] := N@Reduce[-y^2 + 3 a^(2/3) y^4 - 2 a y^5 >= 0, y]
    
  2. Plotting the function:

    Manipulate[Plot[Sqrt[-y^2 + 3 a^(2/3) y^4 - 2 a y^5], {y, -2, 2}], {a, 0.05,
    20}]
    

    enter image description here

  3. Exploring the shape and domain of real solutions using StreamPlot:

    Manipulate[StreamPlot[{1, Sqrt[-y^2 + 3 a^(2/3) y^4 - 2 a y^5]}, {x, -4, 
    4}, {y, -2, 0}], {a, 0.05, 20}]
    

enter image description here

These issues have contributed to difficulties plotting solutions (as well as syntax errors and failure to specify value for A referred to in comments).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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