TransWikia.com

How to make substitution without getting Recursion Limit Error

Mathematica Asked on August 7, 2021

So I just have a complicated expression on the form
z = DiagonalMatrix[{-w'[t]^3 L''[t] (1 + w'[t]^2) - L'[t]^3 H (e^(2 H w[t]) - w'[t]) + (1 - e^(-2 H w[t])) H w'[t]^3 L'[t] + L''[t] w'[t]^2 (w''[t] + H) (1' L'[t]^2), -e^(-2 H w[t]) H L[t]^2 L'[t] - w'[t] L, -H e^(2 H w[t]) L[t]^2 Sin[[Theta]]^2 L'[t] - L[t] Sin[[Theta]]^2 w'[t]}]

However, now I basically want to eliminate w'[t]. I have known expressions for them so I just want to substitute
$$ w'[t] = e^{H w[t]} (1+L'[t]^2)$$

How do I do this without copy pasting the expressions? If I just define w'[t] I get error. If I write something like
Simplify[z, Assumptions -> {w'[t] == (1 + L'[t]^2) e^(2 H x[t])}] I also get the same
error. “`

What should I do? Also, should I substitute w’|t] and w'[t]^2 respectively or will Mathematica understand to also substitute any power of w[t]?

Thanks in advance!

One Answer

You have a couple of mistakes in your definition of z. If e is to be the Euler constant, then it should be capitalized. Also, near the end of z[[1,1]] you have (1' L'[t]^2). Bearing that in mind, this should do the job:

z /. {w' -> f,w'' :> ( f'[#] &)} /. {f :> ((1 + L'[#]^2) E^(2 H x[#]) &)}

The first substitution labels w' as a different function f, and then in the second substitution you substitute in the definition of f using a pure function so that derivatives are correctly calculated.

Answered by Filipe Miguel on August 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP