Skip to main content
added 4 characters in body
Source Link
xinxin guo
  • 1.5k
  • 11
  • 13

Changing the last line to:

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, SolveDelayed -> True] 

or

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, Method -> {"EquationSimplification" -> "Residual"}] 

seems help for your problem.

In reponse to updated question on plot slution

To plot your solution, maybe this is what you want?

Remove["Global`*"] // Quiet; m = 100; a = D[x[t], {t, 2}]; t1up = 2 x''[t] + 1/2 (490 + 34 x''[t] + 2 (490 + 50 x''[t])); t1down = 490 + 53 x''[t]; t1 = Piecewise[{{t1up, x'[t] >= 0}, {t1down, x'[t] < 0}}]]; equa00 = t1 == m*am*a; t0 = 50; (*s1 = NDSolveValue[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}];*) s1 = x /.First@NDSolve[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}]]; sAll = {x[t] -> s1[t], x'[t] -> s1'[t], x''[t] -> s1''[t]}; t1upvalue = t1up /. sAll; t1downvalue = t1down /. sAll; t1value = Piecewise[{{t1upvalue, s1'[t] >= 0}, {t1downvalue, s1'[t] < 0}}]]; Plot[t1value, {t, 0, t0}, PlotRange -> All] 

Changing the last line to:

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, SolveDelayed -> True] 

or

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, Method -> {"EquationSimplification" -> "Residual"}] 

seems help for your problem.

In reponse to updated question on plot slution

To plot your solution, maybe this is what you want?

Remove["Global`*"] // Quiet; m = 100; a = D[x[t], {t, 2}]; t1up = 2 x''[t] + 1/2 (490 + 34 x''[t] + 2 (490 + 50 x''[t])); t1down = 490 + 53 x''[t]; t1 = Piecewise[{{t1up, x'[t] >= 0}, {t1down, x'[t] < 0}}] equa00 = t1 == m*a t0 = 50; (*s1 = NDSolveValue[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}];*) s1 = x /.First@NDSolve[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}] sAll = {x[t] -> s1[t], x'[t] -> s1'[t], x''[t] -> s1''[t]}; t1upvalue = t1up /. sAll; t1downvalue = t1down /. sAll; t1value = Piecewise[{{t1upvalue, s1'[t] >= 0}, {t1downvalue, s1'[t] < 0}}] Plot[t1value, {t, 0, t0}, PlotRange -> All] 

Changing the last line to:

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, SolveDelayed -> True] 

or

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, Method -> {"EquationSimplification" -> "Residual"}] 

seems help for your problem.

In reponse to updated question on plot slution

To plot your solution, maybe this is what you want?

Remove["Global`*"] // Quiet; m = 100; a = D[x[t], {t, 2}]; t1up = 2 x''[t] + 1/2 (490 + 34 x''[t] + 2 (490 + 50 x''[t])); t1down = 490 + 53 x''[t]; t1 = Piecewise[{{t1up, x'[t] >= 0}, {t1down, x'[t] < 0}}]; equa00 = t1 == m*a; t0 = 50; (*s1 = NDSolveValue[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}];*) s1 = x /.First@NDSolve[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}]; sAll = {x[t] -> s1[t], x'[t] -> s1'[t], x''[t] -> s1''[t]}; t1upvalue = t1up /. sAll; t1downvalue = t1down /. sAll; t1value = Piecewise[{{t1upvalue, s1'[t] >= 0}, {t1downvalue, s1'[t] < 0}}]; Plot[t1value, {t, 0, t0}, PlotRange -> All] 
added 112 characters in body
Source Link
xinxin guo
  • 1.5k
  • 11
  • 13

Changing the last line to:

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, SolveDelayed -> True] 

or

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, Method -> {"EquationSimplification" -> "Residual"}] 

seems help for your problem.

In reponse to updated question on plot slution

To plot your solution, maybe this is what you want?

Remove["Global`*"] // Quiet; m = 100; a = D[x[t], {t, 2}]; t1up = 2 x''[t] + 1/2 (490 + 34 x''[t] + 2 (490 + 50 x''[t])); t1down = 490 + 53 x''[t]; t1 = Piecewise[{{t1up, x'[t] >= 0}, {t1down, x'[t] < 0}}] equa00 = t1 == m*a t0 = 50; s1(*s1 = NDSolveValue[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}];];*) s1 = x /.First@NDSolve[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}] sAll = {x[t] -> s1[t], x'[t] -> s1'[t], x''[t] -> s1''[t]}; t1upvalue = t1up /. sAll; t1downvalue = t1down /. sAll; t1value = Piecewise[{{t1upvalue, s1'[t] >= 0}, {t1downvalue, s1'[t] < 0}}] Plot[t1value, {t, 0, t0}, PlotRange -> All] 

Changing the last line to:

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, SolveDelayed -> True] 

or

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, Method -> {"EquationSimplification" -> "Residual"}] 

seems help for your problem.

In reponse to updated question on plot slution

To plot your solution, maybe this is what you want?

Remove["Global`*"] // Quiet; m = 100; a = D[x[t], {t, 2}]; t1up = 2 x''[t] + 1/2 (490 + 34 x''[t] + 2 (490 + 50 x''[t])); t1down = 490 + 53 x''[t]; t1 = Piecewise[{{t1up, x'[t] >= 0}, {t1down, x'[t] < 0}}] equa00 = t1 == m*a t0 = 50; s1 = NDSolveValue[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}]; sAll = {x[t] -> s1[t], x'[t] -> s1'[t], x''[t] -> s1''[t]}; t1upvalue = t1up /. sAll; t1downvalue = t1down /. sAll; t1value = Piecewise[{{t1upvalue, s1'[t] >= 0}, {t1downvalue, s1'[t] < 0}}] Plot[t1value, {t, 0, t0}, PlotRange -> All] 

Changing the last line to:

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, SolveDelayed -> True] 

or

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, Method -> {"EquationSimplification" -> "Residual"}] 

seems help for your problem.

In reponse to updated question on plot slution

To plot your solution, maybe this is what you want?

Remove["Global`*"] // Quiet; m = 100; a = D[x[t], {t, 2}]; t1up = 2 x''[t] + 1/2 (490 + 34 x''[t] + 2 (490 + 50 x''[t])); t1down = 490 + 53 x''[t]; t1 = Piecewise[{{t1up, x'[t] >= 0}, {t1down, x'[t] < 0}}] equa00 = t1 == m*a t0 = 50; (*s1 = NDSolveValue[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}];*) s1 = x /.First@NDSolve[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}] sAll = {x[t] -> s1[t], x'[t] -> s1'[t], x''[t] -> s1''[t]}; t1upvalue = t1up /. sAll; t1downvalue = t1down /. sAll; t1value = Piecewise[{{t1upvalue, s1'[t] >= 0}, {t1downvalue, s1'[t] < 0}}] Plot[t1value, {t, 0, t0}, PlotRange -> All] 
added 763 characters in body
Source Link
xinxin guo
  • 1.5k
  • 11
  • 13

Changing the last line to:

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, SolveDelayed -> True] 

or

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, Method -> {"EquationSimplification" -> "Residual"}] 

seems help for your problem.

In reponse to updated question on plot slution

To plot your solution, maybe this is what you want?

Remove["Global`*"] // Quiet; m = 100; a = D[x[t], {t, 2}]; t1up = 2 x''[t] + 1/2 (490 + 34 x''[t] + 2 (490 + 50 x''[t])); t1down = 490 + 53 x''[t]; t1 = Piecewise[{{t1up, x'[t] >= 0}, {t1down, x'[t] < 0}}] equa00 = t1 == m*a t0 = 50; s1 = NDSolveValue[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}]; sAll = {x[t] -> s1[t], x'[t] -> s1'[t], x''[t] -> s1''[t]}; t1upvalue = t1up /. sAll; t1downvalue = t1down /. sAll; t1value = Piecewise[{{t1upvalue, s1'[t] >= 0}, {t1downvalue, s1'[t] < 0}}] Plot[t1value, {t, 0, t0}, PlotRange -> All] 

Changing the last line to:

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, SolveDelayed -> True] 

or

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, Method -> {"EquationSimplification" -> "Residual"}] 

seems help for your problem.

Changing the last line to:

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, SolveDelayed -> True] 

or

s1 = NDSolve[{equa00, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}, Method -> {"EquationSimplification" -> "Residual"}] 

seems help for your problem.

In reponse to updated question on plot slution

To plot your solution, maybe this is what you want?

Remove["Global`*"] // Quiet; m = 100; a = D[x[t], {t, 2}]; t1up = 2 x''[t] + 1/2 (490 + 34 x''[t] + 2 (490 + 50 x''[t])); t1down = 490 + 53 x''[t]; t1 = Piecewise[{{t1up, x'[t] >= 0}, {t1down, x'[t] < 0}}] equa00 = t1 == m*a t0 = 50; s1 = NDSolveValue[{equa00 // Simplify`PWToUnitStep, x[0] == 1, x'[0] == 1}, x, {t, 0, 50}]; sAll = {x[t] -> s1[t], x'[t] -> s1'[t], x''[t] -> s1''[t]}; t1upvalue = t1up /. sAll; t1downvalue = t1down /. sAll; t1value = Piecewise[{{t1upvalue, s1'[t] >= 0}, {t1downvalue, s1'[t] < 0}}] Plot[t1value, {t, 0, t0}, PlotRange -> All] 
Source Link
xinxin guo
  • 1.5k
  • 11
  • 13
Loading