Re: Different answers between versions
- To: mathgroup at smc.vnet.net
- Subject: [mg42937] Re: Different answers between versions
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Tue, 5 Aug 2003 02:04:52 -0400 (EDT)
- Organization: The University of Western Australia
- Sender: owner-wri-mathgroup at wolfram.com
In article <bg9n2a$pjh$1 at smc.vnet.net>,
nilton.volpato at ig.com.br (Nilton Volpato) wrote:
> I'm getting different answers with the Solve function, like this:
>
> ************
> Version 5.0:
> ************
> In[5]:= Solve[ { f[0.] == -h1, f[cmin] == 0., f[ 0.5 cmax ] == h2,
> f[cmax] == 0., f[.94 lmax ] == h1, f[ .75 cmax ] == h2/3., f'[0.] ==
> 0., f'[0.5 cmax] == 0., f'[cmax] == 0., f''[cmin] == 0. } //. {
> cmax->480., cmin->120., lmax->600., h1->100., h2->120.,
> f[x_]->Plus@@Table[ a[i] x^i, {i,0, 9}] } ]
> Solve::svars: Equations may not give solutions for all "solve"
> variables.
Further to my previous suggestion, you could use InterpolatingPolynomial
instead of Interpolation,
fint = Function[x, Evaluate[InterpolatingPolynomial[
{{0, {-h1, 0}}, {cmin, {0, a, 0}}, {0.5 cmax, {h2, 0}},
{0.75 cmax, h2/3.}, {cmax, {0, 0}}, {0.94 lmax, h1}} /.
{cmax -> 480., cmin -> 120., lmax -> 600., h1 -> 100., h2 -> 120.},
x]]];
determining the value of a by requiring the coefficient of x^10 to
vanish,
fint = fint /. First[Solve[Coefficient[fint[x], x^10] == 0, a]];
and plot the InterpolatingPolynomial.
Plot[fint[x], {x, 0, 0.94 lmax/.lmax -> 600.}, PlotRange -> All];
Cheers,
Paul
--
Paul Abbott Phone: +61 8 9380 2734
School of Physics, M013 Fax: +61 8 9380 1014
The University of Western Australia (CRICOS Provider No 00126G)
35 Stirling Highway
Crawley WA 6009 mailto:paul at physics.uwa.edu.au
AUSTRALIA http://physics.uwa.edu.au/~paul