Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14557 > unrolled thread

NSolve Question

Started by"Hagwood, Charles R" <charles.hagwood@nist.gov>
First post2013-05-21 04:03 +0000
Last post2013-05-23 07:16 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  NSolve Question "Hagwood, Charles R" <charles.hagwood@nist.gov> - 2013-05-21 04:03 +0000
    Re: NSolve Question daniel.lichtblau0@gmail.com - 2013-05-23 07:16 +0000

#14557 — NSolve Question

From"Hagwood, Charles R" <charles.hagwood@nist.gov>
Date2013-05-21 04:03 +0000
SubjectNSolve Question
Message-ID<knerlt$3g$1@smc.vnet.net>
 I have a known function f[x,y] and I want to solve the differential
 equation (1)  for v[t], using NSolve

 partial [f(v[t],v'[t])/partial x +(d/dt)[partial f(v[t],v'[t])/partial y =0                (1)

 where  v'[t] = derivative of v[t] with respect to t.

 I  did a test to set up (1).  I let

 f[x_,y_]:=x^2+y^3

 v[t]:=Sin[t]

 g1[x_,y_]:=partial f(x,y)/partial x

 g2[x_,y_]:=partial f(x,y)/partial y

 g3[t_]:=g1[v[t],v'[t]]+D[g2[v[t],v'[t]],t]

 and asked Mathematica to evaluate

 g3[t]

 but,  Mathematica gives an error. Thanks for the help

 Charles


[toc] | [next] | [standalone]


#14576

Fromdaniel.lichtblau0@gmail.com
Date2013-05-23 07:16 +0000
Message-ID<knkfo3$hnf$1@smc.vnet.net>
In reply to#14557
On Monday, May 20, 2013 11:03:09 PM UTC-5, Hagwood, Charles R wrote:
> I have a known function f[x,y] and I want to solve the differential
>
>  equation (1)  for v[t], using NSolve
>
>  partial [f(v[t],v'[t])/partial x +(d/dt)[partial f(v[t],v'[t])/partial y=0                (1)
> 
>  where  v'[t] = derivative of v[t] with respect to t.
>
>  I  did a test to set up (1).  I let
>
>  f[x_,y_]:=x^2+y^3
>
>  v[t]:=Sin[t]
>
>  g1[x_,y_]:=partial f(x,y)/partial x
>
>  g2[x_,y_]:=partial f(x,y)/partial y
>
>  g3[t_]:=g1[v[t],v'[t]]+D[g2[v[t],v'[t]],t]
> 
>  and asked Mathematica to evaluate
>
>  g3[t]
>
>  but,  Mathematica gives an error. Thanks for the help
> 
>  Charles

Hard to know exactly what you did because there is some traditional form, I guess, in what you show. My guess is the issue is in the definition of v[t_], wherein the pattern underbar was omitted. That would mess up the definition in a way that would make g3[t] give a bad result.

Here is code that seems to work.

f[x_,y_] := x^2+y^3
v[t_] := Sin[t]
g1[x_,y_] := D[f[x,y],x]
g2[x_,y_] := D[f[x,y],y]
g3[t_] := g1[v[t],v'[t]]+D[g2[v[t],v'[t]],t]

Then g3[t] gives

Out[18]= 2 Sin[t] - 6 Cos[t] Sin[t]

Daniel Lichtblau
Wolfram Research

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web