tags:

views:

32

answers:

2

Hallo,friends we have the following problem

syms t u0 u1

u0=sin(t);

R1= diff(u0,'t',2)+u0-u0^3;

u1=dsolve('D2u1+u1=R1','t')

gives the ans
u1=R1+c1*sin(t)+c2*cos(t).

But it does not use the value of R1. How can we do this.Please,tell me.

Thanks in advance

+1  A: 

You can use subs(u1, 'R1', R1) to perform the substitution.

jmbr
+1: This is correct, but an even simpler way is to do `subs(u1)`, which replaces as many variables in `u1` as it can with other symbolic values/equations from the workspace.
gnovice
A: 

Sorry for inconvenience. I got answer to my question:

syms t u0 u1

u0=sin(t);

R1= diff(u0,'t',2)+u0-u0^3;

eq1=strcat('D2u1+u1=',char(R1));

u1=dsolve(eq1,'t')

will return the answer using the value of R1.

Anant

related questions