# Differential Equations and Unit Notation

Posted 3 years ago
2693 Views
|
5 Replies
|
0 Total Likes
|
 See attached file. What do I get the Syntax::sntxi: Incomplete expression; more input is needed . error when I try to use the math palette for derivatives? What does the dot in 10. Farad Micro Volt mean? Multiplication? https://i.imgur.com/BGAyG8L.png Why is my C1 changed to C[1]? What does that mean? Basically I wanted to use C for capacitance but the letter C was protected How come my unit convert isn't working?  In[80]:= R := 500 Ohm C1 := 0.5 Micro Farad V := 20 Volt DSolve[R*q1'[t] + 1/C1*q1[t] == V, q1[t], t] Out[83]= {{q1[t] -> 10. Farad Micro Volt + E^(-((0.004 t)/(Farad Micro Ohm))) C[1]}} In[92]:= TraditionalForm[R*q1'[t] + 1/C1*q1[t] == V] Out[92]//TraditionalForm= (2. q1(t))/(Farad Micro)+500 Ohm q1^\[Prime](t)==20 Volt In[89]:= R := 500 Ohm C1 := 0.5 Micro Farad V := 20 Volt DSolve[R*(\[DifferentialD]/\[DifferentialD]t)q1[t] + 1/C1*q1[t] == V, q1[t], t] During evaluation of In[89]:= Syntax::sntxi: Incomplete expression; more input is needed . In[94]:= UnitConvert[ 10. Farad Micro Volt + E^(-((0.004 t)/(Farad Micro Ohm))) C[1], Coulomb] Out[94]= UnitConvert[ 10. Farad Micro Volt + E^(-((0.004 t)/(Farad Micro Ohm))) C[1], Coulomb]  Attachments:
5 Replies
Sort By:
Posted 3 years ago
 To do calculations with units, use Quantity expressions: If you want to enter something representing "500 Ohms" you would write: Quantity[500, " Ohm"]  Capitalized variable names are used for built in functions and values. Variables you create should start with a lower case letter. The variable C is used as a constant of integration by Mathematica in some of it's output. It is good practice to use descriptive variable names when programming. When you do math on a chalkboard, it's fine to just "C" or "q1" as a variable name. In programming, this becomes a major problem. Try using descriptive variable names. DSolve doesn't seem to be able to understand the equation with Units. You'll want to make sure the dimensions of your units are correct. It's possible though that DSolve just can't handle a differential equation with these units in them.
Posted 3 years ago
 Even though he answered the question, I'd still love to hear anyone else's thoughts on the belowIn particular, I won't be using Mathematica for coding- I'll be using it as a glorified calculator for PSETs in classes. I've noticed alot of people use wolframalpha.com the website heavily in classes for crunching calculations with units and solving diffeqs but ultimately it would be nice to be able to work with more than one line. I've noticed also when a new problem is written sometimes and the numbers end up a bit too messy for a TI 83 so the TA's writing the solution may use mathematica or maple to crunch some calculations. I've also noticed some students turning in typed solutions to PSET's So being able to express things in ways my classmates can understand like 5 Ohms or 6 meters as opposed to R1=Quantity[,] is helpful I'm looking for tips on making my Mathematica code to look as much like math done handwritten on paper as possible Also does anyone know if Dsolve can handle units? What's our best bet for equation solving with units if you want to make the work look as readable to non coders as possible?
Posted 3 years ago
 You can enter Quantity expressions using Free-Form input. It's natural language, so it's very intuitive. See this tutorial: http://www.wolfram.com/language/elementary-introduction/17-units.html