• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Anyone used MatLAB before?

matlab is a numberical computation package, the symbolic stuff is handled through a Maple library which I've never used. The matlab helpfile is very good though, so check it out in there.
 
Originally posted by: Heisenberg
I'd try to use Maple first to do it. It's much simpler to use than Mathematica.

Alright - assuming I went back to school to use Mathematica or Maple, what syntax would I use? I've never really used anything other than MatLAB and Simulink.
 
Originally posted by: Heisenberg
I'd try to use Maple first to do it. It's much simpler to use than Mathematica.

like I said, matlab's symbolics are handled by a maple library so if all he has is matlab, he can still use that to solve the problem. If I remember my Maple correctly, it will look something like:

dsolve(diff(x(t),t)=A*B*exp(D*t)/E, x(t))

looking at that again, it looks like a pretty straightforward DE though, wouldn't the solution just be x(t) = A*B*exp(D*t)/(D*E)+k, where k is a constant of integration?
 
Originally posted by: RaynorWolfcastle
Originally posted by: Heisenberg
I'd try to use Maple first to do it. It's much simpler to use than Mathematica.

like I said, matlab's symbolics are handled by a maple library so if all he has is matlab, he can still use that to solve the problem. If I remember my Maple correctly, it will look something like:

dsolve(diff(x(t),t)=A*B*exp(D*t)/E, x(t))

looking at that again, it looks like a pretty straightforward DE though, wouldn't the solution just be x(t) = A*B*exp(D*t)/(D*E)+k, where k is a constant of integration?
Yeah, I think that's the right syntax. I haven't use Maple for ODE stuff for a while. I was reading the equation with E in the exponential, but if E is out front then your solution is right. If E's in the exponential, it'd be x(t) = A*B*(E/D)*exp(D*t/E) + k.
 
Originally posted by: RaynorWolfcastle
Originally posted by: Heisenberg
I'd try to use Maple first to do it. It's much simpler to use than Mathematica.

like I said, matlab's symbolics are handled by a maple library so if all he has is matlab, he can still use that to solve the problem. If I remember my Maple correctly, it will look something like:

dsolve(diff(x(t),t)=A*B*exp(D*t)/E, x(t))

looking at that again, it looks like a pretty straightforward DE though, wouldn't the solution just be x(t) = A*B*exp(D*t)/(D*E)+k, where k is a constant of integration?

That's what I was thinking, it doesn't seem to be an ODE. However, I have the following equations:

B*Cl - 0 = Vb dCb/dt (Caps are variables, lower cases are subscripts) .... (eq 2)

And

Cl = C1 exp (-B*t/Vl) .... (eq 3)

So it's a simple substitution to get
B*(C1 exp (-B*t/Vl)) - 0 = Vb dCb/dt

Then rearrange.. but I just get dCb/dt = a general form of what I posted.

I have B = 1 L/min, Vb = 50 L, Vl = 2 L, C1 = 0.5 g/L, but no idea of an initial condition.. and it says "Substitute equation 3 into equation 2 and solve the ODE by Standard Euler or Runge-Kutta methods. You can use Mathematica for this purpose."

Heisenberg, thanks for your input. To clarify, E = Vb which is outside of the exp.
 
here's a copy/paste of a simple pair of matlab files I wrote LONG ago.

% filename rhs1.m
function ydot=rhs1(t,y); %compute RHS of eqns for t,y
ydot(1) = y(2);
ydot(2) = 1+ y(2)^2;

ydot = ydot';

% filename simple.m
y1_0=0;
y2_0=0;
t0=0;
tend=pi/4;
tspan=[t0 tend];
[t,y]=ode45(@rhs1,tspan,[y1_0 y2_0])
plot(t,y)

The second one's the driver for the first. Note that it's solving TWO diff eq's.
 
Originally posted by: simms
I have B = 1 L/min, Vb = 50 L, Vl = 2 L, C1 = 0.5 g/L, but no idea of an initial condition.. and it says "Substitute equation 3 into equation 2 and solve the ODE by Standard Euler or Runge-Kutta methods. You can use Mathematica for this purpose." .
Both the Euler and Runga-Kutta methods are numerical methods for solving DE's. If they want you to solve it numerically rather than analytically then you'll probably have to use Matlab or Mathematica.
 
Originally posted by: Heisenberg
Originally posted by: simms
I have B = 1 L/min, Vb = 50 L, Vl = 2 L, C1 = 0.5 g/L, but no idea of an initial condition.. and it says "Substitute equation 3 into equation 2 and solve the ODE by Standard Euler or Runge-Kutta methods. You can use Mathematica for this purpose." .
Both the Euler and Runga-Kutta methods are numerical methods for solving DE's. If they want you to solve it numerically rather than analytically then you'll probably have to use Matlab or Mathematica.

I am using Matlab. Did you mean maple?
 
Originally posted by: simms
Originally posted by: Heisenberg
Originally posted by: simms
I have B = 1 L/min, Vb = 50 L, Vl = 2 L, C1 = 0.5 g/L, but no idea of an initial condition.. and it says "Substitute equation 3 into equation 2 and solve the ODE by Standard Euler or Runge-Kutta methods. You can use Mathematica for this purpose." .
Both the Euler and Runga-Kutta methods are numerical methods for solving DE's. If they want you to solve it numerically rather than analytically then you'll probably have to use Matlab or Mathematica.

I am using Matlab. Did you mean maple?
No, I meant Matlab. I don't think Maple can solve DE's numerically, but I could be wrong.
 
Originally posted by: hypn0tik
Do you really need Matlab for that differential equation?

Edit: I'm assuming A, B, D and E are constants?


Yes, A B D E are constants.

It has to be done via some kind of computer algorithm, so Matlab has to be used (or Mathematica), but I've never solved an ODE or even a DE in MatLAB.
 
Back
Top