Message Boards Message Boards

0
|
3426 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Using Piecewise with DSolve

Posted 3 years ago

Hello, I am trying to solve a set of differential equations with Piecewise functions. It seems to work if using only one piecewise function, but does not work with two. I am not sure if I am missing something in the setup. I thought the problem was with using units, but that doesn't seem to be the case. Appreciate the help. Here is the code.

DSolve[{0.31918 (Piecewise[{{10.268 + 0.0239 x, x <= 2000}, {58.068, 
           x > 2000}}] - TAnnulus[x])/(0.00256455 + 
        1/Piecewise[{{25, x <= 1900}, {100000, x > 1900}}]) - 
    4.63572 (TAnnulus[x] - TIn[x]) == 3976 D[TAnnulus[x], x], 
  4.635726619241774` (TAnnulus[x] - TIn[x]) == 
   3976 Derivative[1][TIn][x], TAnnulus[0] == 1, 
  TAnnulus[3000] == TIn[3000]}, {TAnnulus, TIn}, {x, 0, 3000}]
POSTED BY: srinivas.gk
3 Replies
Posted 3 years ago

Thank you that seems to have solved the problem.

POSTED BY: srinivas.gk

Answer only with numerics:

 SOL = NDSolve[{0.31918 (Piecewise[{{10.268 + 0.0239 x, 
              x <= 2000}, {58.068, x > 2000}}] - 
           TAnnulus[x])/(0.00256455 + 
           1/Piecewise[{{25, x <= 1900}, {100000, x > 1900}}]) - 
       4.63572 (TAnnulus[x] - TIn[x]) == 3976 D[TAnnulus[x], x], 
     4.635726619241774` (TAnnulus[x] - TIn[x]) == 
      3976 Derivative[1][TIn][x], TAnnulus[0] == 1, 
     TAnnulus[3000] == TIn[3000]}, {TAnnulus, TIn}, {x, 0, 3000}];

 Plot[{TAnnulus[x], TIn[x]} /. SOL // Evaluate, {x, 0, 3000}, 
  PlotLegends -> {"TAnnulus", "TIn"}]

Probably symbolic solution can't be found.

POSTED BY: Mariusz Iwaniuk

Use NDSolve instead of DSolve.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract