0

I am almost sure Mathematica has a way to do what I am looking for. I am trying to fit a quadratic T(x) = ax^2 + bx + c to three values of the function analytically. I proceed as follows:

T[x_] := c_0 + c_1 x + c_2 x^2;
Solve[T_w == T[x_w] && T_p == T[x_p] && T_e == T[x_e], {c_0, c_1, c_2}]

The output is:

{{}}

What am I doing incorrectly?

Edit: I am using display subscripts instead of underscores. If I replace the former the latter, it works fine. Why is this true? Is there a way to declare variables with subscripts from the start?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
user3482876
  • 103
  • 1
  • 2
    Underscore does not mean subscript. Underscore means Blank. https://reference.wolfram.com/language/ref/Blank.html – bill s Apr 19 '16 at 01:46

1 Answers1

1

Do not use subscripts as variables, these are a display option. Also, don't start variables and function with capitol letters. This works fine:

t[x_] := c0 + c1 x + c2 x^2;
Solve[tw == t[xw] && tp == t[xp] && te == t[xe], {c0, c1, c2}]
bill s
  • 68,936
  • 4
  • 101
  • 191
  • Thanks for the advice. I found a way to have subscripted variables (I'm not sure if it's bad style) using the Notation package along with the Symbolize[] function. Also, why should I use t instead of T? In this particular application I am dealing with a time dependent heat equation, so T and t are important to separate... – user3482876 Apr 19 '16 at 01:51
  • While you may be able to make some equations work with subscripts, you will regret it. Don't use capitals because many are built in functions. There are dozens of questions on this site where the problem is that the user tried to use N or C as a variable. http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users – bill s Apr 19 '16 at 01:53