How can I solve derivative with restrictions/bounds on variable

3 次查看(过去 30 天)
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 :/

回答(1 个)

Navya Seelam
Navya Seelam 2019-7-23
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

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by