Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'DSolve/Solve and complicated arguments' topicStudent Support Forum > General > Archives > "DSolve/Solve and complicated arguments"

Help | Reply To Topic
Author Comment/Response
Elliot Schrock
05/30/09 11:31pm

Hi,

So, I'm trying to solve a series of equations that are apparently difficult for mathematica to process. First, I define a couple functions, with no problems:

k[t_] := Piecewise[{{6, 0 < t < 24}, {
0, 24 < t < 48}, {6, 48 < t < 72}, {
0, 72 < t < 96}, {3, 96 < t < 120}, {0, t > 120}}]

and

H[t_] := x[t] h[t] - k[t]h[t] + h[t]u[t] + l[t](24 - k[t] - h[t] - u[t]).

Next, I ask Mathematica to solve several equations involving these functions for the functions of t contained in H:

DSolve[{D[H[t], h[t]] == 0,
D[H[t], u[t]] == 0,
D[H[t], x[t]] == -l'[t], D[H[t], l[t]] == x'[t], x[0] ==
0, l[168] == 0}, {h[t], u[t], x[t], l[t]}, t].

This doesn't give me any problems, and outputs the solutions. However, the H defined above is a simplified version of the actual function I want to use. So, when I make H more complicated, say, like so:

H[t_] := x[t]^2 h[t] - k[t]h[t] + h[t]u[t] + l[t](24 - k[t] - h[t] - u[t])

where all I've done is square the first x[t], Mathematica gives me the error:

Solve::svars: Equations may not give solutions for all "solve" variables.

The number of variables has not changed. Why am I getting that error?

When I try to instead add another variable to H, like so:

H[t_] := x[t]^(1/2) h[t] - k[t]h[t] + h[t]u[t] + l[t](24 - k[t] - h[t] - u[t] - f[t])

where all that is added is an f[t], and then I run:

DSolve[{D[H[t], h[t]] == 0,
D[H[t], f[t]] == 0,
D[H[t], u[t]] == 0,
D[H[t], x[t]] == -l'[t], D[H[t],
l[t]] == x'[t], x[0] == 0, l[168] == 0}, {h[t], u[
t], x[t], f[t], l[t]}, t]

where I've added the equation involving f and added it to the list of solve variables, I get no output at all, just the command I entered. When I both make it more complicated and add a variable, it gives me the svars error. What's going on? How can I fix it?

URL: ,
Help | Reply To Topic