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


Groups > comp.soft-sys.math.mathematica > #8570

Changing the argument

From Niles <niels.martinsen@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Changing the argument
Date 2012-02-17 11:23 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jhldc2$oq5$1@smc.vnet.net> (permalink)

Show all headers | View raw


Hi!

I have the following piece of code (I am using this as an example):

primaryFunc[i_] := {
   secondaryFunc[z_] := 1/z;
   func = 0;
   For[j = 1, j < i + 1, j++,
    func = func + secondaryFunc[z];
    ];
   func};

test = primaryFunc[20];


Say that I need to use the function "test" in NDSolve, e.g.:
NDSolve[{z''[t] == test, z[0] == 0, z'[0] == 20}, z, {t, 0, 5}];

The problem is that the variable "z" in "test" needs to become "z[t]".
How can this be done most efficiently? Thanks for the help in advance.

Best,
Niles.

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Changing the argument Niles <niels.martinsen@gmail.com> - 2012-02-17 11:23 +0000
  Re: Changing the argument Andrés <jarosham@gmail.com> - 2012-02-18 11:33 +0000

csiph-web