1
$\begingroup$

I am pretty new to Mathematica. Have a look at this please:

Clear[sol1];
ParallelEvaluate@Clear[sol1];
sol1 = DSolve[f''''[x] - f''[x] + f[x] == x, f, x]
Show[{Plot[
   y[x] /. sol1 /. {C[1] -> 1, C[2] -> 1, C[3] -> 1, 
     C[4] -> 1}, {x, -10, -10}, PlotStyle -> {Red}]}, 
 PlotRange -> {{-10, 10}, Automatic}]

I am getting following error:

Plot::plld: Endpoints for x in {x,-10,-10} must have distinct machine-precision numerical values. Show::gcomb: Could not combine the graphics objects in Show[{Plot[y[x]/. sol1/. {C[1]->1,C[2]->1,C[3]->1,C[4]->1},{x,-10,-10},PlotStyle->{Red}]},PlotRange->{{-10,10},Automatic}].

$\endgroup$
  • $\begingroup$ Thanks @Kuba, I have changed f and y. Yes , you are right, it should be -10, 10. Also how can I adjust C coefficients $\endgroup$ – Meva Sep 29 '16 at 10:58
1
$\begingroup$

{x,-10,-10}

You want to plot from $-10$ to $-10$ ? I guess you want $[-10,10]$.

Another thing is your solutions substitution. You want to substitute to y[x], but you defined a f. You also get back a Function. Therefore you can call it that way.

sol1=DSolve[f''''[x]-f''[x]+f[x]==x,f,x];
func=(f/.sol1/.{C[1]->1,C[2]->1,C[3]->1,C[4]->1})[[1]];
Show[{Plot[func[x],{x,-10,10},PlotStyle->{Red}]},PlotRange->{{-10,10},Automatic}]

enter image description here

(Your ParallelEvaluate@Clear[sol1]; makes no sense btw.)

$\endgroup$
  • $\begingroup$ Thanks @Julien. How can I employ boundary conditions? My aim is to find f whenl x is between 0 and 1. Also How about if my right hand side is an array of numerical values. $\endgroup$ – Meva Sep 29 '16 at 11:02
  • $\begingroup$ @meva, dont pile new questions on an old one. You should accept this answer and ask a new specific question. $\endgroup$ – george2079 Sep 29 '16 at 12:30
  • $\begingroup$ @george2079 I do not know how to accept it ? Can you inform me pls, thanks if so. $\endgroup$ – Meva Oct 1 '16 at 12:36
  • $\begingroup$ there should be a big check mark under the voting buttons at upper left of the question (I'm not sure if it would be still available since the question was closed ) $\endgroup$ – george2079 Oct 1 '16 at 12:46

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