Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11405

Re: NDSolve bug?

From DC <b.gatessucks@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: NDSolve bug?
Date 2012-08-18 07:44 +0000
Message-ID <k0nh5j$auj$1@smc.vnet.net> (permalink)
References <k0ksom$66f$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


Removing the `=` in the inequalities seems to work :

g = 9.81;
b = 0.;
c = 1.0;

x0 = 0.001;
v0 = 1.001;

sol = First[
  x /. NDSolve[{x''[t] == 
      Piecewise[{{-g - b*x'[t], x[t] > 0 && x'[t] > 0}, {-g - c*x'[t],
          x[t] > 0 && x'[t] < 0}, {g - b*x'[t], 
         x[t] < 0 && x'[t] < 0}, {g - c*x'[t], 
         x[t] < 0 && x'[t] > 0}}, 0.], x'[0] == v0, x[0] == x0}, 
    x, {t, 0, 1}, MaxSteps -> \[Infinity], AccuracyGoal -> 3]]

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

NDSolve bug? Nick Broderick <crazychessman@msn.com> - 2012-08-17 07:44 +0000
  Re: NDSolve bug? DC <b.gatessucks@gmail.com> - 2012-08-18 07:44 +0000

csiph-web