Dsolve: assigning constants of integration and subscripts

Click For Summary

Discussion Overview

The discussion revolves around solving a differential equation using Mathematica's DSolve function, specifically focusing on how to assign constants of integration to chosen variables and how to manipulate subscripts in variable names. The scope includes technical explanations and proposed solutions related to mathematical software usage.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes an equation solved with DSolve and expresses a desire to replace the constants of integration (C[1], C[2]) with specific variables, but encounters an error when attempting to do so.
  • Another participant suggests replacing the parameters after the DSolve command using replacement rules, indicating this method works effectively for them.
  • A different approach is proposed involving the use of GeneratedParameters to define the constants, although the effectiveness of this method is not universally accepted.
  • Another participant recommends deriving the constants from the equation by applying appropriate boundary conditions as a potentially cleaner solution.
  • There is a discussion about the issue of subscripts in Mathematica, where one participant explains that using the letter "o" instead of the number "0" can prevent unwanted simplifications.

Areas of Agreement / Disagreement

Participants present multiple competing views on how to handle the constants of integration and subscripts, with no consensus reached on the best approach.

Contextual Notes

Some methods proposed depend on specific assumptions about the boundary conditions and the representation of variables in Mathematica, which may not be universally applicable.

KleZMeR
Messages
125
Reaction score
0
I have an equation I am solving with Mathematica:

In:

DSolve[y''[t] +
Subscript[\[Omega], c]^2 y[
t] == -Subscript[\[Omega], c]^2 Subscript[v, d]*t +
Subscript[\[Omega], c]*Subscript[v, 0], y[t], t]

Out:

{{y[t] ->
C[2] Cos[t Subscript[\[Omega], c]] +
C[1] Sin[t Subscript[\[Omega], c]] + (
Subscript[v, 0] - t Subscript[v, d] Subscript[\[Omega], c])/
Subscript[\[Omega], c]}}



I would like to replace the two constants of integration(C[1], C[2]) with two chosen variables

If I include this with the DSolve command:

{C[1] -> (Voy/omega), C[2] -> ((Voy-Vd)/omega)},

it returns that I can not use these for variables.

I have also found a GeneratedParameters-> function, but it does not work either,.. and if I'm correct, the GeneratedParameters-> Module{C[1], C[2]..&} function is only to ensure that C[] values are all unique, and does not change their representation.


I am also wondering how to change the subscript of Vo into Voy, Mathematica is not letting me do this.

Again, any help would be appreciated
Thanks
 
Physics news on Phys.org
You can replace the parameters all the way at the end:

DSolve[ ..., y[t], t] /. {C[1] -> ..., C[2] -> ...}

and that works well for me.

When you type V0y Mathematica sees the subscript as an expression, and replaces 0*y by 0 (which is usually very handy, but not what you want now). You can use o (letter oh) instead of 0 (number zero) in the subscript, or put it in a string: V"y,0".
 
Or you can use

GeneratedParameters -> ((Voy - (# - 1) Vd)/omega &)
 
And of course the neatest solution is to just get them from the equation by plugging in the right boundary conditions:

DSolve[{equation, y'[0] == v0y, y[0] = 0}, y[t], t]

or something like that.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K