HP Forums
General desolve and conditions questions - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: General desolve and conditions questions (/thread-507.html)



General desolve and conditions questions - Rich - 01-24-2014 03:56 PM

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.


RE: General desolve and conditions questions - Han - 01-24-2014 04:09 PM

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.


RE: General desolve and conditions questions - Tim Wessman - 01-24-2014 04:27 PM

Where is for substitutions, not restrictions.

assume(b>0) then do the calculation.


RE: General desolve and conditions questions - Rich - 01-24-2014 04:31 PM

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


RE: General desolve and conditions questions - Han - 01-24-2014 05:09 PM

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


RE: General desolve and conditions questions - Rich - 01-24-2014 07:22 PM

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