Group Abstract Group Abstract

Message Boards Message Boards

ParametricNDSolve error: Dependent variables cannot depend on parameters

Posted 1 year ago
POSTED BY: Carles Lopez
3 Replies

This works:

t0 = 7;
u0 = 1;
v0 = -1/2; w0 = 1;
z0 = Sin[t0];
sol = ParametricNDSolve[{u'[x] == -Log[10] (-u[x] + a v[x]), 
    v'[x] == -Log[10] (u[x] - (a w[x])^2),
    w'[x] == -Log[10] (w[x] (1 + a) - Cos[x]),
    z'[x] == -Log[10] (4 a Sin[x]),
    u[7] == u0, v[7] == v0, w[7] == w0, z[7] == z0},
   {u, v, w, z}, {x, 7, -2}, {a},
   MaxSteps -> Infinity];
x[t_] := Log[1 + t]/Log[10];
F[t_, a_, b_] :=  Sqrt[(b (1 + t)^3)/(1 - u[a][x[t]]^2 -
       v[a][x[t]]^2 -
       w[a][x[t]]^2 - z[a][x[t]]^2)] /. sol;
Gsol = ParametricNDSolveValue[{G'[t]/(1 + t) -
     G[t]/(1 + t)^2 - 1/F[t, a, b] == 0, G[0] == 0},
  G, {t, 0, 3}, {a, b}, MaxSteps -> Infinity]
POSTED BY: Gianluca Gorni
Posted 1 year ago
POSTED BY: Sangdon Lee
Posted 1 year ago

Thanks for the feedback! The x[t] := Log[1 + t]/Log[10] is more of a rescaling for the F function in order to be used in the second DE. Could that be done in another way?

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