# How can I solve derivative with restrictions/bounds on variable

1 view (last 30 days)
Taylor Oishi on 3 Jul 2019
Answered: Navya Seelam on 23 Jul 2019
Hi so essentially I want to solve the derivative of a function. I am currently getting an error as follows: "Unable to find explicit solution"
I am trying to find the variable 'f' which is unknown. I know sigma1 and all other variables are assigned numbers, however I don't know what z is.
I am assuming because my function is a tad complicated, it might be a good idea to restrict the possible values of z. I know z has to be positive and must be less than another L.
Here is a an example of my code thus far.
CC=[1 1 1 1;exp(-w1*L) exp(w1*L) exp(-w2*L) exp(w2*L);-w1 w1 -w2 w2;-w1*exp(-w1*L) w1*exp(w1*L) -w2*exp(-w2*L) w2*exp(w2*L)]^-1*[0;f;0;0];
C1=CC(1); %% This is equal to (5536113736801657*f)/72057594037927936
C2=CC(2);
C3=CC(3);
C4=CC(4);
Sigma1 = -(1/2)*D/A + C1*exp(-w1*z)+C2*exp(w1*z)+ C3*exp(-w2*z)+C4*exp(w2*z);
dSigma1 = diff(Sigma1, z);
solve(dSigma1, z)
Edit: I have tried solve(dSigma1>0,dSigma1<L,z) still not working :/

Navya Seelam on 23 Jul 2019
Hi,
You can use assume function to restrict the values of z
assume(z>0 & z<L);
Moreover, if you are trying to find variable ‘f’ use solve (dSigma1, f) instead of solve(dSigma1,z)
For more details on “assume” check the link below