DSolve[{u''''[x] == 0, v''''[x] == (1/(a*Sqrt[π]))*Exp[-x^2/a^2],
u[0] == 0, u'[0] == 0, v''[1] == 0, v'''[1] == 0, u[b/H] == v[b/H],
u'[b/H] == v'[b/H], u''[b/H] == v''[b/H], u'''[b/H] == v'''[b/H]},
{u, v}, x]
How do I save both these functions from the output separately so I can graph them separately? I thought they would be automatically saved as u[x], v[x] but this isn't the case. I also found guides on how to save one function using dsaad[x_] = u[x] /. First @ DSolve but this doesn't work for 2 functions
Answer
I like the approach suggested by @m_goldberg but here is another way you can do it.
sol = DSolve[...]
ux = FullSimplify[u[x] /. sol][[1]]
vx = FullSimplify[v[x] /. sol][[1]]
Remember, for some expressions FullSimplify maybe very time consuming. [[1]] is to remove the curly brackets around the expression.
In response to OP's comments.
To plot the two solutions, you will need to specify numerical values for the parameters a, b and H. BTW, it is not a good practice to use single capital letters.
To have a plot, I assigned random values for the parameters.
Plot[ {ux /. {a -> 5, b -> 2, H -> 1}, vx /. {a -> 5, b -> 2, H -> 1}}, {x, 0, 10},
Frame -> True, PlotStyle -> {Red, Green}]
You can manipulate your plot like this,
Manipulate[ Plot[{ux /. {a -> a1, b -> b1, H -> H1}, vx /. {a -> a1, b -> b1, H -> H1}},
{x, 0, 10}], {a1, 1, 5}, {b1, 1, 5}, {H1, 1, 5}]

Comments
Post a Comment