HP Forums

Full Version: General desolve and conditions questions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, engineering student here and recently purchased the prime after having a 48G and 50G for a few years. I believe I am a prime candidate for the calculator, being that I am a student. : )

When using desolve I am getting two different results with different variables.

1. desolve(diff(y)+y=5 AND y(0)=3,y returns -2*x^-x+5
2. desolve(diff(x)+x=5 AND x(0)=3,x [[]]

Any reason why i cannot use syntax 2 for a similar result?

Also, is there is anyway I can set a condition when integrating with conditions?

for example:

3. f(x)= a/(2^x2 - 2*b) where b>0 ?

I have tried piecewise and the result does not look like it is accounted for?

Thank you so much in advance.
diff() takes 2 arguments, but lets you get away with specifying only 1. Usually, you would use diff() as: diff(function, var). If you leave out var, it is presumed to be x, so that diff(y) is really diff(y,x). The same applies for diff(x) -- which is interpreted as diff(x,x). That is, the function is "x" and the var is "x", so the derivative is just 1. So in your second case, you are asking desolve() to solve system of equations \( 1+ x = 5 \) and \( x=3 \); there is no solution to such a system.

I am not sure about #3.
Where is for substitutions, not restrictions.

assume(b>0) then do the calculation.
Thank you Han, that really clears things up! This is for a dx/dt = -x + 5 where x(0) = 3

Would the appropriate formatting be

desolve(diff(-x+5,[t x]) AND x(0)=3,x)

I get bad argument value error now. : (

Thank you Tim for #3! that worked perfectly.

//running to class now bbl
I would use the form: desolve( equations, timevar, var ) and even go as far as making the functions explicit (to avoid any ambiguity arising from using shorthand notation). So rather than just x, I recommend x(t) -- it will accept just x, though, provided you write diff(x,t) and not diff(x).

desolve( x(t) + diff(x(t),t) = 5 AND x(0) = 3, t, x)

Han
Thank you Han, the additional explanation worked out perfectly. The HP community, as always, is another reason I purchased another HP product!
Reference URL's