0
$\begingroup$

I was trying to test something out with the function

vz[z_, t_] = C1[t] Exp[-k z] + C2[t] Exp[k z]

But when I evaluated

Solve[vz[0, t] == 0, C1[t]]

it gave me the error:

$-C2$ is not a valid variable

So how do I go about getting C1[t] as a function of C2[t]?

$\endgroup$

closed as off-topic by m_goldberg, Henrik Schumacher, MarcoB, Bob Hanlon, Bill Watts Feb 15 at 0:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, Henrik Schumacher, MarcoB, Bob Hanlon, Bill Watts
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Please post the actually used code and not a $\TeX$ified version of it. Otherwise, it is hard to tell what went wrong. $\endgroup$ – Henrik Schumacher Feb 11 at 7:11
  • 1
    $\begingroup$ Try to restart the kernel and try again by executing only the two lines you show in the question. It seems C1[t] already has a value assigned to it (you can verify this ha evaluating C1[t]) $\endgroup$ – Lukas Lang Feb 11 at 7:17
  • $\begingroup$ Your code, written as follows works: vz[z_, t_] := C1[t] Exp[\[Minus]k z] + C2[t] Exp[k z]; Solve[vz[0, t] == 0, C1[t]] yielding this: {{C1[t] -> -C2[t]}}. $\endgroup$ – Alexei Boulbitch Feb 11 at 8:44
  • $\begingroup$ @HenrikSchumacher My bad, I've edited the equations to be exactly like it is in the code. There are no additional lines in the code. $\endgroup$ – Daniel Harper Feb 11 at 13:36
  • $\begingroup$ @AlexeiBoulbitch It's strange, the code seems to be working now, despite not having made any changes. That's for the help anyway. $\endgroup$ – Daniel Harper Feb 11 at 13:38